1 | /* smplayer, GUI front-end for mplayer.
|
---|
2 | Copyright (C) 2006-2013 Ricardo Villalba <rvm@users.sourceforge.net>
|
---|
3 |
|
---|
4 | This program is free software; you can redistribute it and/or modify
|
---|
5 | it under the terms of the GNU General Public License as published by
|
---|
6 | the Free Software Foundation; either version 2 of the License, or
|
---|
7 | (at your option) any later version.
|
---|
8 |
|
---|
9 | This program is distributed in the hope that it will be useful,
|
---|
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
12 | GNU General Public License for more details.
|
---|
13 |
|
---|
14 | You should have received a copy of the GNU General Public License
|
---|
15 | along with this program; if not, write to the Free Software
|
---|
16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
17 | */
|
---|
18 |
|
---|
19 | #ifndef _PREFERENCESDIALOG_H_
|
---|
20 | #define _PREFERENCESDIALOG_H_
|
---|
21 |
|
---|
22 | #include "ui_preferencesdialog.h"
|
---|
23 |
|
---|
24 | /*
|
---|
25 | #ifdef Q_OS_WIN
|
---|
26 | #define USE_ASSOCIATIONS 1
|
---|
27 | #endif
|
---|
28 | */
|
---|
29 |
|
---|
30 | class QTextBrowser;
|
---|
31 | class QPushButton;
|
---|
32 |
|
---|
33 | class PrefWidget;
|
---|
34 | class PrefGeneral;
|
---|
35 | class PrefDrives;
|
---|
36 | class PrefPerformance;
|
---|
37 | class PrefSubtitles;
|
---|
38 | class PrefInterface;
|
---|
39 | class PrefInput;
|
---|
40 | class PrefAdvanced;
|
---|
41 | class PrefPlaylist;
|
---|
42 | class PrefTV;
|
---|
43 | class PrefUpdates;
|
---|
44 | class PrefAssociations;
|
---|
45 |
|
---|
46 | class Preferences;
|
---|
47 |
|
---|
48 |
|
---|
49 | class PreferencesDialog : public QDialog, public Ui::PreferencesDialog
|
---|
50 | {
|
---|
51 | Q_OBJECT
|
---|
52 |
|
---|
53 | public:
|
---|
54 | enum Section { General=0, Drives=1, Performance=2,
|
---|
55 | Subtitles=3, Gui=4, Mouse=5, Advanced=6, Associations=7 };
|
---|
56 |
|
---|
57 | PreferencesDialog( QWidget * parent = 0, Qt::WindowFlags f = 0 );
|
---|
58 | ~PreferencesDialog();
|
---|
59 |
|
---|
60 | PrefGeneral * mod_general() { return page_general; };
|
---|
61 | PrefInterface * mod_interface() { return page_interface; };
|
---|
62 | PrefInput * mod_input() { return page_input; };
|
---|
63 | PrefAdvanced * mod_advanced() { return page_advanced; };
|
---|
64 | PrefPlaylist * mod_playlist() { return page_playlist; };
|
---|
65 | PrefUpdates * mod_updtes() { return page_updates; };
|
---|
66 |
|
---|
67 | void addSection(PrefWidget *w);
|
---|
68 |
|
---|
69 | // Pass data to the standard dialogs
|
---|
70 | void setData(Preferences * pref);
|
---|
71 |
|
---|
72 | // Apply changes
|
---|
73 | void getData(Preferences * pref);
|
---|
74 |
|
---|
75 | // Return true if the mplayer process should be restarted.
|
---|
76 | bool requiresRestart();
|
---|
77 |
|
---|
78 | public slots:
|
---|
79 | void showSection(Section s);
|
---|
80 |
|
---|
81 | virtual void accept(); // Reimplemented to send a signal
|
---|
82 | virtual void reject();
|
---|
83 |
|
---|
84 | signals:
|
---|
85 | void applied();
|
---|
86 |
|
---|
87 | protected:
|
---|
88 | virtual void retranslateStrings();
|
---|
89 | virtual void changeEvent ( QEvent * event ) ;
|
---|
90 |
|
---|
91 | protected slots:
|
---|
92 | void apply();
|
---|
93 | void showHelp();
|
---|
94 |
|
---|
95 | protected:
|
---|
96 | PrefGeneral * page_general;
|
---|
97 | PrefDrives * page_drives;
|
---|
98 | PrefPerformance * page_performance;
|
---|
99 | PrefSubtitles * page_subtitles;
|
---|
100 | PrefInterface * page_interface;
|
---|
101 | PrefInput * page_input;
|
---|
102 | PrefPlaylist * page_playlist;
|
---|
103 | PrefTV * page_tv;
|
---|
104 | PrefUpdates * page_updates;
|
---|
105 | PrefAdvanced * page_advanced;
|
---|
106 |
|
---|
107 | #if USE_ASSOCIATIONS
|
---|
108 | PrefAssociations* page_associations;
|
---|
109 | #endif
|
---|
110 |
|
---|
111 | QTextBrowser * help_window;
|
---|
112 |
|
---|
113 | private:
|
---|
114 | QPushButton * okButton;
|
---|
115 | QPushButton * cancelButton;
|
---|
116 | QPushButton * applyButton;
|
---|
117 | QPushButton * helpButton;
|
---|
118 | };
|
---|
119 |
|
---|
120 | #endif
|
---|