Commit 23d2d2f5 authored by Ivan Čukić's avatar Ivan Čukić 👁

Enabled the global shortcuts plugin by default

parent 35b1c1fe
......@@ -423,3 +423,8 @@ int main(int argc, char **argv)
}
}
QStringList Application::loadedPlugins() const
{
return d->pluginIds;
}
......@@ -58,6 +58,7 @@ public Q_SLOTS:
void quit();
QString serviceVersion() const;
bool loadPlugin(const QString &plugin);
QStringList loadedPlugins() const;
private Q_SLOTS:
void init();
......
......@@ -39,6 +39,9 @@ GlobalShortcutsPlugin::GlobalShortcutsPlugin(QObject *parent, const QVariantList
, m_actionCollection(new KActionCollection(this))
{
Q_UNUSED(args);
m_actionCollection->setComponentName("ActivityManager");
m_actionCollection->setComponentDisplayName(i18n("Activity Manager"));
}
GlobalShortcutsPlugin::~GlobalShortcutsPlugin()
......@@ -69,8 +72,6 @@ bool GlobalShortcutsPlugin::init(QHash<QString, QObject *> &modules)
m_actionCollection->readSettings();
activityRemoved();
return true;
}
......@@ -88,12 +89,12 @@ void GlobalShortcutsPlugin::activityAdded(const QString &activity)
objectNamePattern.arg(activity));
action->setText(i18nc("@action", "Switch to activity \"%1\"", activityName(activity)));
KGlobalAccel::self()->setGlobalShortcut(action, QList<QKeySequence>{});
KGlobalAccel::self()->setDefaultShortcut(action, QList<QKeySequence>{});
connect(action, SIGNAL(triggered()), m_signalMapper, SLOT(map()));
m_signalMapper->setMapping(action, activity);
m_actionCollection->writeSettings();
// m_actionCollection->writeSettings();
}
QString GlobalShortcutsPlugin::activityForAction(QAction *action) const
......
......@@ -37,7 +37,7 @@ public:
private Q_SLOTS:
void activityAdded(const QString &activity);
void activityRemoved(const QString &activity = QString());
void activityRemoved(const QString &activity);
void activityChanged(const QString &activity);
private:
......
......@@ -46,7 +46,7 @@
"Description[x-test]": "xxAdds global keyboard shortcuts for activity switchingxx",
"Description[zh_CN]": "添加活动切换的全局键盘快捷方式",
"Description[zh_TW]": "新增活動切換的全域快速鍵",
"EnabledByDefault": false,
"EnabledByDefault": true,
"Icon": "configure-shortcuts",
"Id": "org.kde.ActivityManager.GlobalShortcuts",
"License": "GPL",
......
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