# include "config.h"
#endif
-#include <vlc_common.h>
-
#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
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();
};
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();
};
-#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
{
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;
+ QComboBox *combo;
private:
void finish(module_config_t *, bool );
QLabel *label;
};
void setfillVLCConfigCombo(const char *configname, intf_thread_t *p_intf,
- QComboBox *combo, QWidget *parent = 0 );
+ QComboBox *combo );
#if 0
struct ModuleCheckBox {
**********************************************************************/
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;
QTreeWidget *table;
KeyShortcutEdit *shortcutValue;
QList<module_config_t *> 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:
void checkForConflicts( int i_vlckey );
void keyPressEvent( QKeyEvent *);
void wheelEvent( QWheelEvent *);
- QLabel *selected;
+ QLabel *selected, *warning;
QVBoxLayout *vLayout;
QDialogButtonBox *buttonBox;
+ bool b_global;
};
#endif