File indexing completed on 2024-05-19 05:38:25
0001 /* 0002 SPDX-FileCopyrightText: 2020 Mikhail Zolotukhin <zomial@protonmail.com> 0003 0004 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0005 */ 0006 0007 #pragma once 0008 0009 #include <QObject> 0010 #include <QQmlListReference> 0011 0012 #include "gtkthemesmodel.h" 0013 0014 #include "kdegtkconfig_interface.h" 0015 0016 class GtkPage : public QObject 0017 { 0018 Q_OBJECT 0019 0020 Q_PROPERTY(GtkThemesModel *gtkThemesModel MEMBER m_gtkThemesModel NOTIFY gtkThemesModelChanged) 0021 0022 public: 0023 GtkPage(QObject *parent = nullptr); 0024 ~GtkPage() override; 0025 0026 Q_INVOKABLE void load(); 0027 void save(); 0028 void defaults(); 0029 bool isDefaults() const; 0030 bool isSaveNeeded(); 0031 0032 public Q_SLOTS: 0033 bool gtkPreviewAvailable(); 0034 0035 void showGtkPreview(); 0036 0037 void installGtkThemeFromFile(const QUrl &fileUrl); 0038 0039 void onThemeRemoved(); 0040 0041 Q_SIGNALS: 0042 void gtkThemesModelChanged(GtkThemesModel *model); 0043 0044 void showErrorMessage(const QString &message); 0045 0046 void gtkThemeSettingsChanged(); 0047 0048 private: 0049 GtkThemesModel *m_gtkThemesModel; 0050 0051 OrgKdeGtkConfigInterface m_gtkConfigInterface; 0052 };