Changeset View
Changeset View
Standalone View
Standalone View
kcms/style/gtkpage.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright 2020 Mikhail Zolotukhin <zomial@protonmail.com> | ||||
3 | * | ||||
4 | * This program is free software; you can redistribute it and/or | ||||
5 | * modify it under the terms of the GNU General Public License as | ||||
6 | * published by the Free Software Foundation; either version 2 of | ||||
7 | * the License or (at your option) version 3 or any later version | ||||
8 | * accepted by the membership of KDE e.V. (or its successor approved | ||||
9 | * by the membership of KDE e.V.), which shall act as a proxy | ||||
10 | * defined in Section 14 of version 3 of the license. | ||||
11 | * | ||||
12 | * This program is distributed in the hope that it will be useful, | ||||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
15 | * GNU General Public License for more details. | ||||
16 | * | ||||
17 | * You should have received a copy of the GNU General Public License | ||||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
19 | */ | ||||
20 | | ||||
21 | #pragma once | ||||
22 | | ||||
23 | #include <QObject> | ||||
24 | #include <QDBusInterface> | ||||
25 | | ||||
26 | #include "gtkthemesmodel.h" | ||||
27 | | ||||
28 | class GtkPage : public QObject | ||||
29 | { | ||||
30 | Q_OBJECT | ||||
31 | | ||||
32 | Q_PROPERTY(GtkThemesModel *gtk2ThemesModel MEMBER m_gtk2ThemesModel NOTIFY gtk2ThemesModelChanged) | ||||
33 | Q_PROPERTY(GtkThemesModel *gtk3ThemesModel MEMBER m_gtk3ThemesModel NOTIFY gtk3ThemesModelChanged) | ||||
34 | | ||||
35 | public: | ||||
36 | GtkPage(QObject *parent = nullptr); | ||||
37 | ~GtkPage() override; | ||||
38 | | ||||
39 | void load(); | ||||
40 | void save(); | ||||
41 | void defaults(); | ||||
42 | | ||||
43 | public Q_SLOTS: | ||||
44 | QString gtk2ThemeFromConfig(); | ||||
45 | QString gtk3ThemeFromConfig(); | ||||
46 | | ||||
47 | void showGtk2Preview(); | ||||
48 | void showGtk3Preview(); | ||||
49 | | ||||
50 | void installGtkThemeFromFile(const QUrl &fileUrl); | ||||
51 | void installGtk2ThemeFromGHNS(); | ||||
52 | void installGtk3ThemeFromGHNS(); | ||||
53 | | ||||
54 | void onThemeRemoved(); | ||||
55 | | ||||
56 | Q_SIGNALS: | ||||
57 | void gtk2ThemesModelChanged(GtkThemesModel *model); | ||||
58 | void gtk3ThemesModelChanged(GtkThemesModel *model); | ||||
59 | | ||||
60 | void showErrorMessage(const QString &message); | ||||
61 | void selectGtk2ThemeInCombobox(const QString &themeName); | ||||
62 | void selectGtk3ThemeInCombobox(const QString &themeName); | ||||
63 | | ||||
64 | void gtkThemeSettingsChanged(); | ||||
65 | | ||||
66 | private: | ||||
67 | GtkThemesModel *m_gtk2ThemesModel; | ||||
68 | GtkThemesModel *m_gtk3ThemesModel; | ||||
69 | | ||||
70 | QDBusInterface gtkConfigInterface; | ||||
71 | }; |