* 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 <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
#include "qt4.hpp"
#include <assert.h>
class QGroupBox;
class QGridLayout;
class QDialogButtonBox;
+class QVBoxLayout;
class ConfigControl : public QObject
{
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
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();
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
virtual void updateField();
};
+#if 0
class FontConfigControl : public FileConfigControl
{
Q_OBJECT;
public slots:
virtual void updateField();
};
+#endif
class ModuleConfigControl : public VStringConfigControl
{
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 );
/**********************************************************************
* Key selector widget
**********************************************************************/
-class KeyInputDialog : public QDialog
-{
-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;
- QLabel *warning;
- const char * keyToChange;
- QList<module_config_t*> values;
- QDialogButtonBox *buttonBox;
-};
-
class KeyShortcutEdit: public QLineEdit
{
Q_OBJECT
+public:
+ void setValue( int _value ){ value = _value; }
+ int getValue() const { return value; }
+public slots:
+ virtual void clear(void) { value = 0; QLineEdit::clear(); }
private:
+ int value;
virtual void mousePressEvent( QMouseEvent *event );
signals:
void pressed();
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(); }
private slots:
void setTheKey();
void selectKey( QTreeWidgetItem * = NULL );
- void select1Key( QTreeWidgetItem *);
+ 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