Changeset View
Changeset View
Standalone View
Standalone View
kcmkwin/kwinrules/ruleswidget.h
Show All 17 Lines | |||||
18 | 18 | | |||
19 | 19 | | |||
20 | #ifndef __RULESWIDGET_H__ | 20 | #ifndef __RULESWIDGET_H__ | ||
21 | #define __RULESWIDGET_H__ | 21 | #define __RULESWIDGET_H__ | ||
22 | 22 | | |||
23 | #include <config-kwin.h> | 23 | #include <config-kwin.h> | ||
24 | 24 | | |||
25 | #include <QDialog> | 25 | #include <QDialog> | ||
26 | #include <kwindowsystem.h> | | |||
27 | #include <kkeysequencewidget.h> | 26 | #include <kkeysequencewidget.h> | ||
28 | 27 | | |||
29 | #include "ui_ruleswidgetbase.h" | 28 | #include "ui_ruleswidgetbase.h" | ||
30 | #include "ui_editshortcut.h" | 29 | #include "ui_editshortcut.h" | ||
31 | 30 | | |||
32 | #ifdef KWIN_BUILD_ACTIVITIES | 31 | #ifdef KWIN_BUILD_ACTIVITIES | ||
33 | namespace KActivities { | 32 | namespace KActivities { | ||
34 | class Consumer; | 33 | class Consumer; | ||
Show All 10 Lines | 43 | class RulesWidget | |||
45 | : public QWidget, public Ui::RulesWidgetBase | 44 | : public QWidget, public Ui::RulesWidgetBase | ||
46 | { | 45 | { | ||
47 | Q_OBJECT | 46 | Q_OBJECT | ||
48 | public: | 47 | public: | ||
49 | explicit RulesWidget(QWidget* parent = nullptr); | 48 | explicit RulesWidget(QWidget* parent = nullptr); | ||
50 | void setRules(Rules* r); | 49 | void setRules(Rules* r); | ||
51 | Rules* rules() const; | 50 | Rules* rules() const; | ||
52 | bool finalCheck(); | 51 | bool finalCheck(); | ||
53 | void prepareWindowSpecific(WId window); | 52 | void prepareWindowSpecific(const QVariantMap &info); | ||
54 | Q_SIGNALS: | 53 | Q_SIGNALS: | ||
55 | void changed(bool state); | 54 | void changed(bool state); | ||
56 | protected Q_SLOTS: | 55 | protected Q_SLOTS: | ||
57 | void detectClicked(); | 56 | void detectClicked(); | ||
58 | void wmclassMatchChanged(); | 57 | void wmclassMatchChanged(); | ||
59 | void roleMatchChanged(); | 58 | void roleMatchChanged(); | ||
60 | void titleMatchChanged(); | 59 | void titleMatchChanged(); | ||
61 | void machineMatchChanged(); | 60 | void machineMatchChanged(); | ||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | 109 | #ifdef KWIN_BUILD_ACTIVITIES | |||
112 | QString comboToActivity(int val) const; | 111 | QString comboToActivity(int val) const; | ||
113 | void updateActivitiesList(); | 112 | void updateActivitiesList(); | ||
114 | KActivities::Consumer *m_activities; | 113 | KActivities::Consumer *m_activities; | ||
115 | QString m_selectedActivityId; // we need this for async activity loading | 114 | QString m_selectedActivityId; // we need this for async activity loading | ||
116 | #endif | 115 | #endif | ||
117 | int comboToTiling(int val) const; | 116 | int comboToTiling(int val) const; | ||
118 | int inc(int i) const { return i+1; } | 117 | int inc(int i) const { return i+1; } | ||
119 | int dec(int i) const { return i-1; } | 118 | int dec(int i) const { return i-1; } | ||
120 | void prefillUnusedValues(const KWindowInfo& info); | | |||
121 | void prefillUnusedValues(const QVariantMap& info); | 119 | void prefillUnusedValues(const QVariantMap& info); | ||
122 | DetectDialog* detect_dlg; | 120 | DetectDialog* detect_dlg; | ||
123 | bool detect_dlg_ok; | 121 | bool detect_dlg_ok; | ||
124 | }; | 122 | }; | ||
125 | 123 | | |||
126 | class RulesDialog | 124 | class RulesDialog | ||
127 | : public QDialog | 125 | : public QDialog | ||
128 | { | 126 | { | ||
129 | Q_OBJECT | 127 | Q_OBJECT | ||
130 | public: | 128 | public: | ||
131 | explicit RulesDialog(QWidget* parent = nullptr, const char* name = nullptr); | 129 | explicit RulesDialog(QWidget* parent = nullptr, const char* name = nullptr); | ||
132 | Rules* edit(Rules* r, WId window, bool show_hints); | 130 | Rules* edit(Rules* r, const QVariantMap& info, bool show_hints); | ||
133 | protected: | 131 | protected: | ||
134 | virtual void accept(); | 132 | virtual void accept(); | ||
135 | private Q_SLOTS: | 133 | private Q_SLOTS: | ||
136 | void displayHints(); | 134 | void displayHints(); | ||
137 | private: | 135 | private: | ||
138 | RulesWidget* widget; | 136 | RulesWidget* widget; | ||
139 | Rules* rules; | 137 | Rules* rules; | ||
140 | }; | 138 | }; | ||
Show All 40 Lines |