Commit 15f94976 authored by Jean-Philippe André's avatar Jean-Philippe André

Qt: support spin icon in extension dialogs

parent 30b3704a
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment