Qt4 - Rename dialog/prefs_dialog to dialog/preferences: files in dialog/ are already...
authorJean-Baptiste Kempf <jb@videolan.org>
Sat, 31 Mar 2007 17:57:52 +0000 (17:57 +0000)
committerJean-Baptiste Kempf <jb@videolan.org>
Sat, 31 Mar 2007 17:57:52 +0000 (17:57 +0000)
modules/gui/qt4/Modules.am
modules/gui/qt4/components/extended_panels.cpp
modules/gui/qt4/dialogs/preferences.cpp [new file with mode: 0644]
modules/gui/qt4/dialogs/preferences.hpp [new file with mode: 0644]
modules/gui/qt4/dialogs/prefs_dialog.cpp [deleted file]
modules/gui/qt4/dialogs/prefs_dialog.hpp [deleted file]
modules/gui/qt4/dialogs_provider.cpp

index 95473c4..92f4e92 100644 (file)
@@ -39,7 +39,7 @@ TOMOC = main_interface \
        input_manager \
        playlist_model \
        dialogs/playlist \
-       dialogs/prefs_dialog \
+       dialogs/preferences \
        dialogs/messages \
        dialogs/errors \
        dialogs/mediainfo \
@@ -73,7 +73,7 @@ nodist_SOURCES_qt4 = \
                dialogs/extended.moc.cpp \
                dialogs/messages.moc.cpp \
                dialogs/errors.moc.cpp \
-               dialogs/prefs_dialog.moc.cpp \
+               dialogs/preferences.moc.cpp \
                dialogs/interaction.moc.cpp \
                dialogs/sout.moc.cpp \
                dialogs/help.moc.cpp \
@@ -119,7 +119,7 @@ SOURCES_qt4 =       qt4.cpp \
                input_manager.cpp \
                playlist_model.cpp \
                dialogs/playlist.cpp \
-               dialogs/prefs_dialog.cpp \
+               dialogs/preferences.cpp \
                dialogs/mediainfo.cpp \
                dialogs/extended.cpp \
                dialogs/messages.cpp \
@@ -155,7 +155,7 @@ EXTRA_DIST += \
        dialogs/extended.hpp \
        dialogs/messages.hpp \
        dialogs/errors.hpp \
-       dialogs/prefs_dialog.hpp \
+       dialogs/preferences.hpp \
        dialogs/interaction.hpp \
        dialogs/sout.hpp \
        dialogs/help.hpp \
index 4ebd976..2476dd9 100644 (file)
@@ -29,7 +29,7 @@
 #include <QSignalMapper>
 
 #include "components/extended_panels.hpp"
-#include "dialogs/prefs_dialog.hpp"
+#include "dialogs/preferences.hpp"
 #include "dialogs_provider.hpp"
 #include "qt4.hpp"
 
