summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Gräßlin <mgraesslin@kde.org>2013-01-09 07:50:58 (GMT)
committerMartin Gräßlin <mgraesslin@kde.org>2013-01-10 07:27:23 (GMT)
commit90aec32f7599add6433df98a2f77d1aaf42af9ee (patch)
tree3b12ecf6f77e8ccc1ed49bbd83443f4042cb3b97
parent366ea1e7e76f75e82209ebf412a265553451cfa0 (diff)
Add walk through desktops shortcuts to Virtual Desktops KCM
BUG: 306404 FIXED-IN: 4.11 REVIEW: 108287
-rw-r--r--kwin/kcmkwin/kwindesktop/main.cpp47
-rw-r--r--kwin/kcmkwin/kwindesktop/main.h1
2 files changed, 19 insertions, 29 deletions
diff --git a/kwin/kcmkwin/kwindesktop/main.cpp b/kwin/kcmkwin/kwindesktop/main.cpp
index 92490b1..937d780 100644
--- a/kwin/kcmkwin/kwindesktop/main.cpp
+++ b/kwin/kcmkwin/kwindesktop/main.cpp
@@ -91,35 +91,16 @@ void KWinDesktopConfig::init()
m_switchDesktopCollection->setConfigGlobal(true);
// actions for switch desktop collection - other action is filled dynamically
- KAction* a = qobject_cast<KAction*>(m_switchDesktopCollection->addAction("Switch to Next Desktop"));
- a->setProperty("isConfigurationAction", true);
- a->setText(i18n("Switch to Next Desktop"));
- a->setGlobalShortcut(KShortcut(), KAction::ActiveShortcut);
-
- a = qobject_cast<KAction*>(m_switchDesktopCollection->addAction("Switch to Previous Desktop"));
- a->setProperty("isConfigurationAction", true);
- a->setText(i18n("Switch to Previous Desktop"));
- a->setGlobalShortcut(KShortcut(), KAction::ActiveShortcut);
-
- a = qobject_cast<KAction*>(m_switchDesktopCollection->addAction("Switch One Desktop to the Right"));
- a->setProperty("isConfigurationAction", true);
- a->setText(i18n("Switch One Desktop to the Right"));
- a->setGlobalShortcut(KShortcut(), KAction::ActiveShortcut);
-
- a = qobject_cast<KAction*>(m_switchDesktopCollection->addAction("Switch One Desktop to the Left"));
- a->setProperty("isConfigurationAction", true);
- a->setText(i18n("Switch One Desktop to the Left"));
- a->setGlobalShortcut(KShortcut(), KAction::ActiveShortcut);
-
- a = qobject_cast<KAction*>(m_switchDesktopCollection->addAction("Switch One Desktop Up"));
- a->setProperty("isConfigurationAction", true);
- a->setText(i18n("Switch One Desktop Up"));
- a->setGlobalShortcut(KShortcut(), KAction::ActiveShortcut);
-
- a = qobject_cast<KAction*>(m_switchDesktopCollection->addAction("Switch One Desktop Down"));
- a->setProperty("isConfigurationAction", true);
- a->setText(i18n("Switch One Desktop Down"));
- a->setGlobalShortcut(KShortcut(), KAction::ActiveShortcut);
+ addAction("Switch to Next Desktop", i18n("Switch to Next Desktop"));
+ addAction("Switch to Previous Desktop", i18n("Switch to Previous Desktop"));
+ addAction("Switch One Desktop to the Right", i18n("Switch One Desktop to the Right"));
+ addAction("Switch One Desktop to the Left", i18n("Switch One Desktop to the Left"));
+ addAction("Switch One Desktop Up", i18n("Switch One Desktop Up"));
+ addAction("Switch One Desktop Down", i18n("Switch One Desktop Down"));
+ addAction("Walk Through Desktops", i18n("Walk Through Desktops"));
+ addAction("Walk Through Desktops (Reverse)", i18n("Walk Through Desktops (Reverse)"));
+ addAction("Walk Through Desktop List", i18n("Walk Through Desktop List"));
+ addAction("Walk Through Desktop List (Reverse)", i18n("Walk Through Desktop List (Reverse)"));
m_editor->addCollection(m_switchDesktopCollection, i18n("Desktop Switching"));
@@ -223,6 +204,14 @@ KWinDesktopConfig::~KWinDesktopConfig()
undo();
}
+void KWinDesktopConfig::addAction(const QString &name, const QString &label)
+{
+ KAction* a = qobject_cast<KAction*>(m_switchDesktopCollection->addAction(name));
+ a->setProperty("isConfigurationAction", true);
+ a->setText(label);
+ a->setGlobalShortcut(KShortcut(), KAction::ActiveShortcut);
+}
+
void KWinDesktopConfig::defaults()
{
// TODO: plasma stuff
diff --git a/kwin/kcmkwin/kwindesktop/main.h b/kwin/kcmkwin/kwindesktop/main.h
index 969e9ff..27fcba3 100644
--- a/kwin/kcmkwin/kwindesktop/main.h
+++ b/kwin/kcmkwin/kwindesktop/main.h
@@ -70,6 +70,7 @@ private slots:
private:
void init();
+ void addAction(const QString &name, const QString &label);
bool effectEnabled(const QString& effect, const KConfigGroup& cfg) const;
QString extrapolatedShortcut(int desktop) const;