Commit c4840c68 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Using already defined configuration type. This is needed for finer...

Qt4 - Using already defined configuration type. This is needed for finer control and differentiation between int and bool for the time being.
parent 25c473a8
...@@ -156,14 +156,15 @@ void ConfigControl::doApply( intf_thread_t *p_intf ) ...@@ -156,14 +156,15 @@ void ConfigControl::doApply( intf_thread_t *p_intf )
{ {
switch( getType() ) switch( getType() )
{ {
case 1: case CONFIG_ITEM_INTEGER:
case CONFIG_ITEM_BOOL:
{ {
VIntConfigControl *vicc = qobject_cast<VIntConfigControl *>(this); VIntConfigControl *vicc = qobject_cast<VIntConfigControl *>(this);
assert( vicc ); assert( vicc );
config_PutInt( p_intf, vicc->getName(), vicc->getValue() ); config_PutInt( p_intf, vicc->getName(), vicc->getValue() );
break; break;
} }
case 2: case CONFIG_ITEM_FLOAT:
{ {
VFloatConfigControl *vfcc = VFloatConfigControl *vfcc =
qobject_cast<VFloatConfigControl *>(this); qobject_cast<VFloatConfigControl *>(this);
...@@ -171,7 +172,7 @@ void ConfigControl::doApply( intf_thread_t *p_intf ) ...@@ -171,7 +172,7 @@ void ConfigControl::doApply( intf_thread_t *p_intf )
config_PutFloat( p_intf, vfcc->getName(), vfcc->getValue() ); config_PutFloat( p_intf, vfcc->getName(), vfcc->getValue() );
break; break;
} }
case 3: case CONFIG_ITEM_STRING:
{ {
VStringConfigControl *vscc = VStringConfigControl *vscc =
qobject_cast<VStringConfigControl *>(this); qobject_cast<VStringConfigControl *>(this);
...@@ -179,7 +180,7 @@ void ConfigControl::doApply( intf_thread_t *p_intf ) ...@@ -179,7 +180,7 @@ void ConfigControl::doApply( intf_thread_t *p_intf )
config_PutPsz( p_intf, vscc->getName(), qta( vscc->getValue() ) ); config_PutPsz( p_intf, vscc->getName(), qta( vscc->getValue() ) );
break; break;
} }
case 4: case CONFIG_ITEM_KEY:
{ {
KeySelectorControl *ksc = qobject_cast<KeySelectorControl *>(this); KeySelectorControl *ksc = qobject_cast<KeySelectorControl *>(this);
assert( ksc ); assert( ksc );
......
...@@ -107,7 +107,7 @@ public: ...@@ -107,7 +107,7 @@ public:
ConfigControl(a,b) {}; ConfigControl(a,b) {};
virtual ~VIntConfigControl() {}; virtual ~VIntConfigControl() {};
virtual int getValue() = 0; virtual int getValue() = 0;
virtual int getType() { return 1; } virtual int getType() { return CONFIG_ITEM_INTEGER; }
}; };
class IntegerConfigControl : public VIntConfigControl class IntegerConfigControl : public VIntConfigControl
...@@ -185,6 +185,7 @@ public: ...@@ -185,6 +185,7 @@ public:
virtual int getValue(); virtual int getValue();
virtual void show() { checkbox->show(); } virtual void show() { checkbox->show(); }
virtual void hide() { checkbox->hide(); } virtual void hide() { checkbox->hide(); }
virtual int getType() { return CONFIG_ITEM_BOOL; }
private: private:
QCheckBox *checkbox; QCheckBox *checkbox;
void finish(); void finish();
...@@ -203,7 +204,7 @@ public: ...@@ -203,7 +204,7 @@ public:
ConfigControl(a,b) {}; ConfigControl(a,b) {};
virtual ~VFloatConfigControl() {}; virtual ~VFloatConfigControl() {};
virtual float getValue() = 0; virtual float getValue() = 0;
virtual int getType() { return 2; } virtual int getType() { return CONFIG_ITEM_FLOAT; }
}; };
class FloatConfigControl : public VFloatConfigControl class FloatConfigControl : public VFloatConfigControl
...@@ -252,7 +253,7 @@ public: ...@@ -252,7 +253,7 @@ public:
ConfigControl(a,b) {}; ConfigControl(a,b) {};
virtual ~VStringConfigControl() {}; virtual ~VStringConfigControl() {};
virtual QString getValue() = 0; virtual QString getValue() = 0;
virtual int getType() { return 3; } virtual int getType() { return CONFIG_ITEM_STRING; }
}; };
class StringConfigControl : public VStringConfigControl class StringConfigControl : public VStringConfigControl
...@@ -443,7 +444,7 @@ class KeySelectorControl : public ConfigControl ...@@ -443,7 +444,7 @@ class KeySelectorControl : public ConfigControl
public: public:
KeySelectorControl( vlc_object_t *, module_config_t *, QWidget *, KeySelectorControl( vlc_object_t *, module_config_t *, QWidget *,
QGridLayout*, int& ); QGridLayout*, int& );
virtual int getType() { return 4; } virtual int getType() { return CONFIG_ITEM_KEY; }
virtual ~KeySelectorControl() {}; virtual ~KeySelectorControl() {};
virtual void hide() { table->hide(); if( label ) label->hide(); } virtual void hide() { table->hide(); if( label ) label->hide(); }
virtual void show() { table->show(); if( label ) label->show(); } virtual void show() { table->show(); if( label ) label->show(); }
......
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