]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/preferences_widgets.hpp
Qt4 - Complete preferences. Make ModuleList Clearer than it is now... Align SpinBox...
[vlc] / modules / gui / qt4 / components / preferences_widgets.hpp
index f93dd488084770627f88e69ccb7a249d812a26ce..8f09e57c3f144f02aecccaec27aaf0e95e770aee 100644 (file)
@@ -6,6 +6,7 @@
  *
  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
  *          Antoine Cellerier <dionoea@videolan.org>
+ *          Jean-Baptiste Kempf <jb@videolan.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 #include <QCheckBox>
 #include <QVector>
 #include <QDialog>
+#include <QLabel>
+#include <QFile>
+#include <QPushButton>
+#include <QGroupBox>
 
-#include "ui/input_stats.h"
 #include "qt4.hpp"
 #include <assert.h>
 
+class QGridLayout;
+
 class ConfigControl : public QObject
 {
-    Q_OBJECT;
+    Q_OBJECT
 public:
     ConfigControl( vlc_object_t *_p_this, module_config_t *_p_conf,
                    QWidget *p ) : p_this( _p_this ), p_item( _p_conf )
@@ -82,6 +88,7 @@ signals:
  *******************************************************/
 class VIntConfigControl : public ConfigControl
 {
+Q_OBJECT
 public:
     VIntConfigControl( vlc_object_t *a, module_config_t *b, QWidget *c ) :
             ConfigControl(a,b,c) {};
@@ -94,11 +101,14 @@ public:
 
 class IntegerConfigControl : public VIntConfigControl
 {
+Q_OBJECT
 public:
     IntegerConfigControl( vlc_object_t *, module_config_t *, QWidget *,
                           QGridLayout *, int& );
     IntegerConfigControl( vlc_object_t *, module_config_t *,
                           QLabel*, QSpinBox* );
+    IntegerConfigControl( vlc_object_t *, module_config_t *,
+                          QLabel*, QSlider* );
     virtual ~IntegerConfigControl() {};
     virtual int getValue();
     virtual void show() { spin->show(); label->show(); }
@@ -106,7 +116,6 @@ public:
 
 protected:
     QSpinBox *spin;
-
 private:
     QLabel *label;
     void finish();
@@ -123,6 +132,20 @@ private:
     void finish();
 };
 
+class IntegerRangeSliderConfigControl : public VIntConfigControl
+{
+public:
+    IntegerRangeSliderConfigControl( vlc_object_t *, module_config_t *,
+                                QLabel *, QSlider * );
+    virtual ~IntegerRangeSliderConfigControl() {};
+    virtual int getValue();
+protected:
+         QSlider *slider;
+private:
+         QLabel *label;
+         void finish();
+};
+
 class IntegerListConfigControl : public VIntConfigControl
 {
 public:
@@ -161,6 +184,7 @@ private:
  *******************************************************/
 class VFloatConfigControl : public ConfigControl
 {
+    Q_OBJECT
 public:
     VFloatConfigControl( vlc_object_t *a, module_config_t *b, QWidget *c ) :
                 ConfigControl(a,b,c) {};
@@ -173,6 +197,7 @@ public:
 
 class FloatConfigControl : public VFloatConfigControl
 {
+    Q_OBJECT
 public:
     FloatConfigControl( vlc_object_t *, module_config_t *, QWidget *,
                         QGridLayout *, int& );
@@ -193,6 +218,7 @@ private:
 
 class FloatRangeConfigControl : public FloatConfigControl
 {
+    Q_OBJECT
 public:
     FloatRangeConfigControl( vlc_object_t *, module_config_t *, QWidget *,
                              QGridLayout *, int& );
@@ -207,6 +233,7 @@ private:
  *******************************************************/
 class VStringConfigControl : public ConfigControl
 {
+    Q_OBJECT
 public:
     VStringConfigControl( vlc_object_t *a, module_config_t *b, QWidget *c ) :
                 ConfigControl(a,b,c) {};
@@ -219,6 +246,7 @@ public:
 
 class StringConfigControl : public VStringConfigControl
 {
+    Q_OBJECT
 public:
     StringConfigControl( vlc_object_t *, module_config_t *, QWidget *,
                          QGridLayout *, int&,  bool pwd );
@@ -234,6 +262,53 @@ private:
     QLabel *label;
 };
 
+class FileConfigControl : public VStringConfigControl
+{
+    Q_OBJECT;
+public:
+    FileConfigControl( vlc_object_t *, module_config_t *, QWidget *,
+                       QGridLayout *, int&, bool pwd );
+    FileConfigControl( vlc_object_t *, module_config_t *, QLabel *,
+                       QLineEdit *, QPushButton *, bool pwd );
+    virtual ~FileConfigControl() {};
+    virtual QString getValue() { return text->text(); };
+    virtual void show() { text->show(); label->show(); browse->show(); }
+    virtual void hide() { text->hide(); label->hide(); browse->hide(); }
+public slots:
+    virtual void updateField();
+protected:
+    void finish();
+    QLineEdit *text;
+    QLabel *label;
+    QPushButton *browse;
+};
+
+class DirectoryConfigControl : public FileConfigControl
+{
+    Q_OBJECT;
+public:
+    DirectoryConfigControl( vlc_object_t *, module_config_t *, QWidget *,
+                            QGridLayout *, int&, bool pwd );
+    DirectoryConfigControl( vlc_object_t *, module_config_t *, QLabel *,
+                            QLineEdit *, QPushButton *, bool pwd );
+    virtual ~DirectoryConfigControl() {};
+public slots:
+    virtual void updateField();
+};
+
+class FontConfigControl : public FileConfigControl
+{
+    Q_OBJECT;
+public:
+    FontConfigControl( vlc_object_t *, module_config_t *, QWidget *,
+                       QGridLayout *, int&, bool pwd );
+    FontConfigControl( vlc_object_t *, module_config_t *, QLabel *,
+                       QLineEdit *, QPushButton *, bool pwd );
+    virtual ~FontConfigControl() {};
+public slots:
+    virtual void updateField();
+};
+
 class ModuleConfigControl : public VStringConfigControl
 {
 public:
@@ -268,7 +343,7 @@ public slots:
 private:
     void finish( bool );
     QVector<QCheckBox*> modules;
-    QLabel *label;
+    QGroupBox *groupBox;
     QLineEdit *text;
 };
 
@@ -319,7 +394,9 @@ public:
     int keyValue;
     bool conflicts;
 private:
+    void checkForConflicts( int i_vlckey );
     void keyPressEvent( QKeyEvent *);
+    void wheelEvent( QWheelEvent *);
     QLabel *selected;
     QLabel *warning;
     const char * keyToChange;