return p_control;
}
-void ConfigControl::doApply( intf_thread_t *p_intf )
-{
- switch( getType() )
- {
- case CONFIG_ITEM_INTEGER:
- case CONFIG_ITEM_BOOL:
- {
- VIntConfigControl *vicc = qobject_cast<VIntConfigControl *>(this);
- assert( vicc );
- config_PutInt( p_intf, vicc->getName(), vicc->getValue() );
- break;
- }
- case CONFIG_ITEM_FLOAT:
- {
- VFloatConfigControl *vfcc =
- qobject_cast<VFloatConfigControl *>(this);
- assert( vfcc );
- config_PutFloat( p_intf, vfcc->getName(), vfcc->getValue() );
- break;
- }
- case CONFIG_ITEM_STRING:
- {
- VStringConfigControl *vscc =
- qobject_cast<VStringConfigControl *>(this);
- assert( vscc );
- config_PutPsz( p_intf, vscc->getName(), qtu( vscc->getValue() ) );
- break;
- }
- case CONFIG_ITEM_KEY:
- {
- KeySelectorControl *ksc = qobject_cast<KeySelectorControl *>(this);
- assert( ksc );
- ksc->doApply();
- }
- }
-}
-
/*******************************************************
* Simple widgets
*******************************************************/
* String-based controls
*************************************************************************/
+void
+VStringConfigControl::doApply( intf_thread_t *p_intf )
+{
+ config_PutPsz( p_intf, getName(), qtu( getValue() ) );
+}
+
/*********** String **************/
StringConfigControl::StringConfigControl( vlc_object_t *_p_this,
module_config_t *_p_item,
* Integer-based controls
*************************************************************************/
+void
+VIntConfigControl::doApply( intf_thread_t *p_intf )
+{
+ config_PutInt( p_intf, getName(), getValue() );
+}
+
/*********** Integer **************/
IntegerConfigControl::IntegerConfigControl( vlc_object_t *_p_this,
module_config_t *_p_item,
* Float-based controls
*************************************************************************/
+void
+VFloatConfigControl::doApply( intf_thread_t *p_intf )
+{
+ config_PutFloat( p_intf, getName(), getValue() );
+}
+
/*********** Float **************/
FloatConfigControl::FloatConfigControl( vlc_object_t *_p_this,
module_config_t *_p_item,
Qt::UserRole, shortcutValue->getValue() );
}
-void KeySelectorControl::doApply()
+void KeySelectorControl::doApply( intf_thread_t* )
{
QTreeWidgetItem *it;
for( int i = 0; i < table->topLevelItemCount() ; i++ )
static ConfigControl * createControl( vlc_object_t*,
module_config_t*,QWidget*,
QGridLayout *, int& );
- void doApply( intf_thread_t *);
+ virtual void doApply( intf_thread_t *) = 0;
protected:
vlc_object_t *p_this;
module_config_t *p_item;
ConfigControl(a,b) {};
virtual int getValue() const = 0;
virtual int getType() const { return CONFIG_ITEM_INTEGER; }
+ virtual void doApply( intf_thread_t *);
};
class IntegerConfigControl : public VIntConfigControl
ConfigControl(a,b) {};
virtual float getValue() const = 0;
virtual int getType() const { return CONFIG_ITEM_FLOAT; }
+ virtual void doApply( intf_thread_t *);
};
class FloatConfigControl : public VFloatConfigControl
ConfigControl(a,b) {};
virtual QString getValue() const = 0;
virtual int getType() const { return CONFIG_ITEM_STRING; }
+ virtual void doApply( intf_thread_t *);
};
class StringConfigControl : public VStringConfigControl
virtual int getType() const { return CONFIG_ITEM_KEY; }
virtual void hide() { table->hide(); if( label ) label->hide(); }
virtual void show() { table->show(); if( label ) label->show(); }
- void doApply();
+ virtual void doApply( intf_thread_t *);
private:
void finish();
QLabel *label;