NDE-FileMAN
Loading...
Searching...
No Matches
preferencesdialog.h
1/*
2
3 Copyright (C) 2013 Hong Jen Yee (PCMan) <pcman.tw@gmail.com>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18*/
19
20
21#ifndef NDEFILEMAN_PREFERENCESDIALOG_H
22#define NDEFILEMAN_PREFERENCESDIALOG_H
23
24#include <QDialog>
25#include "ui_preferences.h"
26#include <QString>
27
28namespace NDEFileMAN {
29
30class Settings;
31
32class PreferencesDialog : public QDialog {
33 Q_OBJECT
34
35public:
36 // activePage is the name of page to select (general, display, advanced...)
37 explicit PreferencesDialog(QString activePage = QString(), QWidget* parent = 0);
38 virtual ~PreferencesDialog();
39
40 virtual void accept();
41
42 void selectPage(QString name);
43
44protected Q_SLOTS:
45 void lockMargins(bool lock);
46
47private:
48 void initIconThemes(Settings& settings);
49 void initArchivers(Settings& settings);
50 void initDisplayPage(Settings& settings);
51 void initUiPage(Settings& settings);
52 void initBehaviorPage(Settings& settings);
53 void initThumbnailPage(Settings& settings);
54 void initVolumePage(Settings& settings);
55 void initAdvancedPage(Settings& settings);
56 void initTerminals(Settings& settings);
57
58 void applyUiPage(Settings& settings);
59 void applyDisplayPage(Settings& settings);
60 void applyBehaviorPage(Settings& settings);
61 void applyThumbnailPage(Settings& settings);
62 void applyVolumePage(Settings& settings);
63 void applyAdvancedPage(Settings& settings);
64
65 void initFromSettings();
66 void applySettings();
67
68 void restartWarning(bool warn);
69
70private:
71 Ui::PreferencesDialog ui;
72 int warningCounter_;
73};
74
75}
76
77#endif // NDEFILEMAN_PREFERENCESDIALOG_H
Definition preferencesdialog.h:32
Definition settings.h:170