X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fqt4%2Fcomponents%2Fpreferences_widgets.hpp;h=bb67adf80a98783dc0433831f300f011c3106217;hb=347dd6ad8fad01b437a9739f53ac42a74ddeae0f;hp=76e5b5b5f3760b333de478b13edc24b29c604447;hpb=42980ccc071d8a2b6655e3ec857b36af90c67ee3;p=vlc diff --git a/modules/gui/qt4/components/preferences_widgets.hpp b/modules/gui/qt4/components/preferences_widgets.hpp index 76e5b5b5f3..bb67adf80a 100644 --- a/modules/gui/qt4/components/preferences_widgets.hpp +++ b/modules/gui/qt4/components/preferences_widgets.hpp @@ -1,7 +1,7 @@ /***************************************************************************** * preferences_widgets.hpp : Widgets for preferences panels **************************************************************************** - * Copyright (C) 2006 the VideoLAN team + * Copyright (C) 2006-2007 the VideoLAN team * $Id$ * * Authors: Clément Stenac @@ -23,26 +23,35 @@ * 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 + +#include "qt4.hpp" +#include + #include -#include + +#include +#include #include +#include #include +#include #include -#include -#include +#include #include #include -#include -#include -#include -#include "qt4.hpp" -#include +class QFile; +class QTreeWidget; +class QTreeWidgetItem; +class QGroupBox; class QGridLayout; +class QDialogButtonBox; +class QVBoxLayout; class ConfigControl : public QObject { @@ -78,8 +87,11 @@ protected: QString _name; QWidget *widget; bool _advanced; +#if 0 +/* You shouldn't use that now..*/ signals: void Updated(); +#endif }; /******************************************************* @@ -110,8 +122,8 @@ public: QLabel*, QSlider* ); virtual ~IntegerConfigControl() {}; virtual int getValue(); - virtual void show() { spin->show(); label->show(); } - virtual void hide() { spin->hide(); label->hide(); } + virtual void show() { spin->show(); if( label ) label->show(); } + virtual void hide() { spin->hide(); if( label ) label->hide(); } protected: QSpinBox *spin; @@ -154,8 +166,8 @@ public: QComboBox*, bool ); virtual ~IntegerListConfigControl() {}; virtual int getValue(); - virtual void hide() { combo->hide(); label->hide(); } - virtual void show() { combo->show(); label->show(); } + virtual void hide() { combo->hide(); if( label ) label->hide(); } + virtual void show() { combo->show(); if( label ) label->show(); } private: void finish( bool ); QLabel *label; @@ -204,8 +216,8 @@ public: QLabel*, QDoubleSpinBox* ); virtual ~FloatConfigControl() {}; virtual float getValue(); - virtual void show() { spin->show(); label->show(); } - virtual void hide() { spin->hide(); label->hide(); } + virtual void show() { spin->show(); if( label ) label->show(); } + virtual void hide() { spin->hide(); if( label ) label->hide(); } protected: QDoubleSpinBox *spin; @@ -253,8 +265,8 @@ public: QLineEdit*, bool pwd ); virtual ~StringConfigControl() {}; virtual QString getValue() { return text->text(); }; - virtual void show() { text->show(); label->show(); } - virtual void hide() { text->hide(); label->hide(); } + virtual void show() { text->show(); if( label ) label->show(); } + virtual void hide() { text->hide(); if( label ) label->hide(); } private: void finish(); QLineEdit *text; @@ -271,8 +283,8 @@ public: 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(); } + virtual void show() { text->show(); if( label ) label->show(); browse->show(); } + virtual void hide() { text->hide(); if( label ) label->hide(); browse->hide(); } public slots: virtual void updateField(); protected: @@ -317,14 +329,19 @@ public: QComboBox*, bool ); virtual ~ModuleConfigControl() {}; virtual QString getValue(); - virtual void hide() { combo->hide(); label->hide(); } - virtual void show() { combo->show(); label->show(); } + virtual void hide() { combo->hide(); if( label ) label->hide(); } + virtual void show() { combo->show(); if( label ) label->show(); } private: void finish( bool ); QLabel *label; QComboBox *combo; }; +struct checkBoxListItem { + QCheckBox *checkBox; + char *psz_module; +}; + class ModuleListConfigControl : public VStringConfigControl { Q_OBJECT; @@ -338,16 +355,17 @@ public: virtual void hide(); virtual void show(); public slots: - void wakeUp_TheUserJustClickedOnSomething( int value ); + void onUpdate( int value ); private: void finish( bool ); - QVector modules; - QLabel *label; + QVector modules; + QGroupBox *groupBox; QLineEdit *text; }; class StringListConfigControl : public VStringConfigControl { + Q_OBJECT; public: StringListConfigControl( vlc_object_t *, module_config_t *, QWidget *, bool, QGridLayout*, int& ); @@ -355,13 +373,20 @@ public: QComboBox*, bool ); virtual ~StringListConfigControl() {}; virtual QString getValue(); - virtual void hide() { combo->hide(); label->hide(); } - virtual void show() { combo->show(); label->show(); } + virtual void hide() { combo->hide(); if( label ) label->hide(); } + virtual void show() { combo->show(); if( label ) label->show(); } private: void finish( bool ); QLabel *label; QComboBox *combo; +private slots: + void actionRequested( int ); + }; + +void setfillVLCConfigCombo(const char *configname, intf_thread_t *p_intf, + QComboBox *combo, QWidget *parent = 0 ); + #if 0 struct ModuleCheckBox { QCheckBox *checkbox; @@ -389,15 +414,27 @@ private slot: class KeyInputDialog : public QDialog { public: - KeyInputDialog( QList &, const char * ); + KeyInputDialog( QList &, const char *, QWidget * ); int keyValue; bool conflicts; private: + void checkForConflicts( int i_vlckey ); void keyPressEvent( QKeyEvent *); + void wheelEvent( QWheelEvent *); QLabel *selected; - QLabel *warning; - const char * keyToChange; + QVBoxLayout *vLayout; + const char *keyToChange; QList values; + QDialogButtonBox *buttonBox; +}; + +class KeyShortcutEdit: public QLineEdit +{ + Q_OBJECT +private: + virtual void mousePressEvent( QMouseEvent *event ); +signals: + void pressed(); }; class KeySelectorControl : public ConfigControl @@ -408,16 +445,19 @@ public: QGridLayout*, int& ); virtual int getType() { return 4; } virtual ~KeySelectorControl() {}; - virtual void hide() { table->hide(); label->hide(); } - virtual void show() { table->show(); label->show(); } + virtual void hide() { table->hide(); if( label ) label->hide(); } + virtual void show() { table->show(); if( label ) label->show(); } void doApply(); private: void finish(); QLabel *label; QTreeWidget *table; + KeyShortcutEdit *shortcutValue; QList values; private slots: - void selectKey( QTreeWidgetItem *); + void setTheKey(); + void selectKey( QTreeWidgetItem * = NULL ); + void select1Key( QTreeWidgetItem *); }; #endif