1 /*****************************************************************************
2  * preferences.hpp : Preferences
3  *****************************************************************************
4  * Copyright (C) 2006-2007 the VideoLAN team
5  * $Id: 43a904478d4347538fbc876d68f4565f9f9a959c $
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 QVLC_PREFS_DIALOG_H_
25 #define QVLC_PREFS_DIALOG_H_ 1
26 
27 #include "util/qvlcframe.hpp"
28 #include "components/simple_preferences.hpp"
29 
30 class PrefsTree;
31 class SPrefsCatList;
32 class SPrefsPanel;
33 class QTreeWidgetItem;
34 class QGroupBox;
35 class QRadioButton;
36 class QWidget;
37 class QCheckBox;
38 class SearchLineEdit;
39 class QStackedWidget;
40 class QSplitter;
41 
42 class PrefsDialog : public QVLCDialog
43 {
44     Q_OBJECT
45 public:
46     PrefsDialog( QWidget *, intf_thread_t * );
47     virtual ~PrefsDialog();
48 #if 0
49     /*Called from extended settings, is not used anymore, but could be useful one day*/
50     void showModulePrefs( char* );
51 #endif
52 
53 private:
54     enum { SIMPLE, ADVANCED };
55     QStackedWidget *stack;
56 
57     QWidget *simple_split_widget;
58     QSplitter *advanced_split_widget;
59 
60     QStackedWidget *advanced_panels_stack;
61     QStackedWidget *simple_panels_stack;
62     SPrefsPanel *simple_panels[SPrefsMax];
63 
64     QWidget *simple_tree_panel;
65     QWidget *advanced_tree_panel;
66 
67     SPrefsCatList *simple_tree;
68     PrefsTree *advanced_tree;
69     size_t count;
70     module_t **p_list;
71     SearchLineEdit *tree_filter;
72     QCheckBox *current_filter;
73 
74     QGroupBox *types;
75     QRadioButton *simple,*all;
76 
77 private slots:
78     void setAdvanced();
79     void setSimple();
80 
81     void changeAdvPanel( QTreeWidgetItem * );
82     void changeSimplePanel( int );
83     void advancedTreeFilterChanged( const QString & );
84     void onlyLoadedToggled();
85 
86     void save();
87     void cancel();
88     void reset();
close()89     void close() { save(); };
90 };
91 
92 #endif
93