Changeset View
Changeset View
Standalone View
Standalone View
src/kcm.h
Show All 21 Lines | |||||
22 | #define _KCM_PLYMOUTH_H | 22 | #define _KCM_PLYMOUTH_H | ||
23 | 23 | | |||
24 | #include <QDir> | 24 | #include <QDir> | ||
25 | 25 | | |||
26 | #include <KNewStuff3/KNS3/DownloadDialog> | 26 | #include <KNewStuff3/KNS3/DownloadDialog> | ||
27 | 27 | | |||
28 | #include <KQuickAddons/ConfigModule> | 28 | #include <KQuickAddons/ConfigModule> | ||
29 | 29 | | |||
30 | class QQuickView; | 30 | class QQuickItem; | ||
31 | class QStandardItemModel; | 31 | class QStandardItemModel; | ||
32 | 32 | | |||
33 | class KCMPlymouth : public KQuickAddons::ConfigModule | 33 | class KCMPlymouth : public KQuickAddons::ConfigModule | ||
34 | { | 34 | { | ||
35 | Q_OBJECT | 35 | Q_OBJECT | ||
36 | Q_PROPERTY(QStandardItemModel *themesModel READ themesModel CONSTANT) | 36 | Q_PROPERTY(QStandardItemModel *themesModel READ themesModel CONSTANT) | ||
37 | Q_PROPERTY(QString selectedPlugin READ selectedPlugin WRITE setSelectedPlugin NOTIFY selectedPluginChanged) | 37 | Q_PROPERTY(QString selectedPlugin READ selectedPlugin WRITE setSelectedPlugin NOTIFY selectedPluginChanged) | ||
38 | Q_PROPERTY(int selectedPluginIndex READ selectedPluginIndex NOTIFY selectedPluginIndexChanged) | ||||
38 | 39 | | |||
39 | public: | 40 | public: | ||
40 | enum Roles { | 41 | enum Roles { | ||
41 | PluginNameRole = Qt::UserRole +1, | 42 | DescriptionRole = Qt::UserRole + 1, | ||
43 | PluginNameRole, | ||||
42 | ScreenhotRole, | 44 | ScreenhotRole, | ||
43 | UninstallableRole | 45 | UninstallableRole | ||
44 | }; | 46 | }; | ||
45 | explicit KCMPlymouth(QObject* parent, const QVariantList& args); | 47 | explicit KCMPlymouth(QObject* parent, const QVariantList& args); | ||
46 | ~KCMPlymouth() Q_DECL_OVERRIDE; | 48 | ~KCMPlymouth() Q_DECL_OVERRIDE; | ||
47 | 49 | | |||
48 | QStandardItemModel *themesModel(); | 50 | QStandardItemModel *themesModel(); | ||
49 | 51 | | |||
50 | QString selectedPlugin() const; | 52 | QString selectedPlugin() const; | ||
51 | void setSelectedPlugin(const QString &plugin); | 53 | void setSelectedPlugin(const QString &plugin); | ||
52 | 54 | | |||
53 | Q_INVOKABLE int selectedPluginIndex() const; | 55 | int selectedPluginIndex() const; | ||
54 | Q_INVOKABLE void getNewStuff(); | 56 | | ||
57 | Q_INVOKABLE void getNewStuff(QQuickItem *ctx); | ||||
55 | Q_INVOKABLE void uninstall(const QString &plugin); | 58 | Q_INVOKABLE void uninstall(const QString &plugin); | ||
56 | 59 | | |||
57 | public Q_SLOTS: | 60 | public Q_SLOTS: | ||
58 | void load() Q_DECL_OVERRIDE; | 61 | void load() Q_DECL_OVERRIDE; | ||
59 | void save() Q_DECL_OVERRIDE; | 62 | void save() Q_DECL_OVERRIDE; | ||
60 | void defaults() Q_DECL_OVERRIDE; | 63 | void defaults() Q_DECL_OVERRIDE; | ||
61 | 64 | | |||
62 | Q_SIGNALS: | 65 | Q_SIGNALS: | ||
63 | void selectedPluginChanged(); | 66 | void selectedPluginChanged(); | ||
67 | void selectedPluginIndexChanged(); | ||||
68 | | ||||
69 | void showSuccessMessage(const QString &message); | ||||
70 | void showErrorMessage(const QString &message); | ||||
64 | 71 | | |||
65 | private: | 72 | private: | ||
broulik: I think this should be a property `Q_PROPERTY(bool saving...)` or more generic `busy` like in… | |||||
66 | QStandardItemModel *m_model; | 73 | QStandardItemModel *m_model; | ||
67 | QString m_selectedPlugin; | 74 | QString m_selectedPlugin; | ||
68 | QPointer<KNS3::DownloadDialog> m_newStuffDialog; | 75 | QPointer<KNS3::DownloadDialog> m_newStuffDialog; | ||
69 | }; | 76 | }; | ||
70 | 77 | | |||
71 | #endif | 78 | #endif |
I think this should be a property Q_PROPERTY(bool saving...) or more generic busy like in the other KCMs and then proper bindings in the UI