Commit 90aec32f authored by Martin Flöser's avatar Martin Flöser
Browse files

Add walk through desktops shortcuts to Virtual Desktops KCM

BUG: 306404
FIXED-IN: 4.11
REVIEW: 108287
parent 366ea1e7
......@@ -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
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment