[112] | 1 | /* smplayer, GUI front-end for mplayer.
|
---|
[188] | 2 | Copyright (C) 2006-2017 Ricardo Villalba <rvm@users.sourceforge.net>
|
---|
[112] | 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 |
|
---|
[176] | 19 | #ifndef PREFERENCESDIALOG_H
|
---|
| 20 | #define PREFERENCESDIALOG_H
|
---|
[112] | 21 |
|
---|
| 22 | #include "ui_preferencesdialog.h"
|
---|
| 23 |
|
---|
| 24 | /*
|
---|
| 25 | #ifdef Q_OS_WIN
|
---|
| 26 | #define USE_ASSOCIATIONS 1
|
---|
| 27 | #endif
|
---|
| 28 | */
|
---|
| 29 |
|
---|
[181] | 30 | class InfoWindow;
|
---|
[112] | 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;
|
---|
[156] | 43 | class PrefUpdates;
|
---|
[176] | 44 | class PrefNetwork;
|
---|
[112] | 45 | class PrefAssociations;
|
---|
| 46 |
|
---|
| 47 | class Preferences;
|
---|
| 48 |
|
---|
| 49 |
|
---|
| 50 | class PreferencesDialog : public QDialog, public Ui::PreferencesDialog
|
---|
| 51 | {
|
---|
| 52 | Q_OBJECT
|
---|
[181] | 53 | Q_PROPERTY(bool iconMode READ isIconMode WRITE setIconMode)
|
---|
[112] | 54 |
|
---|
| 55 | public:
|
---|
| 56 | enum Section { General=0, Drives=1, Performance=2,
|
---|
| 57 | Subtitles=3, Gui=4, Mouse=5, Advanced=6, Associations=7 };
|
---|
| 58 |
|
---|
| 59 | PreferencesDialog( QWidget * parent = 0, Qt::WindowFlags f = 0 );
|
---|
| 60 | ~PreferencesDialog();
|
---|
| 61 |
|
---|
| 62 | PrefGeneral * mod_general() { return page_general; };
|
---|
| 63 | PrefInterface * mod_interface() { return page_interface; };
|
---|
| 64 | PrefInput * mod_input() { return page_input; };
|
---|
| 65 | PrefAdvanced * mod_advanced() { return page_advanced; };
|
---|
[119] | 66 | PrefPlaylist * mod_playlist() { return page_playlist; };
|
---|
[176] | 67 | PrefUpdates * mod_updates() { return page_updates; };
|
---|
| 68 | PrefNetwork * mod_network() { return page_network; };
|
---|
[112] | 69 |
|
---|
| 70 | void addSection(PrefWidget *w);
|
---|
| 71 |
|
---|
| 72 | // Pass data to the standard dialogs
|
---|
| 73 | void setData(Preferences * pref);
|
---|
| 74 |
|
---|
| 75 | // Apply changes
|
---|
| 76 | void getData(Preferences * pref);
|
---|
| 77 |
|
---|
| 78 | // Return true if the mplayer process should be restarted.
|
---|
| 79 | bool requiresRestart();
|
---|
| 80 |
|
---|
[181] | 81 | void setIconMode(bool);
|
---|
| 82 | bool isIconMode() { return icon_mode; };
|
---|
| 83 |
|
---|
[112] | 84 | public slots:
|
---|
| 85 | void showSection(Section s);
|
---|
| 86 |
|
---|
| 87 | virtual void accept(); // Reimplemented to send a signal
|
---|
| 88 | virtual void reject();
|
---|
| 89 |
|
---|
| 90 | signals:
|
---|
| 91 | void applied();
|
---|
| 92 |
|
---|
| 93 | protected:
|
---|
| 94 | virtual void retranslateStrings();
|
---|
| 95 | virtual void changeEvent ( QEvent * event ) ;
|
---|
| 96 |
|
---|
| 97 | protected slots:
|
---|
| 98 | void apply();
|
---|
| 99 | void showHelp();
|
---|
| 100 |
|
---|
| 101 | protected:
|
---|
| 102 | PrefGeneral * page_general;
|
---|
| 103 | PrefDrives * page_drives;
|
---|
| 104 | PrefPerformance * page_performance;
|
---|
| 105 | PrefSubtitles * page_subtitles;
|
---|
| 106 | PrefInterface * page_interface;
|
---|
| 107 | PrefInput * page_input;
|
---|
| 108 | PrefPlaylist * page_playlist;
|
---|
[181] | 109 | #ifdef TV_SUPPORT
|
---|
[112] | 110 | PrefTV * page_tv;
|
---|
[181] | 111 | #endif
|
---|
[156] | 112 | PrefUpdates * page_updates;
|
---|
[176] | 113 | PrefNetwork * page_network;
|
---|
[112] | 114 | PrefAdvanced * page_advanced;
|
---|
| 115 |
|
---|
| 116 | #if USE_ASSOCIATIONS
|
---|
[156] | 117 | PrefAssociations* page_associations;
|
---|
[112] | 118 | #endif
|
---|
| 119 |
|
---|
[181] | 120 | InfoWindow * help_window;
|
---|
[112] | 121 |
|
---|
| 122 | private:
|
---|
[176] | 123 | QPushButton * okButton;
|
---|
| 124 | QPushButton * cancelButton;
|
---|
[112] | 125 | QPushButton * applyButton;
|
---|
[176] | 126 | QPushButton * helpButton;
|
---|
[181] | 127 |
|
---|
| 128 | bool icon_mode;
|
---|
[112] | 129 | };
|
---|
| 130 |
|
---|
| 131 | #endif
|
---|