X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fqt4%2Fcomponents%2Fpreferences_widgets.hpp;h=90cb3fccb7625a20acce0b9ac33cdb43b23393ea;hb=61733f0e1da307d34b66e8051f0fc1af59c41a33;hp=b63ff9343fa5a7ac9fc0a8e0d23e90887f92b807;hpb=c92f962f3935418e8f6dcdcc919d25415f4711c5;p=vlc diff --git a/modules/gui/qt4/components/preferences_widgets.hpp b/modules/gui/qt4/components/preferences_widgets.hpp index b63ff9343f..90cb3fccb7 100644 --- a/modules/gui/qt4/components/preferences_widgets.hpp +++ b/modules/gui/qt4/components/preferences_widgets.hpp @@ -23,10 +23,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ -#ifndef _INFOPANELS_H_ -#define _INFOPANELS_H_ +#ifndef _PREFERENCESWIDGETS_H_ +#define _PREFERENCESWIDGETS_H_ -#include +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif #include "qt4.hpp" #include @@ -44,12 +46,12 @@ #include #include - -class QFile; class QTreeWidget; class QTreeWidgetItem; class QGroupBox; class QGridLayout; +class QDialogButtonBox; +class QVBoxLayout; class ConfigControl : public QObject { @@ -85,8 +87,11 @@ protected: QString _name; QWidget *widget; bool _advanced; +#if 0 +/* You shouldn't use that now..*/ signals: void Updated(); +#endif }; /******************************************************* @@ -102,7 +107,7 @@ public: ConfigControl(a,b) {}; virtual ~VIntConfigControl() {}; virtual int getValue() = 0; - virtual int getType() { return 1; } + virtual int getType() { return CONFIG_ITEM_INTEGER; } }; class IntegerConfigControl : public VIntConfigControl @@ -154,6 +159,7 @@ private: class IntegerListConfigControl : public VIntConfigControl { +Q_OBJECT public: IntegerListConfigControl( vlc_object_t *, module_config_t *, QWidget *, bool, QGridLayout*, int& ); @@ -164,9 +170,12 @@ public: virtual void hide() { combo->hide(); if( label ) label->hide(); } virtual void show() { combo->show(); if( label ) label->show(); } private: - void finish( bool ); + void finish(module_config_t *, bool ); QLabel *label; QComboBox *combo; +private slots: + void actionRequested( int ); + }; class BoolConfigControl : public VIntConfigControl @@ -180,6 +189,7 @@ public: virtual int getValue(); virtual void show() { checkbox->show(); } virtual void hide() { checkbox->hide(); } + virtual int getType() { return CONFIG_ITEM_BOOL; } private: QCheckBox *checkbox; void finish(); @@ -198,7 +208,7 @@ public: ConfigControl(a,b) {}; virtual ~VFloatConfigControl() {}; virtual float getValue() = 0; - virtual int getType() { return 2; } + virtual int getType() { return CONFIG_ITEM_FLOAT; } }; class FloatConfigControl : public VFloatConfigControl @@ -247,7 +257,7 @@ public: ConfigControl(a,b) {}; virtual ~VStringConfigControl() {}; virtual QString getValue() = 0; - virtual int getType() { return 3; } + virtual int getType() { return CONFIG_ITEM_STRING; } }; class StringConfigControl : public VStringConfigControl @@ -273,9 +283,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(); } @@ -294,14 +304,15 @@ 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 { Q_OBJECT; @@ -314,6 +325,7 @@ public: public slots: virtual void updateField(); }; +#endif class ModuleConfigControl : public VStringConfigControl { @@ -340,6 +352,7 @@ struct checkBoxListItem { class ModuleListConfigControl : public VStringConfigControl { Q_OBJECT; + friend class ConfigControl; public: ModuleListConfigControl( vlc_object_t *, module_config_t *, QWidget *, bool, QGridLayout*, int& ); @@ -350,7 +363,7 @@ public: virtual void hide(); virtual void show(); public slots: - void onUpdate( int value ); + void onUpdate(); private: void finish( bool ); QVector modules; @@ -360,6 +373,7 @@ private: class StringListConfigControl : public VStringConfigControl { + Q_OBJECT; public: StringListConfigControl( vlc_object_t *, module_config_t *, QWidget *, bool, QGridLayout*, int& ); @@ -367,13 +381,20 @@ public: QComboBox*, bool ); virtual ~StringListConfigControl() {}; virtual QString getValue(); - virtual void hide() { if( combo ) combo->hide(); if( label ) label->hide(); } - virtual void show() { if( combo ) combo->show(); if( label ) label->show(); } + virtual void hide() { combo->hide(); if( label ) label->hide(); } + virtual void show() { combo->show(); if( label ) label->show(); } + QComboBox *combo; private: - void finish( bool ); + void finish(module_config_t *, bool ); QLabel *label; - QComboBox *combo; +private slots: + void actionRequested( int ); + }; + +void setfillVLCConfigCombo(const char *configname, intf_thread_t *p_intf, + QComboBox *combo ); + #if 0 struct ModuleCheckBox { QCheckBox *checkbox; @@ -398,20 +419,19 @@ private slot: /********************************************************************** * Key selector widget **********************************************************************/ -class KeyInputDialog : public QDialog +class KeyShortcutEdit: public QLineEdit { + Q_OBJECT public: - KeyInputDialog( QList &, const char * ); - int keyValue; - bool conflicts; + void setValue( int _value ){ value = _value; } + int getValue() const { return value; } +public slots: + virtual void clear(void) { value = 0; QLineEdit::clear(); } private: - void checkForConflicts( int i_vlckey ); - void keyPressEvent( QKeyEvent *); - void wheelEvent( QWheelEvent *); - QLabel *selected; - QLabel *warning; - const char * keyToChange; - QList values; + int value; + virtual void mousePressEvent( QMouseEvent *event ); +signals: + void pressed(); }; class KeySelectorControl : public ConfigControl @@ -420,7 +440,7 @@ class KeySelectorControl : public ConfigControl public: KeySelectorControl( vlc_object_t *, module_config_t *, QWidget *, QGridLayout*, int& ); - virtual int getType() { return 4; } + virtual int getType() { return CONFIG_ITEM_KEY; } virtual ~KeySelectorControl() {}; virtual void hide() { table->hide(); if( label ) label->hide(); } virtual void show() { table->show(); if( label ) label->show(); } @@ -429,9 +449,27 @@ private: void finish(); QLabel *label; QTreeWidget *table; + KeyShortcutEdit *shortcutValue; QList values; private slots: - void selectKey( QTreeWidgetItem *); + void setTheKey(); + void selectKey( QTreeWidgetItem * = NULL ); + void select1Key(); }; +class KeyInputDialog : public QDialog +{ +public: + KeyInputDialog( QTreeWidget *, QString, QWidget * ); + int keyValue; + bool conflicts; +private: + QTreeWidget *table; + void checkForConflicts( int i_vlckey ); + void keyPressEvent( QKeyEvent *); + void wheelEvent( QWheelEvent *); + QLabel *selected; + QVBoxLayout *vLayout; + QDialogButtonBox *buttonBox; +}; #endif