Changeset View
Changeset View
Standalone View
Standalone View
containmentactions/contextmenu/menu.h
Show All 17 Lines | |||||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #ifndef CONTEXTMENU_HEADER | 20 | #ifndef CONTEXTMENU_HEADER | ||
21 | #define CONTEXTMENU_HEADER | 21 | #define CONTEXTMENU_HEADER | ||
22 | 22 | | |||
23 | #include <QButtonGroup> | 23 | #include <QButtonGroup> | ||
24 | #include <plasma/containmentactions.h> | 24 | #include <plasma/containmentactions.h> | ||
25 | 25 | | |||
26 | class SessionManagement; | ||||
27 | | ||||
26 | class ContextMenu : public Plasma::ContainmentActions | 28 | class ContextMenu : public Plasma::ContainmentActions | ||
27 | { | 29 | { | ||
28 | Q_OBJECT | 30 | Q_OBJECT | ||
29 | public: | 31 | public: | ||
30 | ContextMenu(QObject* parent, const QVariantList& args); | 32 | ContextMenu(QObject* parent, const QVariantList& args); | ||
31 | ~ContextMenu() override; | 33 | ~ContextMenu() override; | ||
32 | 34 | | |||
33 | void restore(const KConfigGroup&) override; | 35 | void restore(const KConfigGroup&) override; | ||
34 | 36 | | |||
35 | QList<QAction*> contextualActions() override; | 37 | QList<QAction*> contextualActions() override; | ||
36 | QAction* action(const QString &name); | 38 | QAction* action(const QString &name); | ||
37 | 39 | | |||
38 | QWidget* createConfigurationInterface(QWidget* parent) override; | 40 | QWidget* createConfigurationInterface(QWidget* parent) override; | ||
39 | void configurationAccepted() override; | 41 | void configurationAccepted() override; | ||
40 | void save(KConfigGroup &config) override; | 42 | void save(KConfigGroup &config) override; | ||
41 | 43 | | |||
42 | public Q_SLOTS: | 44 | public Q_SLOTS: | ||
43 | void runCommand(); | 45 | void runCommand(); | ||
44 | void lockScreen(); | | |||
45 | void startLogout(); | 46 | void startLogout(); | ||
46 | void logout(); | | |||
47 | 47 | | |||
48 | private: | 48 | private: | ||
49 | QAction *m_runCommandAction; | 49 | QAction *m_runCommandAction; | ||
50 | QAction *m_lockScreenAction; | 50 | QAction *m_lockScreenAction; | ||
51 | QAction *m_logoutAction; | 51 | QAction *m_logoutAction; | ||
52 | QAction *m_separator1; | 52 | QAction *m_separator1; | ||
53 | QAction *m_separator2; | 53 | QAction *m_separator2; | ||
54 | QAction *m_separator3; | 54 | QAction *m_separator3; | ||
55 | 55 | | |||
56 | // action name and whether it is enabled or not | 56 | // action name and whether it is enabled or not | ||
57 | QHash<QString, bool> m_actions; | 57 | QHash<QString, bool> m_actions; | ||
58 | QStringList m_actionOrder; | 58 | QStringList m_actionOrder; | ||
59 | QButtonGroup *m_buttons; | 59 | QButtonGroup *m_buttons; | ||
60 | SessionManagement *m_session; | ||||
60 | }; | 61 | }; | ||
61 | 62 | | |||
62 | #endif | 63 | #endif |