else
fprintf(stderr, "TODO\n" );
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:
break;
}
void StringConfigControl::finish( QLabel *label )
{
+ text->setText( qfu(p_item->psz_value) );
text->setToolTip( qfu(p_item->psz_longtext) );
label->setToolTip( qfu(p_item->psz_longtext) );
}
label->setToolTip( qfu(p_item->psz_longtext) );
}
-ModuleConfigControl::~ModuleConfigControl() {};
-
QString ModuleConfigControl::getValue()
{
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();
+}
public:
VIntConfigControl( vlc_object_t *a, module_config_t *b, QWidget *c ) :
ConfigControl(a,b,c) {};
+ VIntConfigControl( vlc_object_t *a, module_config_t *b ) :
+ ConfigControl(a,b) {};
virtual ~VIntConfigControl() {};
virtual int getValue() = 0;
};
-#if 0
class IntegerConfigControl : public VIntConfigControl
{
public:
IntegerConfigControl( vlc_object_t *, module_config_t *, QWidget * );
- virtual ~IntegerConfigControl();
+ IntegerConfigControl( vlc_object_t *, module_config_t *,
+ QLabel*, QSpinBox* );
+ virtual ~IntegerConfigControl() {};
virtual int getValue();
private:
QSpinBox *spin;
+ void finish( QLabel * );
};
+#if 0
class BoolConfigControl : public VIntConfigControl
{
public:
public:
VFloatConfigControl( vlc_object_t *a, module_config_t *b, QWidget *c ) :
ConfigControl(a,b,c) {};
+ VFloatConfigControl( vlc_object_t *a, module_config_t *b ) :
+ ConfigControl(a,b) {};
virtual ~VFloatConfigControl() {};
virtual float getValue() = 0;
};
bycat );
ModuleConfigControl( vlc_object_t *, module_config_t *, QLabel *,
QComboBox*, bool );
- virtual ~ModuleConfigControl();
+ virtual ~ModuleConfigControl() {};
virtual QString getValue();
private:
void finish( QLabel *, bool );
void InputManager::update()
{
/// \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 navigationChanged( 0 );
- emit statusChanged( 0 ); // 0 = STOPPED, 1 = PAUSE, 2 = PLAY
+ emit statusChanged( 0 ); // 0 = STOPPED, 1 = PLAY, 2 = PAUSE
}
/* Update position */
void MainInterface::setStatus( int status )
{
- if( status == 2 ) // Playing
+ if( status == 1 ) // Playing
ui.playButton->setIcon( QIcon( ":/pixmaps/pause.png" ) );
else
ui.playButton->setIcon( QIcon( ":/pixmaps/play.png" ) );
{
intf_dialog_args_t *p_arg = new intf_dialog_args_t;
p_arg->p_dialog = (interaction_dialog_t *)(new_val.p_address);
-
+
MainInterface *p_interface = (MainInterface*)param;
DialogEvent *event = new DialogEvent( INTF_DIALOG_INTERACTION, 0, p_arg );
QApplication::postEvent( THEDP, static_cast<QEvent*>(event) );