#ifndef _PREFERENCESWIDGETS_H_
#define _PREFERENCESWIDGETS_H_
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
#include "qt4.hpp"
#include <assert.h>
#include <QPushButton>
#include <QVector>
#include <QDialog>
+#include <QFontComboBox>
-
-class QFile;
class QTreeWidget;
class QTreeWidgetItem;
class QGroupBox;
class QDialogButtonBox;
class QVBoxLayout;
+/*******************************************************
+ * Simple widgets
+ *******************************************************/
+
+class InterfacePreviewWidget : public QLabel
+{
+ Q_OBJECT
+public:
+ InterfacePreviewWidget( QWidget * );
+ enum enum_style {
+ COMPLETE, // aka MPC
+ MINIMAL, // aka WMP12 minimal
+ SKINS };
+public slots:
+ void setPreview( enum_style );
+ void setNormalPreview( bool b_minimal );
+};
+
+/*******************************************************
+ * Variable controls
+ *******************************************************/
+
class ConfigControl : public QObject
{
Q_OBJECT
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
class IntegerListConfigControl : public VIntConfigControl
{
+Q_OBJECT
public:
IntegerListConfigControl( vlc_object_t *, module_config_t *, QWidget *,
bool, QGridLayout*, int& );
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
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();
};
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
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
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(); }
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();
};
-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;
};
class ModuleConfigControl : public VStringConfigControl
class ModuleListConfigControl : public VStringConfigControl
{
Q_OBJECT;
+ friend class ConfigControl;
public:
ModuleListConfigControl( vlc_object_t *, module_config_t *, QWidget *,
bool, QGridLayout*, int& );
virtual void hide();
virtual void show();
public slots:
- void onUpdate( int value );
+ void onUpdate();
private:
void finish( bool );
QVector<checkBoxListItem*> modules;
virtual QString getValue();
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, QWidget *parent = 0 );
+ QComboBox *combo );
#if 0
struct ModuleCheckBox {
/**********************************************************************
* Key selector widget
**********************************************************************/
-class KeyInputDialog : public QDialog
+class KeyShortcutEdit: public QLineEdit
{
+ Q_OBJECT;
public:
- KeyInputDialog( QList<module_config_t *> &, const char *, QWidget * );
- int keyValue;
- bool conflicts;
-private:
- void checkForConflicts( int i_vlckey );
- void keyPressEvent( QKeyEvent *);
- void wheelEvent( QWheelEvent *);
- QLabel *selected;
- QVBoxLayout *vLayout;
- const char *keyToChange;
- QList<module_config_t*> values;
- QDialogButtonBox *buttonBox;
-};
+ void setValue( int _value ){ value = _value; }
+ int getValue() const { return value; }
-class KeyShortcutEdit: public QLineEdit
-{
- Q_OBJECT
+ void setGlobal( bool _value ) { b_global = _value; }
+ bool getGlobal() const { return b_global; }
+public slots:
+ 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;
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(); }
QTreeWidget *table;
KeyShortcutEdit *shortcutValue;
QList<module_config_t *> values;
+ SearchLineEdit *actionSearch;
private slots:
void setTheKey();
- void selectKey( QTreeWidgetItem * = NULL );
- void select1Key( QTreeWidgetItem *);
+ void selectKey( QTreeWidgetItem * = NULL, int column = 1 );
+ void select1Key();
+ void filter( const QString & );
};
+class KeyInputDialog : public QDialog
+{
+public:
+ KeyInputDialog( QTreeWidget *, const QString&, QWidget *, bool b_global = false);
+ int keyValue;
+ bool conflicts;
+private:
+ QTreeWidget *table;
+ void checkForConflicts( int i_vlckey );
+ void keyPressEvent( QKeyEvent *);
+ void wheelEvent( QWheelEvent *);
+ QLabel *selected, *warning;
+ QVBoxLayout *vLayout;
+ QDialogButtonBox *buttonBox;
+ bool b_global;
+};
#endif