X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fqt4%2Fcomponents%2Fpreferences_widgets.hpp;h=420f835dd7f77badcf62ccc938a032a54a1d32e9;hb=012e93a73382df07238a122f9de884b5270c252e;hp=90cb3fccb7625a20acce0b9ac33cdb43b23393ea;hpb=23f5a2f25e35bb5a45fe61fce23e82d8b2ff445c;p=vlc diff --git a/modules/gui/qt4/components/preferences_widgets.hpp b/modules/gui/qt4/components/preferences_widgets.hpp index 90cb3fccb7..420f835dd7 100644 --- a/modules/gui/qt4/components/preferences_widgets.hpp +++ b/modules/gui/qt4/components/preferences_widgets.hpp @@ -45,6 +45,7 @@ #include #include #include +#include class QTreeWidget; class QTreeWidgetItem; @@ -53,6 +54,27 @@ class QGridLayout; class QDialogButtonBox; class QVBoxLayout; +/******************************************************* + * Simple widgets + *******************************************************/ + +class InterfacePreviewWidget : public QLabel +{ + Q_OBJECT +public: + InterfacePreviewWidget( QWidget * ); +public slots: + /* 0: sample_classic, aka VLC 0.8.6 + 1: sample_complete, aka MPC + 2: sample_minimal, aka WMP12 minimal + 3: sample_skins */ + void setPreview( int ); +}; + +/******************************************************* + * Variable controls + *******************************************************/ + class ConfigControl : public QObject { Q_OBJECT @@ -184,14 +206,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(); }; @@ -312,20 +334,20 @@ 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 { @@ -421,19 +443,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; @@ -451,16 +478,18 @@ private: QTreeWidget *table; KeyShortcutEdit *shortcutValue; QList 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: @@ -468,8 +497,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