From: Jean-Baptiste Kempf Date: Sun, 6 Jan 2008 07:49:37 +0000 (+0000) Subject: Qt4 - Using already defined configuration type. This is needed for finer control... X-Git-Tag: 0.9.0-test0~3614 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=c4840c68238f1728e4d84f347ba8ba5922801ff7;p=vlc Qt4 - Using already defined configuration type. This is needed for finer control and differentiation between int and bool for the time being. --- diff --git a/modules/gui/qt4/components/preferences_widgets.cpp b/modules/gui/qt4/components/preferences_widgets.cpp index ae61dc479b..63eb99cea3 100644 --- a/modules/gui/qt4/components/preferences_widgets.cpp +++ b/modules/gui/qt4/components/preferences_widgets.cpp @@ -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(this); assert( vicc ); config_PutInt( p_intf, vicc->getName(), vicc->getValue() ); break; } - case 2: + case CONFIG_ITEM_FLOAT: { VFloatConfigControl *vfcc = qobject_cast(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(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(this); assert( ksc ); diff --git a/modules/gui/qt4/components/preferences_widgets.hpp b/modules/gui/qt4/components/preferences_widgets.hpp index 97971d8096..b94ee9c24b 100644 --- a/modules/gui/qt4/components/preferences_widgets.hpp +++ b/modules/gui/qt4/components/preferences_widgets.hpp @@ -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(); }