]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/preferences_widgets.hpp
Qt: Drop the no longer used sample_classic
[vlc] / modules / gui / qt4 / components / preferences_widgets.hpp
index 293b5074b935f2e3991fb23da9ff18287c9b4fc5..4ef0c35274b260c3a819af63a89377e30c4c6238 100644 (file)
@@ -30,8 +30,6 @@
 # include "config.h"
 #endif
 
-#include <vlc_common.h>
-
 #include "qt4.hpp"
 #include <assert.h>
 
@@ -47,9 +45,8 @@
 #include <QPushButton>
 #include <QVector>
 #include <QDialog>
+#include <QFontComboBox>
 
-
-class QFile;
 class QTreeWidget;
 class QTreeWidgetItem;
 class QGroupBox;
@@ -57,6 +54,28 @@ class QGridLayout;
 class QDialogButtonBox;
 class QVBoxLayout;
 
+/*******************************************************
+ * Simple widgets
+ *******************************************************/
+
+class InterfacePreviewWidget : public QLabel
+{
+    Q_OBJECT
+public:
+    InterfacePreviewWidget( QWidget * );
+    enum enum_style {
+                 COMPLETE, // aka MPC
+                 MINIMAL,  // aka WMP12 minimal
+                 SKINS };
+public slots:
+    void setPreview( enum_style );
+    void setNormalPreview( bool b_minimal );
+};
+
+/*******************************************************
+ * Variable controls
+ *******************************************************/
+
 class ConfigControl : public QObject
 {
     Q_OBJECT
@@ -188,14 +207,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;
+    QAbstractButton *checkbox;
     void finish();
 };
 
@@ -287,9 +306,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,28 +327,28 @@ 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();
 };
 
-#if 0
-class FontConfigControl : public FileConfigControl
+class FontConfigControl : public VStringConfigControl
 {
     Q_OBJECT;
 public:
     FontConfigControl( vlc_object_t *, module_config_t *, QWidget *,
-                       QGridLayout *, int&, bool pwd );
+                       QGridLayout *, int&);
     FontConfigControl( vlc_object_t *, module_config_t *, QLabel *,
-                       QLineEdit *, QPushButton *, bool pwd );
+                       QFontComboBox *);
     virtual ~FontConfigControl() {};
-public slots:
-    virtual void updateField();
+    virtual QString getValue(){ return font->currentFont().family(); }
+protected:
+    QLabel *label;
+    QFontComboBox *font;
 };
-#endif
 
 class ModuleConfigControl : public VStringConfigControl
 {
@@ -367,7 +386,7 @@ public:
     virtual void hide();
     virtual void show();
 public slots:
-    void onUpdate( int value );
+    void onUpdate();
 private:
     void finish( bool );
     QVector<checkBoxListItem*> modules;
@@ -387,7 +406,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;
@@ -397,7 +416,7 @@ private slots:
 };
 
 void setfillVLCConfigCombo(const char *configname, intf_thread_t *p_intf,
-                        QComboBox *combo, QWidget *parent = 0 );
+                        QComboBox *combo );
 
 #if 0
 struct ModuleCheckBox {
@@ -425,19 +444,24 @@ private slot:
  **********************************************************************/
 class KeyShortcutEdit: public QLineEdit
 {
-    Q_OBJECT
+    Q_OBJECT;
 public:
     void setValue( int _value ){ value = _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(); }
+    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;
@@ -455,16 +479,18 @@ private:
     QTreeWidget *table;
     KeyShortcutEdit *shortcutValue;
     QList<module_config_t *> values;
+    SearchLineEdit *actionSearch;
 private slots:
     void setTheKey();
-    void selectKey( QTreeWidgetItem * = NULL );
+    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:
@@ -472,8 +498,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