Commit 2fe13ef6 authored by Clément Stenac's avatar Clément Stenac

Fix play/pause icons

Implement integer config control
parent 44649aae
...@@ -60,6 +60,14 @@ ConfigControl *ConfigControl::createControl( vlc_object_t *p_this, ...@@ -60,6 +60,14 @@ ConfigControl *ConfigControl::createControl( vlc_object_t *p_this,
else else
fprintf(stderr, "TODO\n" ); fprintf(stderr, "TODO\n" );
break; break;
case CONFIG_ITEM_INTEGER:
if( p_item->i_list )
fprintf( stderr, "Todo\n" );
else if( p_item->i_min || p_item->i_max )
fprintf( stderr, "Todo\n" );
else
p_control = new IntegerConfigControl( p_this, p_item, parent );
break;
default: default:
break; break;
} }
...@@ -96,6 +104,7 @@ StringConfigControl::StringConfigControl( vlc_object_t *_p_this, ...@@ -96,6 +104,7 @@ StringConfigControl::StringConfigControl( vlc_object_t *_p_this,
void StringConfigControl::finish( QLabel *label ) void StringConfigControl::finish( QLabel *label )
{ {
text->setText( qfu(p_item->psz_value) );
text->setToolTip( qfu(p_item->psz_longtext) ); text->setToolTip( qfu(p_item->psz_longtext) );
label->setToolTip( qfu(p_item->psz_longtext) ); label->setToolTip( qfu(p_item->psz_longtext) );
} }
...@@ -165,9 +174,46 @@ void ModuleConfigControl::finish( QLabel *label, bool bycat ) ...@@ -165,9 +174,46 @@ void ModuleConfigControl::finish( QLabel *label, bool bycat )
label->setToolTip( qfu(p_item->psz_longtext) ); label->setToolTip( qfu(p_item->psz_longtext) );
} }
ModuleConfigControl::~ModuleConfigControl() {};
QString ModuleConfigControl::getValue() QString ModuleConfigControl::getValue()
{ {
return combo->itemData( combo->currentIndex() ).toString(); return combo->itemData( combo->currentIndex() ).toString();
} }
/**************************************************************************
* Integer-based controls
*************************************************************************/
/*********** Integer **************/
IntegerConfigControl::IntegerConfigControl( vlc_object_t *_p_this,
module_config_t *_p_item,
QWidget *_parent ) :
VIntConfigControl( _p_this, _p_item, _parent )
{
QLabel *label = new QLabel( qfu(p_item->psz_text) );
spin = new QSpinBox;
finish( label );
QHBoxLayout *layout = new QHBoxLayout();
layout->addWidget( label, 0 ); layout->addWidget( spin, 1 );
widget->setLayout( layout );
}
IntegerConfigControl::IntegerConfigControl( vlc_object_t *_p_this,
module_config_t *_p_item,
QLabel *label, QSpinBox *_spin ) :
VIntConfigControl( _p_this, _p_item )
{
spin = _spin;
finish(label);
}
void IntegerConfigControl::finish( QLabel *label )
{
spin->setValue( p_item->i_value );
spin->setToolTip( qfu(p_item->psz_longtext) );
label->setToolTip( qfu(p_item->psz_longtext) );
}
int IntegerConfigControl::getValue()
{
return spin->value();
}
...@@ -74,21 +74,26 @@ class VIntConfigControl : public ConfigControl ...@@ -74,21 +74,26 @@ class VIntConfigControl : public ConfigControl
public: public:
VIntConfigControl( vlc_object_t *a, module_config_t *b, QWidget *c ) : VIntConfigControl( vlc_object_t *a, module_config_t *b, QWidget *c ) :
ConfigControl(a,b,c) {}; ConfigControl(a,b,c) {};
VIntConfigControl( vlc_object_t *a, module_config_t *b ) :
ConfigControl(a,b) {};
virtual ~VIntConfigControl() {}; virtual ~VIntConfigControl() {};
virtual int getValue() = 0; virtual int getValue() = 0;
}; };
#if 0
class IntegerConfigControl : public VIntConfigControl class IntegerConfigControl : public VIntConfigControl
{ {
public: public:
IntegerConfigControl( vlc_object_t *, module_config_t *, QWidget * ); IntegerConfigControl( vlc_object_t *, module_config_t *, QWidget * );
virtual ~IntegerConfigControl(); IntegerConfigControl( vlc_object_t *, module_config_t *,
QLabel*, QSpinBox* );
virtual ~IntegerConfigControl() {};
virtual int getValue(); virtual int getValue();
private: private:
QSpinBox *spin; QSpinBox *spin;
void finish( QLabel * );
}; };
#if 0
class BoolConfigControl : public VIntConfigControl class BoolConfigControl : public VIntConfigControl
{ {
public: public:
...@@ -108,6 +113,8 @@ class VFloatConfigControl : public ConfigControl ...@@ -108,6 +113,8 @@ class VFloatConfigControl : public ConfigControl
public: public:
VFloatConfigControl( vlc_object_t *a, module_config_t *b, QWidget *c ) : VFloatConfigControl( vlc_object_t *a, module_config_t *b, QWidget *c ) :
ConfigControl(a,b,c) {}; ConfigControl(a,b,c) {};
VFloatConfigControl( vlc_object_t *a, module_config_t *b ) :
ConfigControl(a,b) {};
virtual ~VFloatConfigControl() {}; virtual ~VFloatConfigControl() {};
virtual float getValue() = 0; virtual float getValue() = 0;
}; };
...@@ -160,7 +167,7 @@ public: ...@@ -160,7 +167,7 @@ public:
bycat ); bycat );
ModuleConfigControl( vlc_object_t *, module_config_t *, QLabel *, ModuleConfigControl( vlc_object_t *, module_config_t *, QLabel *,
QComboBox*, bool ); QComboBox*, bool );
virtual ~ModuleConfigControl(); virtual ~ModuleConfigControl() {};
virtual QString getValue(); virtual QString getValue();
private: private:
void finish( QLabel *, bool ); void finish( QLabel *, bool );
......
...@@ -53,13 +53,13 @@ void InputManager::setInput( input_thread_t *_p_input ) ...@@ -53,13 +53,13 @@ void InputManager::setInput( input_thread_t *_p_input )
void InputManager::update() void InputManager::update()
{ {
/// \todo Emit the signals only if it changed /// \todo Emit the signals only if it changed
if( !p_input || p_input->b_die ) return; if( !p_input ) return;
if( p_input->b_dead ) if( p_input->b_dead || p_input->b_die )
{ {
emit positionUpdated( 0.0, 0, 0 ); emit positionUpdated( 0.0, 0, 0 );
emit navigationChanged( 0 ); emit navigationChanged( 0 );
emit statusChanged( 0 ); // 0 = STOPPED, 1 = PAUSE, 2 = PLAY emit statusChanged( 0 ); // 0 = STOPPED, 1 = PLAY, 2 = PAUSE
} }
/* Update position */ /* Update position */
......
...@@ -200,7 +200,7 @@ void MainInterface::setName( QString name ) ...@@ -200,7 +200,7 @@ void MainInterface::setName( QString name )
void MainInterface::setStatus( int status ) void MainInterface::setStatus( int status )
{ {
if( status == 2 ) // Playing if( status == 1 ) // Playing
ui.playButton->setIcon( QIcon( ":/pixmaps/pause.png" ) ); ui.playButton->setIcon( QIcon( ":/pixmaps/pause.png" ) );
else else
ui.playButton->setIcon( QIcon( ":/pixmaps/play.png" ) ); ui.playButton->setIcon( QIcon( ":/pixmaps/play.png" ) );
...@@ -249,7 +249,7 @@ static int InteractCallback( vlc_object_t *p_this, ...@@ -249,7 +249,7 @@ static int InteractCallback( vlc_object_t *p_this,
{ {
intf_dialog_args_t *p_arg = new intf_dialog_args_t; intf_dialog_args_t *p_arg = new intf_dialog_args_t;
p_arg->p_dialog = (interaction_dialog_t *)(new_val.p_address); p_arg->p_dialog = (interaction_dialog_t *)(new_val.p_address);
MainInterface *p_interface = (MainInterface*)param; MainInterface *p_interface = (MainInterface*)param;
DialogEvent *event = new DialogEvent( INTF_DIALOG_INTERACTION, 0, p_arg ); DialogEvent *event = new DialogEvent( INTF_DIALOG_INTERACTION, 0, p_arg );
QApplication::postEvent( THEDP, static_cast<QEvent*>(event) ); QApplication::postEvent( THEDP, static_cast<QEvent*>(event) );
......
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