]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/dialogs/preferences.hpp
Destroy preferences dialog on close and on reset.
[vlc] / modules / gui / qt4 / dialogs / preferences.hpp
index dac2e94fd72ec99e515244d0c745de32bb6890cb..634df78b46f0d44f5cc82be8bd2b9cad49a6dd4b 100644 (file)
@@ -39,18 +39,16 @@ class QGroupBox;
 class QRadioButton;
 class QWidget;
 class QCheckBox;
-class QListWidget;
-class QListWidgetItem;
 class QLabel;
 
-class PrefsDialog : public QVLCFrame
+class PrefsDialog : public QVLCDialog
 {
     Q_OBJECT;
 public:
-    static PrefsDialog * getInstance( intf_thread_t *_p_intf )
+    static PrefsDialog * getInstance( intf_thread_t *p_intf )
     {
         if( !instance )
-            instance = new PrefsDialog( _p_intf );
+            instance = new PrefsDialog( (QWidget *)p_intf->p_sys->p_mi, p_intf );
         return instance;
     }
     virtual ~PrefsDialog() {};
@@ -58,8 +56,12 @@ public:
     /*Called from extended settings, is not used anymore, but could be useful one day*/
     void showModulePrefs( char* );
 #endif
+
 private:
-    PrefsDialog( intf_thread_t * );
+    PrefsDialog( QWidget *, intf_thread_t * );
+    QGridLayout *main_layout;
+
+    void destroyPanels();
 
     QWidget *main_panel;
     QHBoxLayout *main_panel_l;
@@ -70,18 +72,17 @@ private:
 
     QWidget *tree_panel;
     QHBoxLayout *tree_panel_l;
+
     SPrefsCatList *simple_tree;
     PrefsTree *advanced_tree;
 
     QGroupBox *types;
     QRadioButton *small,*all;
 
-    QGridLayout *main_layout;
-
     static PrefsDialog *instance;
 
 private slots:
-    void SetAdvanced();
+    void setAdvanced();
     void setSmall();
 
     void changeAdvPanel( QTreeWidgetItem * );
@@ -90,7 +91,6 @@ private slots:
     void save();
     void cancel();
     void reset();
-    void close(){ save(); }; /* Needed for any generic CloseEvent*/
 };
 
 #endif