]> git.sesse.net Git - vlc/commitdiff
Qt4 - Using already defined configuration type. This is needed for finer control...
authorJean-Baptiste Kempf <jb@videolan.org>
Sun, 6 Jan 2008 07:49:37 +0000 (07:49 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Sun, 6 Jan 2008 07:49:37 +0000 (07:49 +0000)
modules/gui/qt4/components/preferences_widgets.cpp
modules/gui/qt4/components/preferences_widgets.hpp

index ae61dc479bc06fcd5fb4f57be74557354e0f5a8f..63eb99cea36a9c9a9cc50105841e64767be1fd3e 100644 (file)
@@ -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 );
index 97971d809640bc3ec1e0d80f741b5bcf2df8ca3e..b94ee9c24bd4ceffb477676572970d19c60fd3d4 100644 (file)
@@ -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(); }