Changeset View
Changeset View
Standalone View
Standalone View
plugins/runcommand/runcommand_config.h
Show All 17 Lines | |||||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #ifndef SHARE_CONFIG_H | 21 | #ifndef SHARE_CONFIG_H | ||
22 | #define SHARE_CONFIG_H | 22 | #define SHARE_CONFIG_H | ||
23 | 23 | | |||
24 | #include "kcmplugin/kdeconnectpluginkcm.h" | 24 | #include "kcmplugin/kdeconnectpluginkcm.h" | ||
25 | 25 | | |||
26 | class QMenu; | ||||
26 | class QStandardItemModel; | 27 | class QStandardItemModel; | ||
27 | 28 | | |||
28 | class RunCommandConfig | 29 | class RunCommandConfig | ||
29 | : public KdeConnectPluginKcm | 30 | : public KdeConnectPluginKcm | ||
30 | { | 31 | { | ||
31 | Q_OBJECT | 32 | Q_OBJECT | ||
32 | public: | 33 | public: | ||
33 | RunCommandConfig(QWidget* parent, const QVariantList&); | 34 | RunCommandConfig(QWidget* parent, const QVariantList&); | ||
34 | ~RunCommandConfig() override; | 35 | ~RunCommandConfig() override; | ||
35 | 36 | | |||
36 | public Q_SLOTS: | 37 | public Q_SLOTS: | ||
37 | void save() override; | 38 | void save() override; | ||
38 | void load() override; | 39 | void load() override; | ||
39 | void defaults() override; | 40 | void defaults() override; | ||
40 | 41 | | |||
41 | private Q_SLOTS: | 42 | private Q_SLOTS: | ||
42 | void onDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight); | 43 | void onDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight); | ||
43 | private: | 44 | private: | ||
45 | void addSuggestedCommand(QMenu* menu, const QString &name, const QString &command); | ||||
46 | void insertRow(int i, const QString &name, const QString &command); | ||||
44 | void insertEmptyRow(); | 47 | void insertEmptyRow(); | ||
45 | 48 | | |||
46 | QStandardItemModel* m_entriesModel; | 49 | QStandardItemModel* m_entriesModel; | ||
47 | 50 | | |||
48 | }; | 51 | }; | ||
49 | 52 | | |||
50 | #endif | 53 | #endif |