]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/preferences_widgets.hpp
Hotkey selector widget. Save not implemented yet
[vlc] / modules / gui / qt4 / components / preferences_widgets.hpp
index f21f79d6be9fca81b4102f06e7912f8e6a8b8885..11e3877c8f5a31218d77b8b732433d7a57302601 100644 (file)
 #define _INFOPANELS_H_
 #include <vlc/vlc.h>
 #include <QWidget>
+#include <QTreeWidget>
 #include <QLineEdit>
 #include <QSpinBox>
 #include <QDoubleSpinBox>
 #include <QComboBox>
 #include <QCheckBox>
+#include <QVector>
+#include <QDialog>
+
 #include "ui/input_stats.h"
 #include "qt4.hpp"
 #include <assert.h>
@@ -61,7 +65,8 @@ public:
                                           module_config_t*,QWidget* );
     static ConfigControl * createControl( vlc_object_t*,
                                           module_config_t*,QWidget*,
-                                          QGridLayout *, int);
+                                          QGridLayout *, int& );
+    void doApply( intf_thread_t *);
 protected:
     vlc_object_t *p_this;
     module_config_t *p_item;
@@ -91,7 +96,7 @@ class IntegerConfigControl : public VIntConfigControl
 {
 public:
     IntegerConfigControl( vlc_object_t *, module_config_t *, QWidget *,
-                          QGridLayout *, int );
+                          QGridLayout *, int& );
     IntegerConfigControl( vlc_object_t *, module_config_t *,
                           QLabel*, QSpinBox* );
     virtual ~IntegerConfigControl() {};
@@ -111,7 +116,7 @@ class IntegerRangeConfigControl : public IntegerConfigControl
 {
 public:
     IntegerRangeConfigControl( vlc_object_t *, module_config_t *, QWidget *,
-                               QGridLayout *, int );
+                               QGridLayout *, int& );
     IntegerRangeConfigControl( vlc_object_t *, module_config_t *,
                                QLabel*, QSpinBox* );
 private:
@@ -122,7 +127,7 @@ class IntegerListConfigControl : public VIntConfigControl
 {
 public:
     IntegerListConfigControl( vlc_object_t *, module_config_t *, QWidget *,
-                              bool, QGridLayout*, int );
+                              bool, QGridLayout*, int& );
     IntegerListConfigControl( vlc_object_t *, module_config_t *, QLabel *,
                               QComboBox*, bool );
     virtual ~IntegerListConfigControl() {};
@@ -139,7 +144,7 @@ class BoolConfigControl : public VIntConfigControl
 {
 public:
     BoolConfigControl( vlc_object_t *, module_config_t *, QWidget *,
-                       QGridLayout *, int );
+                       QGridLayout *, int& );
     BoolConfigControl( vlc_object_t *, module_config_t *,
                        QLabel *, QCheckBox*, bool );
     virtual ~BoolConfigControl() {};
@@ -170,7 +175,7 @@ class FloatConfigControl : public VFloatConfigControl
 {
 public:
     FloatConfigControl( vlc_object_t *, module_config_t *, QWidget *,
-                        QGridLayout *, int );
+                        QGridLayout *, int& );
     FloatConfigControl( vlc_object_t *, module_config_t *,
                         QLabel*, QDoubleSpinBox* );
     virtual ~FloatConfigControl() {};
@@ -190,24 +195,12 @@ class FloatRangeConfigControl : public FloatConfigControl
 {
 public:
     FloatRangeConfigControl( vlc_object_t *, module_config_t *, QWidget *,
-                             QGridLayout *, int );
+                             QGridLayout *, int& );
     FloatRangeConfigControl( vlc_object_t *, module_config_t *,
                              QLabel*, QDoubleSpinBox* );
 private:
     void finish();
 };
-#if 0
-class FloatConfigControl : public VFloatConfigControl
-{
-public:
-    FloatConfigControl( vlc_object_t *a, module_config_t *b, QWidget *c ) :
-                ConfigControl(a,b,c) {};
-    virtual ~FloatConfigControl() {};
-    virtual float getValue();
-private:
-    QDoubleSpinBox *spin;
-};
-#endif
 
 /*******************************************************
  * String-based controls
@@ -228,7 +221,7 @@ class StringConfigControl : public VStringConfigControl
 {
 public:
     StringConfigControl( vlc_object_t *, module_config_t *, QWidget *,
-                         QGridLayout *, int,  bool pwd );
+                         QGridLayout *, int&,  bool pwd );
     StringConfigControl( vlc_object_t *, module_config_t *, QLabel *,
                          QLineEdit*,  bool pwd );
     virtual ~StringConfigControl() {};
@@ -245,7 +238,7 @@ class ModuleConfigControl : public VStringConfigControl
 {
 public:
     ModuleConfigControl( vlc_object_t *, module_config_t *, QWidget *, bool,
-                         QGridLayout*, int );
+                         QGridLayout*, int& );
     ModuleConfigControl( vlc_object_t *, module_config_t *, QLabel *,
                          QComboBox*, bool );
     virtual ~ModuleConfigControl() {};
@@ -258,11 +251,32 @@ private:
     QComboBox *combo;
 };
 
+class ModuleListConfigControl : public VStringConfigControl
+{
+    Q_OBJECT;
+public:
+    ModuleListConfigControl( vlc_object_t *, module_config_t *, QWidget *,
+                             bool, QGridLayout*, int& );
+//    ModuleListConfigControl( vlc_object_t *, module_config_t *, QLabel *,
+//                         QComboBox*, bool );
+    virtual ~ModuleListConfigControl();
+    virtual QString getValue();
+    virtual void hide();
+    virtual void show();
+public slots:
+    void wakeUp_TheUserJustClickedOnSomething( int value );
+private:
+    void finish( bool );
+    QVector<QCheckBox*> modules;
+    QLabel *label;
+    QLineEdit *text;
+};
+
 class StringListConfigControl : public VStringConfigControl
 {
 public:
     StringListConfigControl( vlc_object_t *, module_config_t *, QWidget *,
-                             bool, QGridLayout*, int );
+                             bool, QGridLayout*, int& );
     StringListConfigControl( vlc_object_t *, module_config_t *, QLabel *,
                              QComboBox*, bool );
     virtual ~StringListConfigControl() {};
@@ -295,4 +309,41 @@ private slot:
 };
 #endif
 
+/**********************************************************************
+ * Key selector widget
+ **********************************************************************/
+class KeyInputDialog : public QDialog
+{
+public:
+    KeyInputDialog( QList<module_config_t *> &, char * );
+    int keyValue;
+    bool conflicts;
+private:
+    void keyPressEvent( QKeyEvent *);
+    QLabel *selected;
+    QLabel *warning;
+    char * keyToChange;
+    QList<module_config_t*> values;
+};
+
+class KeySelectorControl : public ConfigControl
+{
+    Q_OBJECT;
+public:
+    KeySelectorControl( vlc_object_t *, module_config_t *, QWidget *,
+                        QGridLayout*, int& );
+    virtual int getType() { return 4; }
+    virtual ~KeySelectorControl() {};
+    virtual void hide() { table->hide(); label->hide(); }
+    virtual void show() { table->show(); label->show(); }
+    void doApply();
+private:
+    void finish();
+    QLabel *label;
+    QTreeWidget *table;
+    QList<module_config_t *> values;
+private slots:
+    void selectKey( QTreeWidgetItem *);
+};
+
 #endif