diff --git a/modules/gui/qt4/dialogs/preferences.cpp b/modules/gui/qt4/dialogs/preferences.cpp
new file mode 100644 (file)
index 0000000..d404a68
--- /dev/null
@@ -0,0 +1,271 @@
+/*****************************************************************************
+ * preferences.cpp : Preferences
+ *****************************************************************************
+ * Copyright (C) 2006-2007 the VideoLAN team
+ * $Id$
+ *
+ * Authors: Clément Stenac <zorglub@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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#include "dialogs/preferences.hpp"
+#include "dialogs_provider.hpp"
+#include "util/qvlcframe.hpp"
+
+#include "components/preferences.hpp"
+#include "components/simple_preferences.hpp"
+#include "qt4.hpp"
+
+#include <QHBoxLayout>
+#include <QGroupBox>
+#include <QRadioButton>
+#include <QVBoxLayout>
+#include <QPushButton>
+#include <QCheckBox>
+#include <QScrollArea>
+#include <QMessageBox>
+
+
+PrefsDialog *PrefsDialog::instance = NULL;
+
+PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
+{
+     QGridLayout *main_layout = new QGridLayout( this );
+     setWindowTitle( qtr( "Preferences" ) );
+     resize( 700, 650 );
+     setMaximumHeight( 650 );
+     setMaximumWidth( 700 );
+
+     tree_panel = new QWidget( 0 );
+     tree_panel_l = new QHBoxLayout;
+     tree_panel->setLayout( tree_panel_l );
+     main_panel = new QWidget( 0 );
+     main_panel_l = new QHBoxLayout;
+     main_panel->setLayout( main_panel_l );
+
+     // Choice for types
+     types = new QGroupBox( "Show settings" );
+     types->setAlignment( Qt::AlignHCenter );
+     QHBoxLayout *types_l = new QHBoxLayout(0);
+     types_l->setSpacing( 3 ); types_l->setMargin( 3 );
+     small = new QRadioButton( "Basic", types ); types_l->addWidget( small );
+     all = new QRadioButton( "All", types ); types_l->addWidget( all );
+     types->setLayout( types_l );
+     small->setChecked( true );
+
+     advanced_tree = NULL;
+     simple_tree = NULL;
+     simple_panel = NULL;
+     advanced_panel = NULL;
+
+     main_layout->addWidget( tree_panel, 0, 0, 3, 1 );
+     main_layout->addWidget( types, 3, 0, 1, 1 );
+
+     main_layout->addWidget( main_panel, 0, 1, 4, 1 );
+
+     main_layout->setColumnMinimumWidth( 0, 150 );
+     main_layout->setColumnStretch( 0, 1 );
+     main_layout->setColumnStretch( 1,3 );
+
+     main_layout->setRowStretch( 2, 4);
+
+     setSmall();
+
+     QPushButton *save, *cancel, *reset;
+     QHBoxLayout *buttonsLayout = QVLCFrame::doButtons( this, NULL,
+                                      &save, _("Save"),
+                                      &cancel, _("Cancel"),
+                                      &reset, _( "Reset Preferences" ) );
+     main_layout->addLayout( buttonsLayout, 4, 0, 1 ,3 );
+     setLayout( main_layout );
+
+
+     BUTTONACT( save, save() );
+     BUTTONACT( cancel, cancel() );
+     BUTTONACT( reset, reset() );
+     BUTTONACT( small, setSmall() );
+     BUTTONACT( all, setAll() );
+
+     for( int i = 0; i < SPrefsMax ; i++ ) simple_panels[i] = NULL;
+}
+
+void PrefsDialog::setAll()
+{
+    if( simple_tree )
+    {
+        tree_panel_l->removeWidget( simple_tree );
+        simple_tree->hide();
+    }
+
+    if( !advanced_tree )
+    {
+         advanced_tree = new PrefsTree( p_intf, tree_panel );
+         CONNECT( advanced_tree,
+                  currentItemChanged( QTreeWidgetItem *, QTreeWidgetItem *),
+                  this, changePanel( QTreeWidgetItem * ) );
+    }
+    tree_panel_l->addWidget( advanced_tree );
+    advanced_tree->show();
+
+    if( simple_panel )
+    {
+        main_panel_l->removeWidget( simple_panel );
+        simple_panel->hide();
+    }
+    if( !advanced_panel )
+         advanced_panel = new PrefsPanel( main_panel );
+    main_panel_l->addWidget( advanced_panel );
+    advanced_panel->show();
+}
+
+void PrefsDialog::setSmall()
+{
+    if( advanced_tree )
+    {
+        tree_panel_l->removeWidget( advanced_tree );
+        advanced_tree->hide();
+    }
+    if( !simple_tree )
+    {
+         simple_tree = new SPrefsCatList( p_intf, tree_panel );
+         CONNECT( simple_tree,
+                  currentItemChanged( QListWidgetItem *, QListWidgetItem *),
+                  this,  changeSimplePanel( QListWidgetItem * ) );
+    }
+    tree_panel_l->addWidget( simple_tree );
+    simple_tree->show();
+
+    if( advanced_panel )
+    {
+        main_panel_l->removeWidget( advanced_panel );
+        advanced_panel->hide();
+    }
+    if( !simple_panel )
+        simple_panel = new SPrefsPanel( p_intf, main_panel, SPrefsDefaultCat );
+    main_panel_l->addWidget( simple_panel );
+    simple_panel->show();
+}
+
+void PrefsDialog::changeSimplePanel( QListWidgetItem *item )
+{
+    int number = item->data( Qt::UserRole ).toInt();
+    if( simple_panel )
+    {
+        main_panel_l->removeWidget( simple_panel );
+        simple_panel->hide();
+    }
+    simple_panel = simple_panels[number];
+    if( !simple_panel )
+    {
+        simple_panel = new SPrefsPanel( p_intf, main_panel, number );
+        simple_panels[number] = simple_panel;
+    }
+    main_panel_l->addWidget( simple_panel );
+    simple_panel->show();
+//    panel_label->setText(qtr("Test")); //FIXME
+}
+
+void PrefsDialog::changePanel( QTreeWidgetItem *item )
+{
+    PrefsItemData *data = item->data( 0, Qt::UserRole ).value<PrefsItemData*>();
+
+    if( advanced_panel )
+    {
+        main_panel_l->removeWidget( advanced_panel );
+        advanced_panel->hide();
+    }
+    if( !data->panel )
+        data->panel = new PrefsPanel( p_intf, main_panel , data );
+
+    advanced_panel = data->panel;
+    main_panel_l->addWidget( advanced_panel );
+    advanced_panel->show();
+}
+
+void PrefsDialog::showModulePrefs( char *psz_module )
+{
+    setAll();
+    all->setChecked( true );
+    for( int i_cat_index = 0 ; i_cat_index < advanced_tree->topLevelItemCount();
+         i_cat_index++ )
+    {
+        QTreeWidgetItem *cat_item = advanced_tree->topLevelItem( i_cat_index );
+        PrefsItemData *data = cat_item->data( 0, Qt::UserRole ).
+                                                   value<PrefsItemData *>();
+        for( int i_sc_index = 0; i_sc_index < cat_item->childCount();
+                                  i_sc_index++ )
+        {
+            QTreeWidgetItem *subcat_item = cat_item->child( i_sc_index );
+            PrefsItemData *sc_data = subcat_item->data(0, Qt::UserRole).
+                                                    value<PrefsItemData *>();
+            for( int i_module = 0; i_module < subcat_item->childCount();
+                                   i_module++ )
+            {
+                QTreeWidgetItem *module_item = subcat_item->child( i_module );
+                PrefsItemData *mod_data = module_item->data( 0, Qt::UserRole ).
+                                                    value<PrefsItemData *>();
+                if( !strcmp( mod_data->psz_name, psz_module ) ) {
+                    advanced_tree->setCurrentItem( module_item );
+                }
+            }
+        }
+    }
+    show();
+}
+
+void PrefsDialog::save()
+{
+    if( small->isChecked() && simple_tree )
+    {
+        for( int i = 0 ; i< SPrefsMax; i++ )
+            if( simple_panels[i] ) simple_panels[i]->apply();
+    }
+    else if( all->isChecked() && advanced_tree )
+        advanced_tree->applyAll();
+    config_SaveConfigFile( p_intf, NULL );
+    hide();
+}
+
+void PrefsDialog::cancel()
+{
+    if( small->isChecked() && simple_tree )
+    {
+        for( int i = 0 ; i< SPrefsMax; i++ )
+            if( simple_panels[i] ) simple_panels[i]->clean();
+    }
+    else if( all->isChecked() && advanced_tree )
+    {
+        advanced_tree->cleanAll();
+        advanced_panel = NULL;
+    }
+    hide();
+}
+
+void PrefsDialog::reset()
+{
+    int ret = QMessageBox::question(this, qtr("Reset Preferences"),
+                 qtr("This will reset your VLC media player preferences.\n"
+                         "Are you sure you want to continue?"),
+                  QMessageBox::Ok | QMessageBox::Cancel,
+                                                         QMessageBox::Ok);
+    if ( ret == QMessageBox::Ok )
+    {
+        config_ResetAll( p_intf );
+        // TODO reset changes ?
+        config_SaveConfigFile( p_intf, NULL );
+    }
+}
diff --git a/modules/gui/qt4/dialogs/preferences.hpp b/modules/gui/qt4/dialogs/preferences.hpp
new file mode 100644 (file)
index 0000000..55e409b
--- /dev/null
@@ -0,0 +1,91 @@
+/*****************************************************************************
+ * preferences.hpp : Preferences
+ *****************************************************************************
+ * Copyright (C) 2006-2007 the VideoLAN team
+ * $Id$
+ *
+ * Authors: Clément Stenac <zorglub@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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#ifndef _PREFS_DIALOG_H_
+#define _PREFS_DIALOG_H_
+
+#include "util/qvlcframe.hpp"
+#include "components/simple_preferences.hpp"
+
+class PrefsTree;
+class SPrefsCatList;
+class PrefsPanel;
+class SPrefsPanel;
+class QTreeWidgetItem;
+class QTreeWidget;
+class QHBoxLayout;
+class QVBoxLayout;
+class QGroupBox;
+class QRadioButton;
+class QWidget;
+class QCheckBox;
+class QListWidget;
+class QListWidgetItem;
+class QLabel;
+
+class PrefsDialog : public QVLCFrame
+{
+    Q_OBJECT;
+public:
+    static PrefsDialog * getInstance( intf_thread_t *_p_intf )
+    {
+        if( !instance )
+            instance = new PrefsDialog( _p_intf );
+        return instance;
+    }
+    virtual ~PrefsDialog() {};
+
+    void showModulePrefs( char* );
+private:
+    PrefsDialog( intf_thread_t * );
+
+    QWidget *main_panel;
+    QHBoxLayout *main_panel_l;
+    PrefsPanel *advanced_panel;
+    SPrefsPanel *simple_panel;
+    SPrefsPanel *simple_panels[SPrefsMax];
+
+    QWidget *tree_panel;
+    QHBoxLayout *tree_panel_l;
+    SPrefsCatList *simple_tree;
+    PrefsTree *advanced_tree;
+
+    QGroupBox *types;
+    QRadioButton *small,*all;
+
+    QGridLayout *main_layout;
+
+//    QLabel *panel_label;
+
+    static PrefsDialog *instance;
+private slots:
+     void changePanel( QTreeWidgetItem * );
+     void changeSimplePanel( QListWidgetItem * );
+     void setAll();
+     void setSmall();
+     void save();
+     void cancel();
+     void reset();
+};
+
+#endif
diff --git a/modules/gui/qt4/dialogs/prefs_dialog.cpp b/modules/gui/qt4/dialogs/prefs_dialog.cpp
deleted file mode 100644 (file)
index 85ca881..0000000
+++ /dev/null
@@ -1,271 +0,0 @@
-/*****************************************************************************
- * prefs_dialog.cpp : Preferences
- *****************************************************************************
- * Copyright (C) 2006-2007 the VideoLAN team
- * $Id$
- *
- * Authors: Clément Stenac <zorglub@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
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#include "dialogs/prefs_dialog.hpp"
-#include "dialogs_provider.hpp"
-#include "util/qvlcframe.hpp"
-
-#include "components/preferences.hpp"
-#include "components/simple_preferences.hpp"
-#include "qt4.hpp"
-
-#include <QHBoxLayout>
-#include <QGroupBox>
-#include <QRadioButton>
-#include <QVBoxLayout>
-#include <QPushButton>
-#include <QCheckBox>
-#include <QScrollArea>
-#include <QMessageBox>
-
-
-PrefsDialog *PrefsDialog::instance = NULL;
-
-PrefsDialog::PrefsDialog( intf_thread_t *_p_intf ) : QVLCFrame( _p_intf )
-{
-     QGridLayout *main_layout = new QGridLayout( this );
-     setWindowTitle( qtr( "Preferences" ) );
-     resize( 700, 650 );
-     setMaximumHeight( 650 );
-     setMaximumWidth( 700 );
-
-     tree_panel = new QWidget( 0 );
-     tree_panel_l = new QHBoxLayout;
-     tree_panel->setLayout( tree_panel_l );
-     main_panel = new QWidget( 0 );
-     main_panel_l = new QHBoxLayout;
-     main_panel->setLayout( main_panel_l );
-
-     // Choice for types
-     types = new QGroupBox( "Show settings" );
-     types->setAlignment( Qt::AlignHCenter );
-     QHBoxLayout *types_l = new QHBoxLayout(0);
-     types_l->setSpacing( 3 ); types_l->setMargin( 3 );
-     small = new QRadioButton( "Basic", types ); types_l->addWidget( small );
-     all = new QRadioButton( "All", types ); types_l->addWidget( all );
-     types->setLayout( types_l );
-     small->setChecked( true );
-
-     advanced_tree = NULL;
-     simple_tree = NULL;
-     simple_panel = NULL;
-     advanced_panel = NULL;
-
-     main_layout->addWidget( tree_panel, 0, 0, 3, 1 );
-     main_layout->addWidget( types, 3, 0, 1, 1 );
-
-     main_layout->addWidget( main_panel, 0, 1, 4, 1 );
-
-     main_layout->setColumnMinimumWidth( 0, 150 );
-     main_layout->setColumnStretch( 0, 1 );
-     main_layout->setColumnStretch( 1,3 );
-
-     main_layout->setRowStretch( 2, 4);
-
-     setSmall();
-
-     QPushButton *save, *cancel, *reset;
-     QHBoxLayout *buttonsLayout = QVLCFrame::doButtons( this, NULL,
-                                      &save, _("Save"),
-                                      &cancel, _("Cancel"),
-                                      &reset, _( "Reset Preferences" ) );
-     main_layout->addLayout( buttonsLayout, 4, 0, 1 ,3 );
-     setLayout( main_layout );
-
-
-     BUTTONACT( save, save() );
-     BUTTONACT( cancel, cancel() );
-     BUTTONACT( reset, reset() );
-     BUTTONACT( small, setSmall() );
-     BUTTONACT( all, setAll() );
-
-     for( int i = 0; i < SPrefsMax ; i++ ) simple_panels[i] = NULL;
-}
-
-void PrefsDialog::setAll()
-{
-    if( simple_tree )
-    {
-        tree_panel_l->removeWidget( simple_tree );
-        simple_tree->hide();
-    }
-
-    if( !advanced_tree )
-    {
-         advanced_tree = new PrefsTree( p_intf, tree_panel );
-         CONNECT( advanced_tree,
-                  currentItemChanged( QTreeWidgetItem *, QTreeWidgetItem *),
-                  this, changePanel( QTreeWidgetItem * ) );
-    }
-    tree_panel_l->addWidget( advanced_tree );
-    advanced_tree->show();
-
-    if( simple_panel )
-    {
-        main_panel_l->removeWidget( simple_panel );
-        simple_panel->hide();
-    }
-    if( !advanced_panel )
-         advanced_panel = new PrefsPanel( main_panel );
-    main_panel_l->addWidget( advanced_panel );
-    advanced_panel->show();
-}
-
-void PrefsDialog::setSmall()
-{
-    if( advanced_tree )
-    {
-        tree_panel_l->removeWidget( advanced_tree );
-        advanced_tree->hide();
-    }
-    if( !simple_tree )
-    {
-         simple_tree = new SPrefsCatList( p_intf, tree_panel );
-         CONNECT( simple_tree,
-                  currentItemChanged( QListWidgetItem *, QListWidgetItem *),
-                  this,  changeSimplePanel( QListWidgetItem * ) );
-    }
-    tree_panel_l->addWidget( simple_tree );
-    simple_tree->show();
-
-    if( advanced_panel )
-    {
-        main_panel_l->removeWidget( advanced_panel );
-        advanced_panel->hide();
-    }
-    if( !simple_panel )
-        simple_panel = new SPrefsPanel( p_intf, main_panel, SPrefsDefaultCat );
-    main_panel_l->addWidget( simple_panel );
-    simple_panel->show();
-}
-
-void PrefsDialog::changeSimplePanel( QListWidgetItem *item )
-{
-    int number = item->data( Qt::UserRole ).toInt();
-    if( simple_panel )
-    {
-        main_panel_l->removeWidget( simple_panel );
-        simple_panel->hide();
-    }
-    simple_panel = simple_panels[number];
-    if( !simple_panel )
-    {
-        simple_panel = new SPrefsPanel( p_intf, main_panel, number );
-        simple_panels[number] = simple_panel;
-    }
-    main_panel_l->addWidget( simple_panel );
-    simple_panel->show();
-//    panel_label->setText(qtr("Test")); //FIXME
-}
-
-void PrefsDialog::changePanel( QTreeWidgetItem *item )
-{
-    PrefsItemData *data = item->data( 0, Qt::UserRole ).value<PrefsItemData*>();
-
-    if( advanced_panel )
-    {
-        main_panel_l->removeWidget( advanced_panel );
-        advanced_panel->hide();
-    }
-    if( !data->panel )
-        data->panel = new PrefsPanel( p_intf, main_panel , data );
-
-    advanced_panel = data->panel;
-    main_panel_l->addWidget( advanced_panel );
-    advanced_panel->show();
-}
-
-void PrefsDialog::showModulePrefs( char *psz_module )
-{
-    setAll();
-    all->setChecked( true );
-    for( int i_cat_index = 0 ; i_cat_index < advanced_tree->topLevelItemCount();
-         i_cat_index++ )
-    {
-        QTreeWidgetItem *cat_item = advanced_tree->topLevelItem( i_cat_index );
-        PrefsItemData *data = cat_item->data( 0, Qt::UserRole ).
-                                                   value<PrefsItemData *>();
-        for( int i_sc_index = 0; i_sc_index < cat_item->childCount();
-                                  i_sc_index++ )
-        {
-            QTreeWidgetItem *subcat_item = cat_item->child( i_sc_index );
-            PrefsItemData *sc_data = subcat_item->data(0, Qt::UserRole).
-                                                    value<PrefsItemData *>();
-            for( int i_module = 0; i_module < subcat_item->childCount();
-                                   i_module++ )
-            {
-                QTreeWidgetItem *module_item = subcat_item->child( i_module );
-                PrefsItemData *mod_data = module_item->data( 0, Qt::UserRole ).
-                                                    value<PrefsItemData *>();
-                if( !strcmp( mod_data->psz_name, psz_module ) ) {
-                    advanced_tree->setCurrentItem( module_item );
-                }
-            }
-        }
-    }
-    show();
-}
-
-void PrefsDialog::save()
-{
-    if( small->isChecked() && simple_tree )
-    {
-        for( int i = 0 ; i< SPrefsMax; i++ )
-            if( simple_panels[i] ) simple_panels[i]->apply();
-    }
-    else if( all->isChecked() && advanced_tree )
-        advanced_tree->applyAll();
-    config_SaveConfigFile( p_intf, NULL );
-    hide();
-}
-
-void PrefsDialog::cancel()
-{
-    if( small->isChecked() && simple_tree )
-    {
-        for( int i = 0 ; i< SPrefsMax; i++ )
-            if( simple_panels[i] ) simple_panels[i]->clean();
-    }
-    else if( all->isChecked() && advanced_tree )
-    {
-        advanced_tree->cleanAll();
-        advanced_panel = NULL;
-    }
-    hide();
-}
-
-void PrefsDialog::reset()
-{
-    int ret = QMessageBox::question(this, qtr("Reset Preferences"),
-                 qtr("This will reset your VLC media player preferences.\n"
-                         "Are you sure you want to continue?"),
-                  QMessageBox::Ok | QMessageBox::Cancel,
-                                                         QMessageBox::Ok);
-    if ( ret == QMessageBox::Ok )
-    {
-        config_ResetAll( p_intf );
-        // TODO reset changes ?
-        config_SaveConfigFile( p_intf, NULL );
-    }
-}
diff --git a/modules/gui/qt4/dialogs/prefs_dialog.hpp b/modules/gui/qt4/dialogs/prefs_dialog.hpp
deleted file mode 100644 (file)
index 17dc7b9..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*****************************************************************************
- * prefs_dialog.hpp : Preferences
- *****************************************************************************
- * Copyright (C) 2006-2007 the VideoLAN team
- * $Id$
- *
- * Authors: Clément Stenac <zorglub@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
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#ifndef _PREFS_DIALOG_H_
-#define _PREFS_DIALOG_H_
-
-#include "util/qvlcframe.hpp"
-#include "components/simple_preferences.hpp"
-
-class PrefsTree;
-class SPrefsCatList;
-class PrefsPanel;
-class SPrefsPanel;
-class QTreeWidgetItem;
-class QTreeWidget;
-class QHBoxLayout;
-class QVBoxLayout;
-class QGroupBox;
-class QRadioButton;
-class QWidget;
-class QCheckBox;
-class QListWidget;
-class QListWidgetItem;
-class QLabel;
-
-class PrefsDialog : public QVLCFrame
-{
-    Q_OBJECT;
-public:
-    static PrefsDialog * getInstance( intf_thread_t *_p_intf )
-    {
-        if( !instance )
-            instance = new PrefsDialog( _p_intf );
-        return instance;
-    }
-    virtual ~PrefsDialog() {};
-
-    void showModulePrefs( char* );
-private:
-    PrefsDialog( intf_thread_t * );
-
-    QWidget *main_panel;
-    QHBoxLayout *main_panel_l;
-    PrefsPanel *advanced_panel;
-    SPrefsPanel *simple_panel;
-    SPrefsPanel *simple_panels[SPrefsMax];
-
-    QWidget *tree_panel;
-    QHBoxLayout *tree_panel_l;
-    SPrefsCatList *simple_tree;
-    PrefsTree *advanced_tree;
-
-    QGroupBox *types;
-    QRadioButton *small,*all;
-
-    QGridLayout *main_layout;
-
-//    QLabel *panel_label;
-
-    static PrefsDialog *instance;
-private slots:
-     void changePanel( QTreeWidgetItem * );
-     void changeSimplePanel( QListWidgetItem * );
-     void setAll();
-     void setSmall();
-     void save();
-     void cancel();
-     void reset();
-};
-
-#endif
index 363c4ab..624eb0f 100644 (file)
@@ -34,7 +34,7 @@
 
 /* The dialogs */
 #include "dialogs/playlist.hpp"
-#include "dialogs/prefs_dialog.hpp"
+#include "dialogs/preferences.hpp"
 #include "dialogs/mediainfo.hpp"
 #include "dialogs/messages.hpp"
 #include "dialogs/extended.hpp"