]> git.sesse.net Git - vlc/blob - modules/gui/qt4/dialogs/preferences.hpp
5125bfa66f883982d5933a17cb70554a1c0f8b88
[vlc] / modules / gui / qt4 / dialogs / preferences.hpp
1 /*****************************************************************************
2  * preferences.hpp : Preferences
3  *****************************************************************************
4  * Copyright (C) 2006-2007 the VideoLAN team
5  * $Id$
6  *
7  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #ifndef _PREFS_DIALOG_H_
25 #define _PREFS_DIALOG_H_
26
27 #include "util/qvlcframe.hpp"
28 #include "components/simple_preferences.hpp"
29
30 class PrefsTree;
31 class SPrefsCatList;
32 class AdvPrefsPanel;
33 class SPrefsPanel;
34 class QTreeWidgetItem;
35 class QTreeWidget;
36 class QHBoxLayout;
37 class QVBoxLayout;
38 class QGroupBox;
39 class QRadioButton;
40 class QWidget;
41 class QCheckBox;
42 class QLabel;
43
44 class PrefsDialog : public QVLCDialog
45 {
46     Q_OBJECT;
47 public:
48     static PrefsDialog * getInstance( intf_thread_t *p_intf )
49     {
50         if( !instance )
51             instance = new PrefsDialog( (QWidget *)p_intf->p_sys->p_mi, p_intf );
52         return instance;
53     }
54     virtual ~PrefsDialog() {};
55 #if 0
56     /*Called from extended settings, is not used anymore, but could be useful one day*/
57     void showModulePrefs( char* );
58 #endif
59
60 private:
61     PrefsDialog( QWidget *, intf_thread_t * );
62     QGridLayout *main_layout;
63
64     void destroyPanels();
65
66     QWidget *main_panel;
67     QHBoxLayout *main_panel_l;
68
69     AdvPrefsPanel *advanced_panel;
70     SPrefsPanel *current_simple_panel;
71     SPrefsPanel *simple_panels[SPrefsMax];
72
73     QWidget *tree_panel;
74     QHBoxLayout *tree_panel_l;
75
76     SPrefsCatList *simple_tree;
77     PrefsTree *advanced_tree;
78
79     QGroupBox *types;
80     QRadioButton *small,*all;
81
82     static PrefsDialog *instance;
83
84 private slots:
85     void setAdvanced();
86     void setSmall();
87
88     void changeAdvPanel( QTreeWidgetItem * );
89     void changeSimplePanel( int );
90
91     void save();
92     void cancel();
93     void reset();
94     void close(){ save(); }; /* Needed for any generic CloseEvent*/
95 };
96
97 #endif