Changeset View
Standalone View
kcmkwin/kwintabbox/main.cpp
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | |||||
44 | #include <KServiceTypeTrader> | 44 | #include <KServiceTypeTrader> | ||
45 | #include <KShortcutsEditor> | 45 | #include <KShortcutsEditor> | ||
46 | #include <KNewStuff3/KNS3/DownloadDialog> | 46 | #include <KNewStuff3/KNS3/DownloadDialog> | ||
47 | // Plasma | 47 | // Plasma | ||
48 | #include <KPackage/Package> | 48 | #include <KPackage/Package> | ||
49 | #include <KPackage/PackageLoader> | 49 | #include <KPackage/PackageLoader> | ||
50 | 50 | | |||
51 | // own | 51 | // own | ||
52 | #include "kwintabboxconfigform.h" | ||||
52 | #include "layoutpreview.h" | 53 | #include "layoutpreview.h" | ||
53 | #include "kwintabboxsettings.h" | 54 | #include "kwintabboxsettings.h" | ||
54 | #include "kwinswitcheffectsettings.h" | 55 | #include "kwinswitcheffectsettings.h" | ||
55 | #include "kwinpluginssettings.h" | 56 | #include "kwinpluginssettings.h" | ||
56 | 57 | | |||
57 | K_PLUGIN_FACTORY(KWinTabBoxConfigFactory, registerPlugin<KWin::KWinTabBoxConfig>();) | 58 | K_PLUGIN_FACTORY(KWinTabBoxConfigFactory, registerPlugin<KWin::KWinTabBoxConfig>();) | ||
58 | 59 | | |||
59 | namespace KWin | 60 | namespace KWin | ||
60 | { | 61 | { | ||
61 | 62 | | |||
62 | using namespace TabBox; | 63 | using namespace TabBox; | ||
63 | 64 | | |||
64 | KWinTabBoxConfigForm::KWinTabBoxConfigForm(QWidget* parent) | | |||
65 | : QWidget(parent) | | |||
66 | { | | |||
67 | setupUi(this); | | |||
68 | } | | |||
69 | 65 | | |||
70 | KWinTabBoxConfig::KWinTabBoxConfig(QWidget* parent, const QVariantList& args) | 66 | KWinTabBoxConfig::KWinTabBoxConfig(QWidget* parent, const QVariantList& args) | ||
71 | : KCModule(parent, args) | 67 | : KCModule(parent, args) | ||
72 | , m_config(KSharedConfig::openConfig("kwinrc")) | 68 | , m_config(KSharedConfig::openConfig("kwinrc")) | ||
73 | , m_tabBoxConfig(new TabBoxSettings(QStringLiteral("TabBox"), this)) | 69 | , m_tabBoxConfig(new TabBoxSettings(QStringLiteral("TabBox"), this)) | ||
74 | , m_tabBoxAlternativeConfig(new TabBoxSettings(QStringLiteral("TabBoxAlternative"), this)) | 70 | , m_tabBoxAlternativeConfig(new TabBoxSettings(QStringLiteral("TabBoxAlternative"), this)) | ||
75 | , m_coverSwitchConfig(new SwitchEffectSettings(QStringLiteral("Effect-CoverSwitch"), this)) | 71 | , m_coverSwitchConfig(new SwitchEffectSettings(QStringLiteral("Effect-CoverSwitch"), this)) | ||
76 | , m_flipSwitchConfig(new SwitchEffectSettings(QStringLiteral("Effect-FlipSwitch"), this)) | 72 | , m_flipSwitchConfig(new SwitchEffectSettings(QStringLiteral("Effect-FlipSwitch"), this)) | ||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | 118 | ADD_SHORTCUT("Walk Through Windows of Current Application", Qt::ALT + Qt::Key_QuoteLeft, | |||
123 | m_primaryTabBoxUi->scCurrent); | 119 | m_primaryTabBoxUi->scCurrent); | ||
124 | ADD_SHORTCUT("Walk Through Windows of Current Application (Reverse)", Qt::ALT + Qt::Key_AsciiTilde, | 120 | ADD_SHORTCUT("Walk Through Windows of Current Application (Reverse)", Qt::ALT + Qt::Key_AsciiTilde, | ||
125 | m_primaryTabBoxUi->scCurrentReverse); | 121 | m_primaryTabBoxUi->scCurrentReverse); | ||
126 | ADD_SHORTCUT("Walk Through Windows of Current Application Alternative", QKeySequence(), m_alternativeTabBoxUi->scCurrent); | 122 | ADD_SHORTCUT("Walk Through Windows of Current Application Alternative", QKeySequence(), m_alternativeTabBoxUi->scCurrent); | ||
127 | ADD_SHORTCUT("Walk Through Windows of Current Application Alternative (Reverse)", QKeySequence(), | 123 | ADD_SHORTCUT("Walk Through Windows of Current Application Alternative (Reverse)", QKeySequence(), | ||
128 | m_alternativeTabBoxUi->scCurrentReverse); | 124 | m_alternativeTabBoxUi->scCurrentReverse); | ||
129 | #undef ADD_SHORTCUT | 125 | #undef ADD_SHORTCUT | ||
130 | 126 | | |||
131 | initLayoutLists(); | 127 | addConfig(m_tabBoxConfig, m_primaryTabBoxUi); | ||
132 | KWinTabBoxConfigForm *ui[2] = { m_primaryTabBoxUi, m_alternativeTabBoxUi }; | 128 | addConfig(m_tabBoxAlternativeConfig, m_alternativeTabBoxUi); | ||
133 | for (int i = 0; i < 2; ++i) { | | |||
134 | ui[i]->effectConfigButton->setIcon(QIcon::fromTheme(QStringLiteral("view-preview"))); | | |||
135 | 129 | | |||
136 | connect(ui[i]->highlightWindowCheck, SIGNAL(clicked(bool)), SLOT(changed())); | 130 | createConnections(m_primaryTabBoxUi, m_tabBoxConfig); | ||
137 | connect(ui[i]->showTabBox, SIGNAL(clicked(bool)), SLOT(tabBoxToggled(bool))); | 131 | createConnections(m_alternativeTabBoxUi, m_tabBoxAlternativeConfig); | ||
138 | connect(ui[i]->effectCombo, SIGNAL(currentIndexChanged(int)), SLOT(changed())); | | |||
139 | connect(ui[i]->effectCombo, SIGNAL(currentIndexChanged(int)), SLOT(effectSelectionChanged(int))); | | |||
140 | connect(ui[i]->effectConfigButton, SIGNAL(clicked(bool)), SLOT(configureEffectClicked())); | | |||
141 | | ||||
142 | connect(ui[i]->switchingModeCombo, SIGNAL(currentIndexChanged(int)), SLOT(changed())); | | |||
143 | connect(ui[i]->showDesktop, SIGNAL(clicked(bool)), SLOT(changed())); | | |||
144 | | ||||
145 | connect(ui[i]->filterDesktops, SIGNAL(clicked(bool)), SLOT(changed())); | | |||
146 | connect(ui[i]->currentDesktop, SIGNAL(clicked(bool)), SLOT(changed())); | | |||
147 | connect(ui[i]->otherDesktops, SIGNAL(clicked(bool)), SLOT(changed())); | | |||
148 | | ||||
149 | connect(ui[i]->filterActivities, SIGNAL(clicked(bool)), SLOT(changed())); | | |||
150 | connect(ui[i]->currentActivity, SIGNAL(clicked(bool)), SLOT(changed())); | | |||
151 | connect(ui[i]->otherActivities, SIGNAL(clicked(bool)), SLOT(changed())); | | |||
152 | | ||||
153 | connect(ui[i]->filterScreens, SIGNAL(clicked(bool)), SLOT(changed())); | | |||
154 | if (QApplication::screens().count() < 2) { | | |||
155 | ui[i]->filterScreens->hide(); | | |||
156 | ui[i]->screenFilter->hide(); | | |||
157 | } else { | | |||
158 | connect(ui[i]->currentScreen, SIGNAL(clicked(bool)), SLOT(changed())); | | |||
159 | connect(ui[i]->otherScreens, SIGNAL(clicked(bool)), SLOT(changed())); | | |||
160 | } | | |||
161 | 132 | | |||
162 | connect(ui[i]->oneAppWindow, SIGNAL(clicked(bool)), SLOT(changed())); | 133 | initLayoutLists(); | ||
163 | connect(ui[i]->filterMinimization, SIGNAL(clicked(bool)), SLOT(changed())); | | |||
164 | connect(ui[i]->visibleWindows, SIGNAL(clicked(bool)), SLOT(changed())); | | |||
165 | connect(ui[i]->hiddenWindows, SIGNAL(clicked(bool)), SLOT(changed())); | | |||
166 | } | | |||
167 | 134 | | |||
168 | // check focus policy - we don't offer configs for unreasonable focus policies | 135 | // check focus policy - we don't offer configs for unreasonable focus policies | ||
169 | KConfigGroup config(m_config, "Windows"); | 136 | KConfigGroup config(m_config, "Windows"); | ||
170 | QString policy = config.readEntry("FocusPolicy", "ClickToFocus"); | 137 | QString policy = config.readEntry("FocusPolicy", "ClickToFocus"); | ||
171 | if ((policy == "FocusUnderMouse") || (policy == "FocusStrictlyUnderMouse")) { | 138 | if ((policy == "FocusUnderMouse") || (policy == "FocusStrictlyUnderMouse")) { | ||
172 | tabWidget->setEnabled(false); | 139 | tabWidget->setEnabled(false); | ||
173 | infoLabel->show(); | 140 | infoLabel->show(); | ||
174 | } else { | 141 | } else { | ||
175 | infoLabel->hide(); | 142 | infoLabel->hide(); | ||
176 | } | 143 | } | ||
177 | } | 144 | } | ||
178 | 145 | | |||
179 | KWinTabBoxConfig::~KWinTabBoxConfig() | 146 | KWinTabBoxConfig::~KWinTabBoxConfig() | ||
180 | { | 147 | { | ||
181 | } | 148 | } | ||
182 | 149 | | |||
183 | | ||||
184 | static QList<KPackage::Package> availableLnFPackages() | 150 | static QList<KPackage::Package> availableLnFPackages() | ||
185 | { | 151 | { | ||
186 | QList<KPackage::Package> packages; | 152 | QList<KPackage::Package> packages; | ||
187 | QStringList paths; | 153 | QStringList paths; | ||
188 | const QStringList dataPaths = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation); | 154 | const QStringList dataPaths = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation); | ||
189 | 155 | | |||
190 | for (const QString &path : dataPaths) { | 156 | for (const QString &path : dataPaths) { | ||
191 | QDir dir(path + QLatin1String("/plasma/look-and-feel")); | 157 | QDir dir(path + QLatin1String("/plasma/look-and-feel")); | ||
Show All 16 Lines | |||||
208 | } | 174 | } | ||
209 | 175 | | |||
210 | return packages; | 176 | return packages; | ||
211 | } | 177 | } | ||
212 | 178 | | |||
213 | void KWinTabBoxConfig::initLayoutLists() | 179 | void KWinTabBoxConfig::initLayoutLists() | ||
214 | { | 180 | { | ||
215 | // search the effect names | 181 | // search the effect names | ||
216 | QString coverswitch = BuiltInEffects::effectData(BuiltInEffect::CoverSwitch).displayName; | 182 | m_coverSwitch = BuiltInEffects::effectData(BuiltInEffect::CoverSwitch).name; | ||
217 | QString flipswitch = BuiltInEffects::effectData(BuiltInEffect::FlipSwitch).displayName; | 183 | m_flipSwitch = BuiltInEffects::effectData(BuiltInEffect::FlipSwitch).name; | ||
218 | 184 | | |||
219 | QList<KPluginMetaData> offers = KPackage::PackageLoader::self()->listPackages("KWin/WindowSwitcher"); | 185 | QList<KPluginMetaData> offers = KPackage::PackageLoader::self()->listPackages("KWin/WindowSwitcher"); | ||
220 | QStringList layoutNames, layoutPlugins, layoutPaths; | 186 | QStringList layoutNames, layoutPlugins, layoutPaths; | ||
221 | 187 | | |||
222 | const auto lnfPackages = availableLnFPackages(); | 188 | const auto lnfPackages = availableLnFPackages(); | ||
223 | for (const auto &package : lnfPackages) { | 189 | for (const auto &package : lnfPackages) { | ||
224 | const auto &metaData = package.metadata(); | 190 | const auto &metaData = package.metadata(); | ||
225 | layoutNames << metaData.name(); | 191 | layoutNames << metaData.name(); | ||
Show All 23 Lines | 196 | for (const auto &offer : offers) { | |||
249 | layoutPaths << scriptFile; | 215 | layoutPaths << scriptFile; | ||
250 | } | 216 | } | ||
251 | 217 | | |||
252 | KWinTabBoxConfigForm *ui[2] = { m_primaryTabBoxUi, m_alternativeTabBoxUi }; | 218 | KWinTabBoxConfigForm *ui[2] = { m_primaryTabBoxUi, m_alternativeTabBoxUi }; | ||
253 | for (int i=0; i<2; ++i) { | 219 | for (int i=0; i<2; ++i) { | ||
254 | int index = ui[i]->effectCombo->currentIndex(); | 220 | int index = ui[i]->effectCombo->currentIndex(); | ||
255 | QVariant data = ui[i]->effectCombo->itemData(index); | 221 | QVariant data = ui[i]->effectCombo->itemData(index); | ||
256 | ui[i]->effectCombo->clear(); | 222 | ui[i]->effectCombo->clear(); | ||
257 | ui[i]->effectCombo->addItem(coverswitch); | 223 | ui[i]->effectCombo->addItem(BuiltInEffects::effectData(BuiltInEffect::CoverSwitch).displayName, m_coverSwitch); | ||
258 | ui[i]->effectCombo->addItem(flipswitch); | 224 | ui[i]->effectCombo->setItemData(ui[i]->effectCombo->count() - 1, false, KWinTabBoxConfigForm::AddonEffect); | ||
225 | ui[i]->effectCombo->addItem(BuiltInEffects::effectData(BuiltInEffect::FlipSwitch).displayName, m_flipSwitch); | ||||
226 | ui[i]->effectCombo->setItemData(ui[i]->effectCombo->count() - 1, false, KWinTabBoxConfigForm::AddonEffect); | ||||
259 | for (int j = 0; j < layoutNames.count(); ++j) { | 227 | for (int j = 0; j < layoutNames.count(); ++j) { | ||
260 | ui[i]->effectCombo->addItem(layoutNames[j], layoutPlugins[j]); | 228 | ui[i]->effectCombo->addItem(layoutNames[j], layoutPlugins[j]); | ||
261 | ui[i]->effectCombo->setItemData(ui[i]->effectCombo->count() - 1, layoutPaths[j], Qt::UserRole+1); | 229 | ui[i]->effectCombo->setItemData(ui[i]->effectCombo->count() - 1, layoutPaths[j], KWinTabBoxConfigForm::LayoutPath); | ||
230 | ui[i]->effectCombo->setItemData(ui[i]->effectCombo->count() - 1, true, KWinTabBoxConfigForm::AddonEffect); | ||||
262 | } | 231 | } | ||
232 | ui[i]->effectCombo->model()->sort(0); | ||||
233 | | ||||
263 | if (data.isValid()) { | 234 | if (data.isValid()) { | ||
264 | ui[i]->effectCombo->setCurrentIndex(ui[i]->effectCombo->findData(data)); | 235 | ui[i]->effectCombo->setCurrentIndex(ui[i]->effectCombo->findData(data)); | ||
265 | } else if (index != -1) { | 236 | } else if (index != -1) { | ||
266 | ui[i]->effectCombo->setCurrentIndex(index); | 237 | ui[i]->effectCombo->setCurrentIndex(index); | ||
267 | } | 238 | } | ||
268 | } | 239 | } | ||
269 | } | 240 | } | ||
270 | 241 | | |||
242 | void KWinTabBoxConfig::createConnections(KWinTabBoxConfigForm *ui, TabBoxSettings *config) | ||||
243 | { | ||||
244 | connect(ui->effectConfigButton, SIGNAL(clicked(bool)), SLOT(configureEffectClicked())); | ||||
meven: Too bad we have to use old syntax for private slots | |||||
245 | | ||||
246 | connect(ui, &KWinTabBoxConfigForm::filterScreenChanged, [this, config](int value) { | ||||
Risk seems low... but just in case, I'd use the four variant connect in this method still and pass this as third parameter just before the lambda. Granted in case of crash the bug would be somewhere else (as in the reason why ui would outlive this...) but if I would be the future developer having to debug such a regression I'd rather have another symptom than a crash deep within Qt signal emission implementation. :-) ervin: Risk seems low... but just in case, I'd use the four variant connect in this method still and… | |||||
247 | config->setMultiScreenMode(value); | ||||
248 | updateUnmanagedState(); | ||||
Probably works, that being said, we're not supposed to temper with the config object in those slots (this is a KCModule not a Plasma::ConfigModule, they unfortunately both have very different approaches). If we want to stay true to the KCModule approach, we'd rather connect to updateUnmanagedState() directly, and inside updateUnmanagedState() compare the widget value with the corresponding setting values. ervin: Probably works, that being said, we're not supposed to temper with the config object in those… | |||||
249 | }); | ||||
250 | connect(ui, &KWinTabBoxConfigForm::filterDesktopChanged, [this, config](int value) { | ||||
251 | config->setDesktopMode(value); | ||||
252 | updateUnmanagedState(); | ||||
253 | }); | ||||
254 | connect(ui, &KWinTabBoxConfigForm::filterActivitiesChanged, [this, config](int value) { | ||||
255 | config->setActivitiesMode(value); | ||||
256 | updateUnmanagedState(); | ||||
257 | }); | ||||
258 | connect(ui, &KWinTabBoxConfigForm::filterMinimizationChanged, [this, config](int value) { | ||||
259 | config->setMinimizedMode(value); | ||||
260 | updateUnmanagedState(); | ||||
261 | }); | ||||
262 | connect(ui, &KWinTabBoxConfigForm::applicationModeChanged, [this, config](int value) { | ||||
263 | config->setApplicationsMode(value); | ||||
264 | updateUnmanagedState(); | ||||
265 | }); | ||||
266 | connect(ui, &KWinTabBoxConfigForm::showDesktopModeChanged, [this, config](int value) { | ||||
267 | config->setShowDesktopMode(value); | ||||
268 | updateUnmanagedState(); | ||||
269 | }); | ||||
270 | connect(ui, &KWinTabBoxConfigForm::switchingModeChanged, [this, config](int value) { | ||||
271 | config->setSwitchingMode(value); | ||||
272 | updateUnmanagedState(); | ||||
273 | }); | ||||
274 | connect(ui, &KWinTabBoxConfigForm::layoutNameChanged, [this, config](const QString &value) { | ||||
275 | config->setLayoutName(value); | ||||
276 | updateUnmanagedState(); | ||||
277 | }); | ||||
278 | } | ||||
279 | | ||||
280 | void KWinTabBoxConfig::updateUnmanagedState() | ||||
281 | { | ||||
282 | unmanagedWidgetChangeState(m_tabBoxConfig->isSaveNeeded() || m_tabBoxAlternativeConfig->isSaveNeeded()); | ||||
If you address my comment above, implementation here is likely to change quite a bit. ervin: If you address my comment above, implementation here is likely to change quite a bit. | |||||
283 | unmanagedWidgetDefaultState(m_tabBoxConfig->isDefaults() && m_tabBoxAlternativeConfig->isDefaults()); | ||||
284 | } | ||||
285 | | ||||
271 | void KWinTabBoxConfig::load() | 286 | void KWinTabBoxConfig::load() | ||
272 | { | 287 | { | ||
273 | KCModule::load(); | 288 | KCModule::load(); | ||
274 | 289 | | |||
275 | m_tabBoxConfig->load(); | 290 | m_tabBoxConfig->load(); | ||
276 | m_tabBoxAlternativeConfig->load(); | 291 | m_tabBoxAlternativeConfig->load(); | ||
277 | 292 | | |||
278 | m_coverSwitchConfig->load(); | 293 | m_coverSwitchConfig->load(); | ||
279 | m_flipSwitchConfig->load(); | 294 | m_flipSwitchConfig->load(); | ||
280 | 295 | | |||
281 | m_pluginsConfig->load(); | 296 | m_pluginsConfig->load(); | ||
282 | 297 | | |||
283 | updateUiFromConfig(m_primaryTabBoxUi, m_tabBoxConfig); | 298 | updateUiFromConfig(m_primaryTabBoxUi, m_tabBoxConfig); | ||
284 | updateUiFromConfig(m_alternativeTabBoxUi , m_tabBoxAlternativeConfig); | 299 | updateUiFromConfig(m_alternativeTabBoxUi , m_tabBoxAlternativeConfig); | ||
285 | 300 | | |||
286 | if (m_pluginsConfig->coverswitchEnabled()) { | 301 | if (m_pluginsConfig->coverswitchEnabled()) { | ||
287 | if (m_coverSwitchConfig->tabBox()) { | 302 | if (m_coverSwitchConfig->tabBox()) { | ||
288 | m_primaryTabBoxUi->effectCombo->setCurrentIndex(CoverSwitch); | 303 | m_primaryTabBoxUi->setLayoutName(m_coverSwitch); | ||
289 | } | 304 | } | ||
290 | if (m_coverSwitchConfig->tabBoxAlternative()) { | 305 | if (m_coverSwitchConfig->tabBoxAlternative()) { | ||
291 | m_alternativeTabBoxUi->effectCombo->setCurrentIndex(CoverSwitch); | 306 | m_alternativeTabBoxUi->setLayoutName(m_coverSwitch); | ||
292 | } | 307 | } | ||
293 | } | 308 | } | ||
294 | if (m_pluginsConfig->flipswitchEnabled()) { | 309 | if (m_pluginsConfig->flipswitchEnabled()) { | ||
295 | if (m_flipSwitchConfig->tabBox()) { | 310 | if (m_flipSwitchConfig->tabBox()) { | ||
296 | m_primaryTabBoxUi->effectCombo->setCurrentIndex(FlipSwitch); | 311 | m_primaryTabBoxUi->setLayoutName(m_flipSwitch); | ||
297 | } | 312 | } | ||
298 | if (m_flipSwitchConfig->tabBoxAlternative()) { | 313 | if (m_flipSwitchConfig->tabBoxAlternative()) { | ||
299 | m_alternativeTabBoxUi->effectCombo->setCurrentIndex(FlipSwitch); | 314 | m_alternativeTabBoxUi->setLayoutName(m_flipSwitch); | ||
300 | } | 315 | } | ||
301 | } | 316 | } | ||
302 | 317 | | |||
303 | KWinTabBoxConfigForm* ui[2] = { m_primaryTabBoxUi, m_alternativeTabBoxUi }; | 318 | KWinTabBoxConfigForm* ui[2] = { m_primaryTabBoxUi, m_alternativeTabBoxUi }; | ||
304 | for (int i = 0; i < 2; ++i) { | 319 | for (int i = 0; i < 2; ++i) { | ||
305 | QString action; | 320 | QString action; | ||
306 | #define LOAD_SHORTCUT(_BTN_)\ | 321 | #define LOAD_SHORTCUT(_BTN_)\ | ||
307 | action = ui[i]->_BTN_->property("shortcutAction").toString();\ | 322 | action = ui[i]->_BTN_->property("shortcutAction").toString();\ | ||
308 | qDebug() << "load shortcut for " << action;\ | 323 | qDebug() << "load shortcut for " << action;\ | ||
309 | if (QAction *a = m_actionCollection->action(action)) { \ | 324 | if (QAction *a = m_actionCollection->action(action)) { \ | ||
310 | auto shortcuts = KGlobalAccel::self()->shortcut(a); \ | 325 | auto shortcuts = KGlobalAccel::self()->shortcut(a); \ | ||
311 | if (!shortcuts.isEmpty()) \ | 326 | if (!shortcuts.isEmpty()) \ | ||
312 | ui[i]->_BTN_->setKeySequence(shortcuts.first()); \ | 327 | ui[i]->_BTN_->setKeySequence(shortcuts.first()); \ | ||
313 | } | 328 | } | ||
314 | LOAD_SHORTCUT(scAll); | 329 | LOAD_SHORTCUT(scAll); | ||
315 | LOAD_SHORTCUT(scAllReverse); | 330 | LOAD_SHORTCUT(scAllReverse); | ||
316 | LOAD_SHORTCUT(scCurrent); | 331 | LOAD_SHORTCUT(scCurrent); | ||
317 | LOAD_SHORTCUT(scCurrentReverse); | 332 | LOAD_SHORTCUT(scCurrentReverse); | ||
318 | #undef LOAD_SHORTCUT | 333 | #undef LOAD_SHORTCUT | ||
319 | } | 334 | } | ||
320 | emit changed(false); | 335 | | ||
336 | updateUnmanagedState(); | ||||
321 | } | 337 | } | ||
322 | 338 | | |||
323 | void KWinTabBoxConfig::save() | 339 | void KWinTabBoxConfig::save() | ||
324 | { | 340 | { | ||
325 | KCModule::save(); | | |||
326 | | ||||
327 | // sync ui to config | | |||
328 | updateConfigFromUi(m_primaryTabBoxUi, m_tabBoxConfig); | | |||
329 | updateConfigFromUi(m_alternativeTabBoxUi, m_tabBoxAlternativeConfig); | | |||
330 | m_tabBoxConfig->save(); | | |||
331 | m_tabBoxAlternativeConfig->save(); | | |||
332 | | ||||
333 | // effects | 341 | // effects | ||
334 | bool highlightWindows = m_primaryTabBoxUi->highlightWindowCheck->isChecked() || | 342 | bool highlightWindows = m_primaryTabBoxUi->kcfg_HighlightWindows->isChecked() || | ||
335 | m_alternativeTabBoxUi->highlightWindowCheck->isChecked(); | 343 | m_alternativeTabBoxUi->kcfg_HighlightWindows->isChecked(); | ||
336 | const bool coverSwitch = m_primaryTabBoxUi->showTabBox->isChecked() && | 344 | const bool coverSwitch = m_primaryTabBoxUi->kcfg_ShowTabBox->isChecked() && | ||
337 | m_primaryTabBoxUi->effectCombo->currentIndex() == CoverSwitch; | 345 | m_primaryTabBoxUi->effectCombo->currentData() == m_coverSwitch; | ||
338 | const bool flipSwitch = m_primaryTabBoxUi->showTabBox->isChecked() && | 346 | const bool flipSwitch = m_primaryTabBoxUi->kcfg_ShowTabBox->isChecked() && | ||
339 | m_primaryTabBoxUi->effectCombo->currentIndex() == FlipSwitch; | 347 | m_primaryTabBoxUi->effectCombo->currentData() == m_flipSwitch; | ||
340 | const bool coverSwitchAlternative = m_alternativeTabBoxUi->showTabBox->isChecked() && | 348 | const bool coverSwitchAlternative = m_alternativeTabBoxUi->kcfg_ShowTabBox->isChecked() && | ||
341 | m_alternativeTabBoxUi->effectCombo->currentIndex() == CoverSwitch; | 349 | m_alternativeTabBoxUi->effectCombo->currentData() == m_coverSwitch; | ||
342 | const bool flipSwitchAlternative = m_alternativeTabBoxUi->showTabBox->isChecked() && | 350 | const bool flipSwitchAlternative = m_alternativeTabBoxUi->kcfg_ShowTabBox->isChecked() && | ||
343 | m_alternativeTabBoxUi->effectCombo->currentIndex() == FlipSwitch; | 351 | m_alternativeTabBoxUi->effectCombo->currentData() == m_flipSwitch; | ||
344 | 352 | | |||
345 | // activate effects if not active | 353 | // activate effects if not active | ||
346 | if (coverSwitch || coverSwitchAlternative) { | 354 | if (coverSwitch || coverSwitchAlternative) { | ||
347 | m_pluginsConfig->setCoverswitchEnabled(true); | 355 | m_pluginsConfig->setCoverswitchEnabled(true); | ||
348 | } | 356 | } | ||
349 | if (flipSwitch || flipSwitchAlternative) { | 357 | if (flipSwitch || flipSwitchAlternative) { | ||
350 | m_pluginsConfig->setFlipswitchEnabled(true); | 358 | m_pluginsConfig->setFlipswitchEnabled(true); | ||
351 | } | 359 | } | ||
352 | if (highlightWindows) { | 360 | if (highlightWindows) { | ||
353 | m_pluginsConfig->setHighlightwindowEnabled(true); | 361 | m_pluginsConfig->setHighlightwindowEnabled(true); | ||
354 | } | 362 | } | ||
355 | m_pluginsConfig->save(); | 363 | m_pluginsConfig->save(); | ||
356 | 364 | | |||
357 | m_coverSwitchConfig->setTabBox(coverSwitch); | 365 | m_coverSwitchConfig->setTabBox(coverSwitch); | ||
358 | m_coverSwitchConfig->setTabBoxAlternative(coverSwitchAlternative); | 366 | m_coverSwitchConfig->setTabBoxAlternative(coverSwitchAlternative); | ||
359 | m_coverSwitchConfig->save(); | 367 | m_coverSwitchConfig->save(); | ||
360 | 368 | | |||
361 | m_flipSwitchConfig->setTabBox(flipSwitch); | 369 | m_flipSwitchConfig->setTabBox(flipSwitch); | ||
362 | m_flipSwitchConfig->setTabBoxAlternative(flipSwitchAlternative); | 370 | m_flipSwitchConfig->setTabBoxAlternative(flipSwitchAlternative); | ||
363 | m_flipSwitchConfig->save(); | 371 | m_flipSwitchConfig->save(); | ||
364 | 372 | | |||
373 | m_tabBoxConfig->save(); | ||||
I'd expect those save calls to be done by the KCModule::save() call. Maybe what you want is instead of have the KCModule::save() call done before the dbug message being sent out. ervin: I'd expect those save calls to be done by the KCModule::save() call. Maybe what you want is… | |||||
374 | m_tabBoxAlternativeConfig->save(); | ||||
375 | | ||||
365 | // Reload KWin. | 376 | // Reload KWin. | ||
366 | QDBusMessage message = QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig"); | 377 | QDBusMessage message = QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig"); | ||
367 | QDBusConnection::sessionBus().send(message); | 378 | QDBusConnection::sessionBus().send(message); | ||
368 | // and reconfigure the effects | 379 | // and reconfigure the effects | ||
369 | OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.KWin"), | 380 | OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.KWin"), | ||
370 | QStringLiteral("/Effects"), | 381 | QStringLiteral("/Effects"), | ||
371 | QDBusConnection::sessionBus()); | 382 | QDBusConnection::sessionBus()); | ||
372 | interface.reconfigureEffect(BuiltInEffects::nameForEffect(BuiltInEffect::CoverSwitch)); | 383 | interface.reconfigureEffect(BuiltInEffects::nameForEffect(BuiltInEffect::CoverSwitch)); | ||
373 | interface.reconfigureEffect(BuiltInEffects::nameForEffect(BuiltInEffect::FlipSwitch)); | 384 | interface.reconfigureEffect(BuiltInEffects::nameForEffect(BuiltInEffect::FlipSwitch)); | ||
374 | 385 | | |||
375 | emit changed(false); | 386 | KCModule::save(); | ||
376 | } | 387 | } | ||
377 | 388 | | |||
378 | void KWinTabBoxConfig::defaults() | 389 | void KWinTabBoxConfig::defaults() | ||
379 | { | 390 | { | ||
380 | KCModule::defaults(); | | |||
381 | | ||||
382 | m_tabBoxConfig->setDefaults(); | 391 | m_tabBoxConfig->setDefaults(); | ||
383 | m_tabBoxAlternativeConfig->setDefaults(); | 392 | m_tabBoxAlternativeConfig->setDefaults(); | ||
384 | 393 | | |||
385 | m_pluginsConfig->setDefaults(); | | |||
386 | m_coverSwitchConfig->setDefaults(); | 394 | m_coverSwitchConfig->setDefaults(); | ||
387 | m_flipSwitchConfig->setDefaults(); | 395 | m_flipSwitchConfig->setDefaults(); | ||
388 | 396 | | |||
389 | updateUiFromConfig(m_primaryTabBoxUi, m_tabBoxConfig); | 397 | updateUiFromConfig(m_primaryTabBoxUi, m_tabBoxConfig); | ||
390 | updateUiFromConfig(m_alternativeTabBoxUi, m_tabBoxAlternativeConfig); | 398 | updateUiFromConfig(m_alternativeTabBoxUi, m_tabBoxAlternativeConfig); | ||
391 | 399 | | |||
392 | QString action; | 400 | QString action; | ||
393 | auto RESET_SHORTCUT = [this](KKeySequenceWidget *widget, const QKeySequence &sequence = QKeySequence()) { | 401 | auto RESET_SHORTCUT = [this](KKeySequenceWidget *widget, const QKeySequence &sequence = QKeySequence()) { | ||
394 | const QString action = widget->property("shortcutAction").toString(); | 402 | const QString action = widget->property("shortcutAction").toString(); | ||
395 | QAction *a = m_actionCollection->action(action); | 403 | QAction *a = m_actionCollection->action(action); | ||
396 | KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << sequence, KGlobalAccel::NoAutoloading); | 404 | KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << sequence, KGlobalAccel::NoAutoloading); | ||
397 | }; | 405 | }; | ||
398 | RESET_SHORTCUT(m_primaryTabBoxUi->scAll, Qt::ALT + Qt::Key_Tab); | 406 | RESET_SHORTCUT(m_primaryTabBoxUi->scAll, Qt::ALT + Qt::Key_Tab); | ||
399 | RESET_SHORTCUT(m_primaryTabBoxUi->scAllReverse, Qt::ALT + Qt::SHIFT + Qt::Key_Backtab); | 407 | RESET_SHORTCUT(m_primaryTabBoxUi->scAllReverse, Qt::ALT + Qt::SHIFT + Qt::Key_Backtab); | ||
400 | RESET_SHORTCUT(m_alternativeTabBoxUi->scAll); | 408 | RESET_SHORTCUT(m_alternativeTabBoxUi->scAll); | ||
401 | RESET_SHORTCUT(m_alternativeTabBoxUi->scAllReverse); | 409 | RESET_SHORTCUT(m_alternativeTabBoxUi->scAllReverse); | ||
402 | RESET_SHORTCUT(m_primaryTabBoxUi->scCurrent, Qt::ALT + Qt::Key_QuoteLeft); | 410 | RESET_SHORTCUT(m_primaryTabBoxUi->scCurrent, Qt::ALT + Qt::Key_QuoteLeft); | ||
403 | RESET_SHORTCUT(m_primaryTabBoxUi->scCurrentReverse, Qt::ALT + Qt::Key_AsciiTilde); | 411 | RESET_SHORTCUT(m_primaryTabBoxUi->scCurrentReverse, Qt::ALT + Qt::Key_AsciiTilde); | ||
404 | RESET_SHORTCUT(m_alternativeTabBoxUi->scCurrent); | 412 | RESET_SHORTCUT(m_alternativeTabBoxUi->scCurrent); | ||
405 | RESET_SHORTCUT(m_alternativeTabBoxUi->scCurrentReverse); | 413 | RESET_SHORTCUT(m_alternativeTabBoxUi->scCurrentReverse); | ||
406 | m_actionCollection->writeSettings(); | 414 | m_actionCollection->writeSettings(); | ||
407 | emit changed(true); | | |||
408 | } | | |||
409 | 415 | | |||
410 | void KWinTabBoxConfig::updateUiFromConfig(KWinTabBoxConfigForm *ui, const KWin::TabBox::TabBoxSettings *config) | 416 | KCModule::defaults(); | ||
411 | { | 417 | updateUnmanagedState(); | ||
412 | #define CONFIGURE(SETTING, MODE, IS, VALUE) ui->SETTING->setChecked(config->MODE##Mode() IS TabBoxConfig::VALUE) | | |||
413 | CONFIGURE(filterDesktops, desktop, !=, AllDesktopsClients); | | |||
414 | CONFIGURE(currentDesktop, desktop, ==, OnlyCurrentDesktopClients); | | |||
415 | CONFIGURE(otherDesktops, desktop, ==, ExcludeCurrentDesktopClients); | | |||
416 | CONFIGURE(filterActivities, activities, !=, AllActivitiesClients); | | |||
417 | CONFIGURE(currentActivity, activities, ==, OnlyCurrentActivityClients); | | |||
418 | CONFIGURE(otherActivities, activities, ==, ExcludeCurrentActivityClients); | | |||
419 | CONFIGURE(filterScreens, multiScreen, !=, IgnoreMultiScreen); | | |||
420 | CONFIGURE(currentScreen, multiScreen, ==, OnlyCurrentScreenClients); | | |||
421 | CONFIGURE(otherScreens, multiScreen, ==, ExcludeCurrentScreenClients); | | |||
422 | CONFIGURE(oneAppWindow, applications, ==, OneWindowPerApplication); | | |||
423 | CONFIGURE(filterMinimization, minimized, !=, IgnoreMinimizedStatus); | | |||
424 | CONFIGURE(visibleWindows, minimized, ==, ExcludeMinimizedClients); | | |||
425 | CONFIGURE(hiddenWindows, minimized, ==, OnlyMinimizedClients); | | |||
426 | | ||||
427 | ui->switchingModeCombo->setCurrentIndex(config->switchingMode()); | | |||
428 | | ||||
429 | // check boxes | | |||
430 | ui->showTabBox->setChecked(config->showTabBox()); | | |||
431 | ui->highlightWindowCheck->setChecked(config->highlightWindows()); | | |||
432 | ui->effectCombo->setCurrentIndex(ui->effectCombo->findData(config->layoutName())); | | |||
433 | CONFIGURE(showDesktop, showDesktop, ==, ShowDesktopClient); | | |||
434 | #undef CONFIGURE | | |||
435 | } | 418 | } | ||
436 | 419 | | |||
437 | void KWinTabBoxConfig::updateConfigFromUi(const KWin::KWinTabBoxConfigForm *ui, TabBoxSettings *config) | 420 | void KWinTabBoxConfig::updateUiFromConfig(KWinTabBoxConfigForm *ui, const KWin::TabBox::TabBoxSettings *config) | ||
438 | { | 421 | { | ||
439 | if (ui->filterDesktops->isChecked()) { | 422 | ui->setFilterScreen(static_cast<TabBoxConfig::ClientMultiScreenMode>(config->multiScreenMode())); | ||
440 | config->setDesktopMode(ui->currentDesktop->isChecked() ? TabBoxConfig::OnlyCurrentDesktopClients : TabBoxConfig::ExcludeCurrentDesktopClients); | 423 | ui->setFilterDesktop(static_cast<TabBoxConfig::ClientDesktopMode>(config->desktopMode())); | ||
441 | } else { | 424 | ui->setFilterActivities(static_cast<TabBoxConfig::ClientActivitiesMode>(config->activitiesMode())); | ||
442 | config->setDesktopMode(TabBoxConfig::AllDesktopsClients); | 425 | ui->setFilterMinimization(static_cast<TabBoxConfig::ClientMinimizedMode>(config->minimizedMode())); | ||
443 | } | | |||
444 | if (ui->filterActivities->isChecked()) { | | |||
445 | config->setActivitiesMode(ui->currentActivity->isChecked() ? TabBoxConfig::OnlyCurrentActivityClients : TabBoxConfig::ExcludeCurrentActivityClients); | | |||
446 | } else { | | |||
447 | config->setActivitiesMode(TabBoxConfig::AllActivitiesClients); | | |||
448 | } | | |||
449 | if (ui->filterScreens->isChecked()) { | | |||
450 | config->setMultiScreenMode(ui->currentScreen->isChecked() ? TabBoxConfig::OnlyCurrentScreenClients : TabBoxConfig::ExcludeCurrentScreenClients); | | |||
451 | } else { | | |||
452 | config->setMultiScreenMode(TabBoxConfig::IgnoreMultiScreen); | | |||
453 | } | | |||
454 | config->setApplicationsMode(ui->oneAppWindow->isChecked() ? TabBoxConfig::OneWindowPerApplication : TabBoxConfig::AllWindowsAllApplications); | | |||
455 | if (ui->filterMinimization->isChecked()) { | | |||
456 | config->setMinimizedMode(ui->visibleWindows->isChecked() ? TabBoxConfig::ExcludeMinimizedClients : TabBoxConfig::OnlyMinimizedClients); | | |||
457 | } else { | | |||
458 | config->setMinimizedMode(TabBoxConfig::IgnoreMinimizedStatus); | | |||
459 | } | | |||
460 | 426 | | |||
461 | config->setSwitchingMode(TabBoxConfig::ClientSwitchingMode(ui->switchingModeCombo->currentIndex())); | 427 | ui->setApplicationMode(static_cast<TabBoxConfig::ClientApplicationsMode>(config->applicationsMode())); | ||
428 | ui->setShowDesktopMode(static_cast<TabBoxConfig::ShowDesktopMode>(config->showDesktopMode())); | ||||
462 | 429 | | |||
463 | config->setShowTabBox(ui->showTabBox->isChecked()); | 430 | ui->setSwitchingModeChanged(static_cast<TabBoxConfig::ClientSwitchingMode>(config->switchingMode())); | ||
464 | config->setHighlightWindows(ui->highlightWindowCheck->isChecked()); | | |||
465 | if (ui->effectCombo->currentIndex() >= Layout) { | | |||
466 | config->setLayoutName(ui->effectCombo->itemData(ui->effectCombo->currentIndex()).toString()); | | |||
467 | } | | |||
468 | config->setShowDesktopMode(ui->showDesktop->isChecked() ? TabBoxConfig::ShowDesktopClient : TabBoxConfig::DoNotShowDesktopClient); | | |||
469 | } | | |||
470 | 431 | | |||
471 | #define CHECK_CURRENT_TABBOX_UI \ | 432 | ui->setLayoutName(config->layoutName()); | ||
472 | Q_ASSERT(sender());\ | | |||
473 | KWinTabBoxConfigForm *ui = nullptr;\ | | |||
474 | QObject *dad = sender();\ | | |||
475 | while (!ui && (dad = dad->parent()))\ | | |||
476 | ui = qobject_cast<KWinTabBoxConfigForm*>(dad);\ | | |||
477 | Q_ASSERT(ui); | | |||
478 | | ||||
479 | void KWinTabBoxConfig::effectSelectionChanged(int index) | | |||
480 | { | | |||
481 | CHECK_CURRENT_TABBOX_UI | | |||
482 | ui->effectConfigButton->setIcon(QIcon::fromTheme(index < Layout ? "configure" : "view-preview")); | | |||
483 | if (!ui->showTabBox->isChecked()) | | |||
484 | return; | | |||
485 | ui->highlightWindowCheck->setEnabled(index >= Layout); | | |||
486 | } | 433 | } | ||
487 | 434 | | |||
488 | void KWinTabBoxConfig::tabBoxToggled(bool on) | 435 | void KWinTabBoxConfig::configureEffectClicked() | ||
489 | { | 436 | { | ||
490 | CHECK_CURRENT_TABBOX_UI | 437 | Q_ASSERT(sender()); | ||
491 | on = !on || ui->effectCombo->currentIndex() >= Layout; | 438 | KWinTabBoxConfigForm *ui = nullptr; | ||
Oops, should be form->layoutName() instead, otherwise it won't save the new layout. crossi: Oops, should be `form->layoutName()` instead, otherwise it won't save the new layout. | |||||
492 | ui->highlightWindowCheck->setEnabled(on); | 439 | QObject *dad = sender(); | ||
ervin: `dad` that's cute :-) | |||||
zzag: Heh, we have a variable somewhere in KWin core called "daddy". :D | |||||
493 | emit changed(); | 440 | while (!ui && (dad = dad->parent())) { | ||
What!? dad isn't my dad? It's my grand-dad? Or wait my grand-grand-daddy? This is gross. Clearly it's a complicated family with dark secrets. ;-) What about calling it ancestor? ervin: What!? `dad` isn't my dad? It's my grand-dad? Or wait my grand-grand-daddy? This is gross. | |||||
441 | ui = qobject_cast<KWinTabBoxConfigForm *>(dad); | ||||
494 | } | 442 | } | ||
443 | Q_ASSERT(ui); | ||||
495 | 444 | | |||
Too bad you lost the Q_ASSERT(form) in the process. It's all the more important now that we're using the evil sender(). :-) Could we please have the assert back? ervin: Too bad you lost the Q_ASSERT(form) in the process. It's all the more important now that we're… | |||||
496 | void KWinTabBoxConfig::configureEffectClicked() | | |||
497 | { | | |||
498 | CHECK_CURRENT_TABBOX_UI | | |||
499 | 445 | | |||
500 | const int effect = ui->effectCombo->currentIndex(); | 446 | if (ui->effectCombo->currentData(KWinTabBoxConfigForm::AddonEffect).toBool()) { | ||
501 | if (effect >= Layout) { | 447 | // Show the preview for addon effect | ||
502 | // TODO: here we need to show the preview | 448 | new LayoutPreview(ui->effectCombo->currentData(KWinTabBoxConfigForm::LayoutPath).toString(), this); | ||
503 | new LayoutPreview(ui->effectCombo->itemData(effect, Qt::UserRole+1).toString(), this); | | |||
504 | } else { | 449 | } else { | ||
Could we maybe drop ancestor? e.g. auto form = qobject_cast<KWinTabBoxConfigForm *>(sender()); zzag: Could we maybe drop `ancestor`? e.g.
```lang=cpp
auto form = qobject_cast<KWinTabBoxConfigForm… | |||||
450 | // For builtin effect, display a configuration dialog | ||||
meven: s/dispplay/display | |||||
505 | QPointer<QDialog> configDialog = new QDialog(this); | 451 | QPointer<QDialog> configDialog = new QDialog(this); | ||
506 | configDialog->setLayout(new QVBoxLayout); | 452 | configDialog->setLayout(new QVBoxLayout); | ||
507 | configDialog->setWindowTitle(ui->effectCombo->currentText()); | 453 | configDialog->setWindowTitle(ui->effectCombo->currentText()); | ||
508 | QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::RestoreDefaults, configDialog); | 454 | QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok|QDialogButtonBox::Cancel|QDialogButtonBox::RestoreDefaults, configDialog); | ||
509 | connect(buttonBox, SIGNAL(accepted()), configDialog, SLOT(accept())); | 455 | connect(buttonBox, SIGNAL(accepted()), configDialog, SLOT(accept())); | ||
510 | connect(buttonBox, SIGNAL(rejected()), configDialog, SLOT(reject())); | 456 | connect(buttonBox, SIGNAL(rejected()), configDialog, SLOT(reject())); | ||
511 | 457 | | |||
512 | const QString name = BuiltInEffects::nameForEffect(effect == CoverSwitch ? BuiltInEffect::CoverSwitch : BuiltInEffect::FlipSwitch); | 458 | const QString name = ui->effectCombo->currentData().toString(); | ||
513 | | ||||
514 | KCModule *kcm = KPluginTrader::createInstanceFromQuery<KCModule>(QStringLiteral("kwin/effects/configs/"), QString(), | 459 | KCModule *kcm = KPluginTrader::createInstanceFromQuery<KCModule>(QStringLiteral("kwin/effects/configs/"), QString(), | ||
515 | QStringLiteral("'%1' in [X-KDE-ParentComponents]").arg(name), | 460 | QStringLiteral("'%1' in [X-KDE-ParentComponents]").arg(name), | ||
516 | configDialog); | 461 | configDialog); | ||
517 | if (!kcm) { | 462 | if (!kcm) { | ||
518 | delete configDialog; | 463 | delete configDialog; | ||
519 | return; | 464 | return; | ||
520 | } | 465 | } | ||
521 | 466 | | |||
Show All 13 Lines | |||||
535 | } | 480 | } | ||
536 | delete configDialog; | 481 | delete configDialog; | ||
537 | } | 482 | } | ||
538 | } | 483 | } | ||
539 | 484 | | |||
540 | void KWinTabBoxConfig::shortcutChanged(const QKeySequence &seq) | 485 | void KWinTabBoxConfig::shortcutChanged(const QKeySequence &seq) | ||
541 | { | 486 | { | ||
542 | QString action; | 487 | QString action; | ||
543 | if (sender()) | 488 | if (sender()) { | ||
544 | action = sender()->property("shortcutAction").toString(); | 489 | action = sender()->property("shortcutAction").toString(); | ||
545 | if (action.isEmpty()) | 490 | } | ||
491 | if (action.isEmpty()) { | ||||
546 | return; | 492 | return; | ||
493 | } | ||||
547 | QAction *a = m_actionCollection->action(action); | 494 | QAction *a = m_actionCollection->action(action); | ||
548 | KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << seq, KGlobalAccel::NoAutoloading); | 495 | KGlobalAccel::self()->setShortcut(a, QList<QKeySequence>() << seq, KGlobalAccel::NoAutoloading); | ||
549 | m_actionCollection->writeSettings(); | 496 | m_actionCollection->writeSettings(); | ||
550 | } | 497 | } | ||
551 | 498 | | |||
552 | void KWinTabBoxConfig::slotGHNS() | 499 | void KWinTabBoxConfig::slotGHNS() | ||
553 | { | 500 | { | ||
554 | QPointer<KNS3::DownloadDialog> downloadDialog = new KNS3::DownloadDialog("kwinswitcher.knsrc", this); | 501 | QPointer<KNS3::DownloadDialog> downloadDialog = new KNS3::DownloadDialog("kwinswitcher.knsrc", this); | ||
Show All 11 Lines |
Too bad we have to use old syntax for private slots