/*****************************************************************************
* 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 <zorglub@videolan.org>
* Antoine Cellerier <dionoea@videolan.org>
+ * Jean-Baptiste Kempf <jb@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#ifndef _INFOPANELS_H_
#define _INFOPANELS_H_
+
#include <vlc/vlc.h>
+
+#include "qt4.hpp"
+#include <assert.h>
+
#include <QWidget>
-#include <QTreeWidget>
+
+#include <QCheckBox>
+#include <QComboBox>
#include <QLineEdit>
+#include <QTreeWidget>
#include <QSpinBox>
+#include <QLabel>
#include <QDoubleSpinBox>
-#include <QComboBox>
-#include <QCheckBox>
+#include <QPushButton>
#include <QVector>
#include <QDialog>
-#include <QLabel>
-#include <QFile>
-#include "qt4.hpp"
-#include <assert.h>
+class QFile;
+class QTreeWidget;
+class QTreeWidgetItem;
+class QGroupBox;
class QGridLayout;
class ConfigControl : public QObject
{
- Q_OBJECT;
+ Q_OBJECT
public:
ConfigControl( vlc_object_t *_p_this, module_config_t *_p_conf,
QWidget *p ) : p_this( _p_this ), p_item( _p_conf )
*******************************************************/
class VIntConfigControl : public ConfigControl
{
+Q_OBJECT
public:
VIntConfigControl( vlc_object_t *a, module_config_t *b, QWidget *c ) :
ConfigControl(a,b,c) {};
class IntegerConfigControl : public VIntConfigControl
{
+Q_OBJECT
public:
IntegerConfigControl( vlc_object_t *, module_config_t *, QWidget *,
QGridLayout *, int& );
*******************************************************/
class VFloatConfigControl : public ConfigControl
{
+ Q_OBJECT
public:
VFloatConfigControl( vlc_object_t *a, module_config_t *b, QWidget *c ) :
ConfigControl(a,b,c) {};
class FloatConfigControl : public VFloatConfigControl
{
+ Q_OBJECT
public:
FloatConfigControl( vlc_object_t *, module_config_t *, QWidget *,
QGridLayout *, int& );
class FloatRangeConfigControl : public FloatConfigControl
{
+ Q_OBJECT
public:
FloatRangeConfigControl( vlc_object_t *, module_config_t *, QWidget *,
QGridLayout *, int& );
*******************************************************/
class VStringConfigControl : public ConfigControl
{
+ Q_OBJECT
public:
VStringConfigControl( vlc_object_t *a, module_config_t *b, QWidget *c ) :
ConfigControl(a,b,c) {};
class StringConfigControl : public VStringConfigControl
{
+ Q_OBJECT
public:
StringConfigControl( vlc_object_t *, module_config_t *, QWidget *,
QGridLayout *, int&, bool pwd );
Q_OBJECT;
public:
FileConfigControl( vlc_object_t *, module_config_t *, QWidget *,
- QGridLayout *, int&, bool pwd );
+ QGridLayout *, int&, bool pwd );
FileConfigControl( vlc_object_t *, module_config_t *, QLabel *,
- QLineEdit*, bool pwd );
+ QLineEdit *, QPushButton *, bool pwd );
virtual ~FileConfigControl() {};
virtual QString getValue() { return text->text(); };
- virtual void show() { text->show(); label->show(); }
- virtual void hide() { text->hide(); label->hide(); }
-public slots:
- void updateField();
-private:
+ virtual void show() { text->show(); label->show(); browse->show(); }
+ virtual void hide() { text->hide(); label->hide(); browse->hide(); }
+public slots:
+ virtual void updateField();
+protected:
void finish();
QLineEdit *text;
QLabel *label;
QPushButton *browse;
};
+class DirectoryConfigControl : public FileConfigControl
+{
+ Q_OBJECT;
+public:
+ DirectoryConfigControl( vlc_object_t *, module_config_t *, QWidget *,
+ QGridLayout *, int&, bool pwd );
+ DirectoryConfigControl( vlc_object_t *, module_config_t *, QLabel *,
+ QLineEdit *, QPushButton *, bool pwd );
+ virtual ~DirectoryConfigControl() {};
+public slots:
+ virtual void updateField();
+};
+
+class FontConfigControl : public FileConfigControl
+{
+ Q_OBJECT;
+public:
+ FontConfigControl( vlc_object_t *, module_config_t *, QWidget *,
+ QGridLayout *, int&, bool pwd );
+ FontConfigControl( vlc_object_t *, module_config_t *, QLabel *,
+ QLineEdit *, QPushButton *, bool pwd );
+ virtual ~FontConfigControl() {};
+public slots:
+ virtual void updateField();
+};
class ModuleConfigControl : public VStringConfigControl
{
QComboBox *combo;
};
+struct checkBoxListItem {
+ QCheckBox *checkBox;
+ char *psz_module;
+};
+
class ModuleListConfigControl : public VStringConfigControl
{
Q_OBJECT;
virtual void hide();
virtual void show();
public slots:
- void wakeUp_TheUserJustClickedOnSomething( int value );
+ void onUpdate( int value );
private:
void finish( bool );
- QVector<QCheckBox*> modules;
- QLabel *label;
+ QVector<checkBoxListItem*> modules;
+ QGroupBox *groupBox;
QLineEdit *text;
};
int keyValue;
bool conflicts;
private:
+ void checkForConflicts( int i_vlckey );
void keyPressEvent( QKeyEvent *);
+ void wheelEvent( QWheelEvent *);
QLabel *selected;
QLabel *warning;
const char * keyToChange;