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

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 )
{
switch( getType() )
{
case 1:
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 2:
case CONFIG_ITEM_FLOAT:
{
VFloatConfigControl *vfcc =
qobject_cast<VFloatConfigControl *>(this);
......@@ -171,7 +172,7 @@ void ConfigControl::doApply( intf_thread_t *p_intf )
config_PutFloat( p_intf, vfcc->getName(), vfcc->getValue() );
break;
}
case 3:
case CONFIG_ITEM_STRING:
{
VStringConfigControl *vscc =
qobject_cast<VStringConfigControl *>(this);
......@@ -179,7 +180,7 @@ void ConfigControl::doApply( intf_thread_t *p_intf )
config_PutPsz( p_intf, vscc->getName(), qta( vscc->getValue() ) );
break;
}
case 4:
case CONFIG_ITEM_KEY:
{
KeySelectorControl *ksc = qobject_cast<KeySelectorControl *>(this);
assert( ksc );
......
......@@ -107,7 +107,7 @@ public:
ConfigControl(a,b) {};
virtual ~VIntConfigControl() {};
virtual int getValue() = 0;
virtual int getType() { return 1; }
virtual int getType() { return CONFIG_ITEM_INTEGER; }
};
class IntegerConfigControl : public VIntConfigControl
......@@ -185,6 +185,7 @@ public:
virtual int getValue();
virtual void show() { checkbox->show(); }
virtual void hide() { checkbox->hide(); }
virtual int getType() { return CONFIG_ITEM_BOOL; }
private:
QCheckBox *checkbox;
void finish();
......@@ -203,7 +204,7 @@ public:
ConfigControl(a,b) {};
virtual ~VFloatConfigControl() {};
virtual float getValue() = 0;
virtual int getType() { return 2; }
virtual int getType() { return CONFIG_ITEM_FLOAT; }
};
class FloatConfigControl : public VFloatConfigControl
......@@ -252,7 +253,7 @@ public:
ConfigControl(a,b) {};
virtual ~VStringConfigControl() {};
virtual QString getValue() = 0;
virtual int getType() { return 3; }
virtual int getType() { return CONFIG_ITEM_STRING; }
};
class StringConfigControl : public VStringConfigControl
......@@ -443,7 +444,7 @@ class KeySelectorControl : public ConfigControl
public:
KeySelectorControl( vlc_object_t *, module_config_t *, QWidget *,
QGridLayout*, int& );
virtual int getType() { return 4; }
virtual int getType() { return CONFIG_ITEM_KEY; }
virtual ~KeySelectorControl() {};
virtual void hide() { table->hide(); if( label ) label->hide(); }
virtual void show() { table->show(); if( label ) label->show(); }
......
Supports Markdown
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