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