]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/preferences_widgets.hpp
Fix configure hotkeys behaviour on keyboard seection.
[vlc] / modules / gui / qt4 / components / preferences_widgets.hpp
index 486909bb8cd536306fe40a5939a06d8dbb2ba65c..715f26afd1204206f0be6cb832a32dce7ed094b3 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
-#ifndef _INFOPANELS_H_
-#define _INFOPANELS_H_
+#ifndef _PREFERENCESWIDGETS_H_
+#define _PREFERENCESWIDGETS_H_
 
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
 
 #include "qt4.hpp"
 #include <assert.h>
@@ -107,7 +111,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
@@ -159,6 +163,7 @@ private:
 
 class IntegerListConfigControl : public VIntConfigControl
 {
+Q_OBJECT
 public:
     IntegerListConfigControl( vlc_object_t *, module_config_t *, QWidget *,
                               bool, QGridLayout*, int& );
@@ -169,9 +174,12 @@ public:
     virtual void hide() { combo->hide(); if( label ) label->hide(); }
     virtual void show() { combo->show(); if( label ) label->show(); }
 private:
-    void finish( bool );
+    void finish(module_config_t *, bool );
     QLabel *label;
     QComboBox *combo;
+private slots:
+    void actionRequested( int );
+
 };
 
 class BoolConfigControl : public VIntConfigControl
@@ -185,6 +193,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 +212,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 +261,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
@@ -307,6 +316,7 @@ public slots:
     virtual void updateField();
 };
 
+#if 0
 class FontConfigControl : public FileConfigControl
 {
     Q_OBJECT;
@@ -319,6 +329,7 @@ public:
 public slots:
     virtual void updateField();
 };
+#endif
 
 class ModuleConfigControl : public VStringConfigControl
 {
@@ -375,10 +386,10 @@ public:
     virtual QString getValue();
     virtual void hide() { combo->hide(); if( label ) label->hide(); }
     virtual void show() { combo->show(); if( label ) label->show(); }
+       QComboBox *combo;
 private:
-    void finish( bool );
+    void finish(module_config_t *, bool );
     QLabel *label;
-    QComboBox *combo;
 private slots:
     void actionRequested( int );
 
@@ -411,27 +422,16 @@ private slot:
 /**********************************************************************
  * Key selector widget
  **********************************************************************/
-class KeyInputDialog : public QDialog
-{
-public:
-    KeyInputDialog( QList<module_config_t *> &, const char *, QWidget * );
-    int keyValue;
-    bool conflicts;
-private:
-    void checkForConflicts( int i_vlckey );
-    void keyPressEvent( QKeyEvent *);
-    void wheelEvent( QWheelEvent *);
-    QLabel *selected;
-    QVBoxLayout *vLayout;
-    const char *keyToChange;
-    QList<module_config_t*> values;
-    QDialogButtonBox *buttonBox;
-};
-
 class KeyShortcutEdit: public QLineEdit
 {
     Q_OBJECT
+public:
+    void setValue( int _value ){ value = _value; }
+    int getValue() const { return value; }
+public slots:
+    virtual void clear(void) { value = 0; QLineEdit::clear(); }
 private:
+    int value;
     virtual void mousePressEvent( QMouseEvent *event );
 signals:
     void pressed();
@@ -443,7 +443,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(); }
@@ -457,7 +457,22 @@ private:
 private slots:
     void setTheKey();
     void selectKey( QTreeWidgetItem * = NULL );
-    void select1Key( QTreeWidgetItem *);
+    void select1Key();
 };
 
+class KeyInputDialog : public QDialog
+{
+public:
+    KeyInputDialog( QTreeWidget *, QString, QWidget * );
+    int keyValue;
+    bool conflicts;
+private:
+    QTreeWidget *table;
+    void checkForConflicts( int i_vlckey );
+    void keyPressEvent( QKeyEvent *);
+    void wheelEvent( QWheelEvent *);
+    QLabel *selected;
+    QVBoxLayout *vLayout;
+    QDialogButtonBox *buttonBox;
+};
 #endif