]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/components/preferences_widgets.hpp
Qt4 - Pref: start to track functionnalities missing. Directory still segfaults..
[vlc] / modules / gui / qt4 / components / preferences_widgets.hpp
index eb2a75ca3d257eef018086860fa1d77887621f6d..41b6177a199fe418dbe6fa6fa80ba6e819e01ec0 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
@@ -35,6 +36,8 @@
 #include <QVector>
 #include <QDialog>
 #include <QLabel>
+#include <QFile>
+#include <QPushButton>
 
 #include "qt4.hpp"
 #include <assert.h>
@@ -43,7 +46,7 @@ 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 )
@@ -84,6 +87,7 @@ signals:
  *******************************************************/
 class VIntConfigControl : public ConfigControl
 {
+Q_OBJECT
 public:
     VIntConfigControl( vlc_object_t *a, module_config_t *b, QWidget *c ) :
             ConfigControl(a,b,c) {};
@@ -96,6 +100,7 @@ public:
 
 class IntegerConfigControl : public VIntConfigControl
 {
+Q_OBJECT
 public:
     IntegerConfigControl( vlc_object_t *, module_config_t *, QWidget *,
                           QGridLayout *, int& );
@@ -178,6 +183,7 @@ private:
  *******************************************************/
 class VFloatConfigControl : public ConfigControl
 {
+    Q_OBJECT
 public:
     VFloatConfigControl( vlc_object_t *a, module_config_t *b, QWidget *c ) :
                 ConfigControl(a,b,c) {};
@@ -190,6 +196,7 @@ public:
 
 class FloatConfigControl : public VFloatConfigControl
 {
+    Q_OBJECT
 public:
     FloatConfigControl( vlc_object_t *, module_config_t *, QWidget *,
                         QGridLayout *, int& );
@@ -210,6 +217,7 @@ private:
 
 class FloatRangeConfigControl : public FloatConfigControl
 {
+    Q_OBJECT
 public:
     FloatRangeConfigControl( vlc_object_t *, module_config_t *, QWidget *,
                              QGridLayout *, int& );
@@ -224,6 +232,7 @@ private:
  *******************************************************/
 class VStringConfigControl : public ConfigControl
 {
+    Q_OBJECT
 public:
     VStringConfigControl( vlc_object_t *a, module_config_t *b, QWidget *c ) :
                 ConfigControl(a,b,c) {};
@@ -236,6 +245,7 @@ public:
 
 class StringConfigControl : public VStringConfigControl
 {
+    Q_OBJECT
 public:
     StringConfigControl( vlc_object_t *, module_config_t *, QWidget *,
                          QGridLayout *, int&,  bool pwd );
@@ -251,6 +261,48 @@ 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();
+private:
+    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() {};
+    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();
+private:
+    QLineEdit *text;
+    QLabel *label;
+    QPushButton *browse;
+};
+
 class ModuleConfigControl : public VStringConfigControl
 {
 public: