PCManFM-Qt
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 PCMANFM_PREFERENCESDIALOG_H
22#define PCMANFM_PREFERENCESDIALOG_H
23
24#include <QDialog>
25#include "ui_preferences.h"
26#include <QString>
27
28namespace PCManFM {
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(const QString& activePage = QString(), QWidget* parent = nullptr);
38 virtual ~PreferencesDialog();
39
40 virtual void accept();
41
42 void selectPage(const QString& name);
43
44protected Q_SLOTS:
45 void lockMargins(bool lock);
46 void terminalChanged(int index);
47 void terminalContextMenu(const QPoint& p);
48
49private:
50 void initIconThemes(Settings& settings);
51 void initArchivers(Settings& settings);
52 void initDisplayPage(Settings& settings);
53 void initUiPage(Settings& settings);
54 void initBehaviorPage(Settings& settings);
55 void initThumbnailPage(Settings& settings);
56 void initVolumePage(Settings& settings);
57 void initAdvancedPage(Settings& settings);
58 void initTerminals(Settings& settings);
59
60 void applyTerminal(Settings& settings);
61
62 void applyUiPage(Settings& settings);
63 void applyDisplayPage(Settings& settings);
64 void applyBehaviorPage(Settings& settings);
65 void applyThumbnailPage(Settings& settings);
66 void applyVolumePage(Settings& settings);
67 void applyAdvancedPage(Settings& settings);
68
69 void initFromSettings();
70 void applySettings();
71
72 void restartWarning(bool warn);
73
74private:
75 Ui::PreferencesDialog ui;
76 int warningCounter_;
77};
78
79}
80
81#endif // PCMANFM_PREFERENCESDIALOG_H
Definition settings.h:154