[vlc-commits] Qt: support spin icon in extension dialogs

Jean-Philippe André git at videolan.org
Sat Jan 22 00:56:46 CET 2011


vlc | branch: master | Jean-Philippe André <jpeg at videolan.org> | Tue Jan 18 22:10:10 2011 +0100| [15f94976c0432fe0d3d57e4c726c5738c85eb9d6] | committer: Jean-Philippe André

Qt: support spin icon in extension dialogs

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=15f94976c0432fe0d3d57e4c726c5738c85eb9d6
---

 modules/gui/qt4/dialogs/extensions.cpp |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/modules/gui/qt4/dialogs/extensions.cpp b/modules/gui/qt4/dialogs/extensions.cpp
index f4ac6fb..48da03c 100644
--- a/modules/gui/qt4/dialogs/extensions.cpp
+++ b/modules/gui/qt4/dialogs/extensions.cpp
@@ -38,6 +38,7 @@
 #include <QComboBox>
 #include <QCloseEvent>
 #include <QCoreApplication>
+#include "util/customwidgets.hpp"
 
 ExtensionsDialogProvider *ExtensionsDialogProvider::instance = NULL;
 
@@ -218,6 +219,7 @@ QWidget* ExtensionDialog::CreateWidget( extension_widget_t *p_widget )
     QCheckBox *checkBox = NULL;
     QComboBox *comboBox = NULL;
     QListWidget *list = NULL;
+    SpinningIcon *spinIcon = NULL;
     struct extension_widget_t::extension_widget_value_t *p_value = NULL;
 
     assert( p_widget->p_sys_intf == NULL );
@@ -327,6 +329,12 @@ QWidget* ExtensionDialog::CreateWidget( extension_widget_t *p_widget )
                      selectMapper, map() );
             return list;
 
+        case EXTENSION_WIDGET_SPIN_ICON:
+            spinIcon = new SpinningIcon( this );
+            spinIcon->play( p_widget->i_spin_loops );
+            p_widget->p_sys_intf = spinIcon;
+            return spinIcon;
+
         default:
             msg_Err( p_intf, "Widget type %d unknown", p_widget->type );
             return NULL;
@@ -559,6 +567,7 @@ QWidget* ExtensionDialog::UpdateWidget( extension_widget_t *p_widget )
     QCheckBox *checkBox = NULL;
     QComboBox *comboBox = NULL;
     QListWidget *list = NULL;
+    SpinningIcon *spinIcon = NULL;
     struct extension_widget_t::extension_widget_value_t *p_value = NULL;
 
     assert( p_widget->p_sys_intf != NULL );
@@ -637,6 +646,15 @@ QWidget* ExtensionDialog::UpdateWidget( extension_widget_t *p_widget )
             }
             return list;
 
+        case EXTENSION_WIDGET_SPIN_ICON:
+            spinIcon = static_cast< SpinningIcon* >( p_widget->p_sys_intf );
+            if( !spinIcon->isPlaying() && p_widget->i_spin_loops != 0 )
+                spinIcon->play( p_widget->i_spin_loops );
+            else if( spinIcon->isPlaying() && p_widget->i_spin_loops == 0 )
+                spinIcon->stop();
+            p_widget->i_height = p_widget->i_width = 16;
+            return spinIcon;
+
         default:
             msg_Err( p_intf, "Widget type %d unknown", p_widget->type );
             return NULL;



More information about the vlc-commits mailing list