diff --git a/effects/invert/invert_config.cpp b/effects/invert/invert_config.cpp index 01bd05051..efd53e1a8 100644 --- a/effects/invert/invert_config.cpp +++ b/effects/invert/invert_config.cpp @@ -1,107 +1,107 @@ /******************************************************************** KWin - the KDE window manager This file is part of the KDE project. Copyright (C) 2007 Rivo Laks This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ #include "invert_config.h" #include #include #include #include #include #include #include #include #include K_PLUGIN_FACTORY_WITH_JSON(InvertEffectConfigFactory, "invert_config.json", registerPlugin();) namespace KWin { InvertEffectConfig::InvertEffectConfig(QWidget* parent, const QVariantList& args) : KCModule(KAboutData::pluginData(QStringLiteral("invert")), parent, args) { QVBoxLayout* layout = new QVBoxLayout(this); // Shortcut config. The shortcut belongs to the component "kwin"! KActionCollection *actionCollection = new KActionCollection(this, QStringLiteral("kwin")); actionCollection->setComponentDisplayName(i18n("KWin")); QAction* a = actionCollection->addAction(QStringLiteral("Invert")); a->setText(i18n("Toggle Invert Effect")); a->setProperty("isConfigurationAction", true); KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::CTRL + Qt::META + Qt::Key_I); KGlobalAccel::self()->setShortcut(a, QList() << Qt::CTRL + Qt::META + Qt::Key_I); QAction* b = actionCollection->addAction(QStringLiteral("InvertWindow")); b->setText(i18n("Toggle Invert Effect on Window")); b->setProperty("isConfigurationAction", true); KGlobalAccel::self()->setDefaultShortcut(b, QList() << Qt::CTRL + Qt::META + Qt::Key_U); KGlobalAccel::self()->setShortcut(b, QList() << Qt::CTRL + Qt::META + Qt::Key_U); mShortcutEditor = new KShortcutsEditor(actionCollection, this, KShortcutsEditor::GlobalAction, KShortcutsEditor::LetterShortcutsDisallowed); - connect(mShortcutEditor, &KShortcutsEditor::keyChange, this, qOverload<>(&InvertEffectConfig::changed)); + connect(mShortcutEditor, &KShortcutsEditor::keyChange, this, &InvertEffectConfig::markAsChanged); layout->addWidget(mShortcutEditor); load(); } InvertEffectConfig::~InvertEffectConfig() { // Undo (only) unsaved changes to global key shortcuts mShortcutEditor->undoChanges(); } void InvertEffectConfig::load() { KCModule::load(); emit changed(false); } void InvertEffectConfig::save() { KCModule::save(); mShortcutEditor->save(); // undo() will restore to this state from now on emit changed(false); OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.KWin"), QStringLiteral("/Effects"), QDBusConnection::sessionBus()); interface.reconfigureEffect(QStringLiteral("invert")); } void InvertEffectConfig::defaults() { mShortcutEditor->allDefault(); emit changed(true); } } // namespace #include "invert_config.moc" diff --git a/effects/lookingglass/lookingglass_config.cpp b/effects/lookingglass/lookingglass_config.cpp index 494083dc4..b802ae27f 100644 --- a/effects/lookingglass/lookingglass_config.cpp +++ b/effects/lookingglass/lookingglass_config.cpp @@ -1,119 +1,119 @@ /******************************************************************** KWin - the KDE window manager This file is part of the KDE project. Copyright (C) 2007 Christian Nitschkowski This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ #include "lookingglass_config.h" // KConfigSkeleton #include "lookingglassconfig.h" #include #include #include #include #include #include #include #include #include #include #include #include K_PLUGIN_FACTORY_WITH_JSON(LookingGlassEffectConfigFactory, "lookingglass_config.json", registerPlugin();) namespace KWin { LookingGlassEffectConfigForm::LookingGlassEffectConfigForm(QWidget* parent) : QWidget(parent) { setupUi(this); } LookingGlassEffectConfig::LookingGlassEffectConfig(QWidget* parent, const QVariantList& args) : KCModule(KAboutData::pluginData(QStringLiteral("lookingglass")), parent, args) { m_ui = new LookingGlassEffectConfigForm(this); QVBoxLayout* layout = new QVBoxLayout(this); layout->addWidget(m_ui); LookingGlassConfig::instance(KWIN_CONFIG); addConfig(LookingGlassConfig::self(), m_ui); - connect(m_ui->editor, &KShortcutsEditor::keyChange, this, qOverload<>(&LookingGlassEffectConfig::changed)); + connect(m_ui->editor, &KShortcutsEditor::keyChange, this, &LookingGlassEffectConfig::markAsChanged); // Shortcut config. The shortcut belongs to the component "kwin"! m_actionCollection = new KActionCollection(this, QStringLiteral("kwin")); m_actionCollection->setComponentDisplayName(i18n("KWin")); m_actionCollection->setConfigGroup(QStringLiteral("LookingGlass")); m_actionCollection->setConfigGlobal(true); QAction* a; a = m_actionCollection->addAction(KStandardAction::ZoomIn); a->setProperty("isConfigurationAction", true); KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_Equal); KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_Equal); a = m_actionCollection->addAction(KStandardAction::ZoomOut); a->setProperty("isConfigurationAction", true); KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_Minus); KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_Minus); a = m_actionCollection->addAction(KStandardAction::ActualSize); a->setProperty("isConfigurationAction", true); KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_0); KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_0); m_ui->editor->addCollection(m_actionCollection); } LookingGlassEffectConfig::~LookingGlassEffectConfig() { // Undo (only) unsaved changes to global key shortcuts m_ui->editor->undoChanges(); } void LookingGlassEffectConfig::save() { qDebug() << "Saving config of LookingGlass" ; KCModule::save(); m_ui->editor->save(); // undo() will restore to this state from now on OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.KWin"), QStringLiteral("/Effects"), QDBusConnection::sessionBus()); interface.reconfigureEffect(QStringLiteral("lookingglass")); } void LookingGlassEffectConfig::defaults() { m_ui->editor->allDefault(); KCModule::defaults(); } } // namespace #include "lookingglass_config.moc" diff --git a/effects/magnifier/magnifier_config.cpp b/effects/magnifier/magnifier_config.cpp index 93dc8c13d..a5e77ef0d 100644 --- a/effects/magnifier/magnifier_config.cpp +++ b/effects/magnifier/magnifier_config.cpp @@ -1,120 +1,120 @@ /******************************************************************** KWin - the KDE window manager This file is part of the KDE project. Copyright (C) 2007 Christian Nitschkowski This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ #include "magnifier_config.h" // KConfigSkeleton #include "magnifierconfig.h" #include #include #include #include #include #include #include #include #include #include #include #include K_PLUGIN_FACTORY_WITH_JSON(MagnifierEffectConfigFactory, "magnifier_config.json", registerPlugin();) namespace KWin { MagnifierEffectConfigForm::MagnifierEffectConfigForm(QWidget* parent) : QWidget(parent) { setupUi(this); } MagnifierEffectConfig::MagnifierEffectConfig(QWidget* parent, const QVariantList& args) : KCModule(KAboutData::pluginData(QStringLiteral("magnifier")), parent, args) { m_ui = new MagnifierEffectConfigForm(this); QVBoxLayout* layout = new QVBoxLayout(this); layout->addWidget(m_ui); MagnifierConfig::instance(KWIN_CONFIG); addConfig(MagnifierConfig::self(), m_ui); - connect(m_ui->editor, &KShortcutsEditor::keyChange, this, qOverload<>(&MagnifierEffectConfig::changed)); + connect(m_ui->editor, &KShortcutsEditor::keyChange, this, &MagnifierEffectConfig::markAsChanged); // Shortcut config. The shortcut belongs to the component "kwin"! m_actionCollection = new KActionCollection(this, QStringLiteral("kwin")); m_actionCollection->setComponentDisplayName(i18n("KWin")); m_actionCollection->setConfigGroup(QStringLiteral("Magnifier")); m_actionCollection->setConfigGlobal(true); QAction* a; a = m_actionCollection->addAction(KStandardAction::ZoomIn); a->setProperty("isConfigurationAction", true); KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_Equal); KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_Equal); a = m_actionCollection->addAction(KStandardAction::ZoomOut); a->setProperty("isConfigurationAction", true); KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_Minus); KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_Minus); a = m_actionCollection->addAction(KStandardAction::ActualSize); a->setProperty("isConfigurationAction", true); KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::META + Qt::Key_0); KGlobalAccel::self()->setShortcut(a, QList() << Qt::META + Qt::Key_0); m_ui->editor->addCollection(m_actionCollection); load(); } MagnifierEffectConfig::~MagnifierEffectConfig() { // Undo (only) unsaved changes to global key shortcuts m_ui->editor->undoChanges(); } void MagnifierEffectConfig::save() { qDebug() << "Saving config of Magnifier" ; m_ui->editor->save(); // undo() will restore to this state from now on KCModule::save(); OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.KWin"), QStringLiteral("/Effects"), QDBusConnection::sessionBus()); interface.reconfigureEffect(QStringLiteral("magnifier")); } void MagnifierEffectConfig::defaults() { m_ui->editor->allDefault(); KCModule::defaults(); } } // namespace #include "magnifier_config.moc" diff --git a/effects/showpaint/showpaint_config.cpp b/effects/showpaint/showpaint_config.cpp index db45a161f..6094299fa 100644 --- a/effects/showpaint/showpaint_config.cpp +++ b/effects/showpaint/showpaint_config.cpp @@ -1,87 +1,87 @@ /******************************************************************** KWin - the KDE window manager This file is part of the KDE project. Copyright (C) 2018 Vlad Zahorodnii This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ #include "showpaint_config.h" #include #include #include #include #include #include #include K_PLUGIN_FACTORY_WITH_JSON(ShowPaintEffectConfigFactory, "showpaint_config.json", registerPlugin();) namespace KWin { ShowPaintEffectConfig::ShowPaintEffectConfig(QWidget *parent, const QVariantList &args) : KCModule(KAboutData::pluginData(QStringLiteral("showpaint")), parent, args) , m_ui(new Ui::ShowPaintEffectConfig) { m_ui->setupUi(this); auto *actionCollection = new KActionCollection(this, QStringLiteral("kwin")); actionCollection->setComponentDisplayName(i18n("KWin")); actionCollection->setConfigGroup(QStringLiteral("ShowPaint")); actionCollection->setConfigGlobal(true); QAction *toggleAction = actionCollection->addAction(QStringLiteral("Toggle")); toggleAction->setText(i18n("Toggle Show Paint")); toggleAction->setProperty("isConfigurationAction", true); KGlobalAccel::self()->setDefaultShortcut(toggleAction, {}); KGlobalAccel::self()->setShortcut(toggleAction, {}); m_ui->shortcutsEditor->addCollection(actionCollection); connect(m_ui->shortcutsEditor, &KShortcutsEditor::keyChange, - this, qOverload<>(&ShowPaintEffectConfig::changed)); + this, &ShowPaintEffectConfig::markAsChanged); load(); } ShowPaintEffectConfig::~ShowPaintEffectConfig() { // If save() is called, undoChanges() has no effect. m_ui->shortcutsEditor->undoChanges(); delete m_ui; } void ShowPaintEffectConfig::save() { KCModule::save(); m_ui->shortcutsEditor->save(); } void ShowPaintEffectConfig::defaults() { m_ui->shortcutsEditor->allDefault(); KCModule::defaults(); } } // namespace KWin #include "showpaint_config.moc" diff --git a/effects/windowgeometry/windowgeometry_config.cpp b/effects/windowgeometry/windowgeometry_config.cpp index b2b58417e..20bd7c83b 100644 --- a/effects/windowgeometry/windowgeometry_config.cpp +++ b/effects/windowgeometry/windowgeometry_config.cpp @@ -1,95 +1,95 @@ /******************************************************************** KWin - the KDE window manager This file is part of the KDE project. Copyright (C) 2010 Thomas Lübking This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . *********************************************************************/ #include "windowgeometry_config.h" // KConfigSkeleton #include "windowgeometryconfig.h" #include #include #include #include #include #include #include #include #include K_PLUGIN_FACTORY_WITH_JSON(WindowGeometryEffectConfigFactory, "windowgeometry_config.json", registerPlugin();) namespace KWin { WindowGeometryConfigForm::WindowGeometryConfigForm(QWidget* parent) : QWidget(parent) { setupUi(this); } WindowGeometryConfig::WindowGeometryConfig(QWidget* parent, const QVariantList& args) : KCModule(KAboutData::pluginData(QStringLiteral("windowgeometry")), parent, args) { WindowGeometryConfiguration::instance(KWIN_CONFIG); QVBoxLayout* layout = new QVBoxLayout(this); layout->addWidget(myUi = new WindowGeometryConfigForm(this)); // Shortcut config. The shortcut belongs to the component "kwin"! myActionCollection = new KActionCollection(this, QStringLiteral("kwin")); myActionCollection->setComponentDisplayName(i18n("KWin")); QAction* a = myActionCollection->addAction(QStringLiteral("WindowGeometry")); a->setText(i18n("Toggle KWin composited geometry display")); a->setProperty("isConfigurationAction", true); KGlobalAccel::self()->setDefaultShortcut(a, QList() << Qt::CTRL + Qt::SHIFT + Qt::Key_F11); KGlobalAccel::self()->setShortcut(a, QList() << Qt::CTRL + Qt::SHIFT + Qt::Key_F11); myUi->shortcuts->addCollection(myActionCollection); - connect(myUi->shortcuts, &KShortcutsEditor::keyChange, this, qOverload<>(&WindowGeometryConfig::changed)); + connect(myUi->shortcuts, &KShortcutsEditor::keyChange, this, &WindowGeometryConfig::markAsChanged); addConfig(WindowGeometryConfiguration::self(), myUi); load(); } WindowGeometryConfig::~WindowGeometryConfig() { // Undo (only) unsaved changes to global key shortcuts myUi->shortcuts->undoChanges(); } void WindowGeometryConfig::save() { KCModule::save(); myUi->shortcuts->save(); // undo() will restore to this state from now on OrgKdeKwinEffectsInterface interface(QStringLiteral("org.kde.KWin"), QStringLiteral("/Effects"), QDBusConnection::sessionBus()); interface.reconfigureEffect(QStringLiteral("windowgeometry")); } void WindowGeometryConfig::defaults() { myUi->shortcuts->allDefault(); emit changed(true); } } //namespace #include "windowgeometry_config.moc"