1 | /* smplayer, GUI front-end for mplayer.
|
---|
2 | Copyright (C) 2006-2016 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 PrefNetwork;
|
---|
45 | class PrefAssociations;
|
---|
46 |
|
---|
47 | class Preferences;
|
---|
48 |
|
---|
49 |
|
---|
50 | class PreferencesDialog : public QDialog, public Ui::PreferencesDialog
|
---|
51 | {
|
---|
52 | Q_OBJECT
|
---|
53 |
|
---|
54 | public:
|
---|
55 | enum Section { General=0, Drives=1, Performance=2,
|
---|
56 | Subtitles=3, Gui=4, Mouse=5, Advanced=6, Associations=7 };
|
---|
57 |
|
---|
58 | PreferencesDialog( QWidget * parent = 0, Qt::WindowFlags f = 0 );
|
---|
59 | ~PreferencesDialog();
|
---|
60 |
|
---|
61 | PrefGeneral * mod_general() { return page_general; };
|
---|
62 | PrefInterface * mod_interface() { return page_interface; };
|
---|
63 | PrefInput * mod_input() { return page_input; };
|
---|
64 | PrefAdvanced * mod_advanced() { return page_advanced; };
|
---|
65 | PrefPlaylist * mod_playlist() { return page_playlist; };
|
---|
66 | PrefUpdates * mod_updates() { return page_updates; };
|
---|
67 | PrefNetwork * mod_network() { return page_network; };
|
---|
68 |
|
---|
69 | void addSection(PrefWidget *w);
|
---|
70 |
|
---|
71 | // Pass data to the standard dialogs
|
---|
72 | void setData(Preferences * pref);
|
---|
73 |
|
---|
74 | // Apply changes
|
---|
75 | void getData(Preferences * pref);
|
---|
76 |
|
---|
77 | // Return true if the mplayer process should be restarted.
|
---|
78 | bool requiresRestart();
|
---|
79 |
|
---|
80 | public slots:
|
---|
81 | void showSection(Section s);
|
---|
82 |
|
---|
83 | virtual void accept(); // Reimplemented to send a signal
|
---|
84 | virtual void reject();
|
---|
85 |
|
---|
86 | signals:
|
---|
87 | void applied();
|
---|
88 |
|
---|
89 | protected:
|
---|
90 | virtual void retranslateStrings();
|
---|
91 | virtual void changeEvent ( QEvent * event ) ;
|
---|
92 |
|
---|
93 | protected slots:
|
---|
94 | void apply();
|
---|
95 | void showHelp();
|
---|
96 |
|
---|
97 | protected:
|
---|
98 | PrefGeneral * page_general;
|
---|
99 | PrefDrives * page_drives;
|
---|
100 | PrefPerformance * page_performance;
|
---|
101 | PrefSubtitles * page_subtitles;
|
---|
102 | PrefInterface * page_interface;
|
---|
103 | PrefInput * page_input;
|
---|
104 | PrefPlaylist * page_playlist;
|
---|
105 | PrefTV * page_tv;
|
---|
106 | PrefUpdates * page_updates;
|
---|
107 | PrefNetwork * page_network;
|
---|
108 | PrefAdvanced * page_advanced;
|
---|
109 |
|
---|
110 | #if USE_ASSOCIATIONS
|
---|
111 | PrefAssociations* page_associations;
|
---|
112 | #endif
|
---|
113 |
|
---|
114 | QTextBrowser * help_window;
|
---|
115 |
|
---|
116 | private:
|
---|
117 | QPushButton * okButton;
|
---|
118 | QPushButton * cancelButton;
|
---|
119 | QPushButton * applyButton;
|
---|
120 | QPushButton * helpButton;
|
---|
121 | };
|
---|
122 |
|
---|
123 | #endif
|
---|