]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/preferences_widgets.hpp
UI: Sprefs_audio fixes and enhancements
[vlc] / modules / gui / qt4 / components / preferences_widgets.hpp
index ee0bee11244fe01433e854f1addfd8502d14830b..e007c45ea69c00578e1da01fef010fef7a8d4962 100644 (file)
@@ -30,8 +30,6 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
-
 #include "qt4.hpp"
 #include <assert.h>
 
@@ -48,8 +46,6 @@
 #include <QVector>
 #include <QDialog>
 
-
-class QFile;
 class QTreeWidget;
 class QTreeWidgetItem;
 class QGroupBox;
@@ -57,6 +53,23 @@ class QGridLayout;
 class QDialogButtonBox;
 class QVBoxLayout;
 
+/*******************************************************
+ * Simple widgets
+ *******************************************************/
+
+class InterfacePreviewWidget : public QLabel
+{
+    Q_OBJECT
+public:
+    InterfacePreviewWidget( QWidget * );
+public slots:
+    void setPreview( int );
+};
+
+/*******************************************************
+ * Variable controls
+ *******************************************************/
+
 class ConfigControl : public QObject
 {
     Q_OBJECT
@@ -188,14 +201,14 @@ public:
     BoolConfigControl( vlc_object_t *, module_config_t *, QWidget *,
                        QGridLayout *, int& );
     BoolConfigControl( vlc_object_t *, module_config_t *,
-                       QLabel *, QCheckBox*, bool );
+                       QLabel *, QAbstractButton*, bool );
     virtual ~BoolConfigControl() {};
     virtual int getValue();
     virtual void show() { checkbox->show(); }
     virtual void hide() { checkbox->hide(); }
     virtual int getType() { return CONFIG_ITEM_BOOL; }
-private:
-    QCheckBox *checkbox;
+private:    
+    QAbstractButton *checkbox;
     void finish();
 };
 
@@ -287,9 +300,9 @@ class FileConfigControl : public VStringConfigControl
     Q_OBJECT;
 public:
     FileConfigControl( vlc_object_t *, module_config_t *, QWidget *,
-                       QGridLayout *, int&, bool pwd );
+                       QGridLayout *, int& );
     FileConfigControl( vlc_object_t *, module_config_t *, QLabel *,
-                       QLineEdit *, QPushButton *, bool pwd );
+                       QLineEdit *, QPushButton * );
     virtual ~FileConfigControl() {};
     virtual QString getValue() { return text->text(); };
     virtual void show() { text->show(); if( label ) label->show(); browse->show(); }
@@ -308,9 +321,9 @@ class DirectoryConfigControl : public FileConfigControl
     Q_OBJECT;
 public:
     DirectoryConfigControl( vlc_object_t *, module_config_t *, QWidget *,
-                            QGridLayout *, int&, bool pwd );
+                            QGridLayout *, int& );
     DirectoryConfigControl( vlc_object_t *, module_config_t *, QLabel *,
-                            QLineEdit *, QPushButton *, bool pwd );
+                            QLineEdit *, QPushButton * );
     virtual ~DirectoryConfigControl() {};
 public slots:
     virtual void updateField();
@@ -356,6 +369,7 @@ struct checkBoxListItem {
 class ModuleListConfigControl : public VStringConfigControl
 {
     Q_OBJECT;
+    friend class ConfigControl;
 public:
     ModuleListConfigControl( vlc_object_t *, module_config_t *, QWidget *,
                              bool, QGridLayout*, int& );
@@ -366,7 +380,7 @@ public:
     virtual void hide();
     virtual void show();
 public slots:
-    void onUpdate( int value );
+    void onUpdate();
 private:
     void finish( bool );
     QVector<checkBoxListItem*> modules;
@@ -386,7 +400,7 @@ public:
     virtual QString getValue();
     virtual void hide() { combo->hide(); if( label ) label->hide(); }
     virtual void show() { combo->show(); if( label ) label->show(); }
-       QComboBox *combo;
+    QComboBox *combo;
 private:
     void finish(module_config_t *, bool );
     QLabel *label;
@@ -396,7 +410,7 @@ private slots:
 };
 
 void setfillVLCConfigCombo(const char *configname, intf_thread_t *p_intf,
-                        QComboBox *combo, QWidget *parent = 0 );
+                        QComboBox *combo );
 
 #if 0
 struct ModuleCheckBox {
@@ -424,17 +438,24 @@ private slot:
  **********************************************************************/
 class KeyShortcutEdit: public QLineEdit
 {
-    Q_OBJECT
+    Q_OBJECT;
 public:
     void setValue( int _value ){ value = _value; }
-    int getValue(){ return value; }
+    int getValue() const { return value; }
+
+    void setGlobal( bool _value ) { b_global = _value; }
+    bool getGlobal()  const { return b_global; }
+public slots:
+    virtual void clear(void) { value = 0; QLineEdit::clear(); b_global = false;}
 private:
     int value;
+    bool b_global;
     virtual void mousePressEvent( QMouseEvent *event );
 signals:
     void pressed();
 };
 
+class SearchLineEdit;
 class KeySelectorControl : public ConfigControl
 {
     Q_OBJECT;
@@ -452,16 +473,18 @@ private:
     QTreeWidget *table;
     KeyShortcutEdit *shortcutValue;
     QList<module_config_t *> values;
+    SearchLineEdit *actionSearch;
 private slots:
     void setTheKey();
-    void selectKey( QTreeWidgetItem * = NULL );
-    void select1Key( QTreeWidgetItem *);
+    void selectKey( QTreeWidgetItem * = NULL, int column = 1 );
+    void select1Key();
+    void filter( const QString & );
 };
 
 class KeyInputDialog : public QDialog
 {
 public:
-    KeyInputDialog( QTreeWidget *, QString, QWidget * );
+    KeyInputDialog( QTreeWidget *, const QString&, QWidget *, bool b_global = false);
     int keyValue;
     bool conflicts;
 private:
@@ -469,8 +492,9 @@ private:
     void checkForConflicts( int i_vlckey );
     void keyPressEvent( QKeyEvent *);
     void wheelEvent( QWheelEvent *);
-    QLabel *selected;
+    QLabel *selected, *warning;
     QVBoxLayout *vLayout;
     QDialogButtonBox *buttonBox;
+    bool b_global;
 };
 #endif