action for dashboard toggle

This commit is contained in:
Marco Martin 2013-09-16 17:17:57 +02:00
parent 70cef22211
commit f654bf31eb
2 changed files with 17 additions and 0 deletions

View File

@ -27,6 +27,7 @@
#include <QQmlContext>
#include <QTimer>
#include <KActionCollection>
#include <KLocalizedString>
#include <Plasma/Package>
#include <Plasma/PluginLoader>
@ -95,6 +96,16 @@ ShellCorona::ShellCorona(QObject *parent)
connect(d->scriptEngine, &WorkspaceScripting::ScriptEngine::print,
this, &ShellCorona::printScriptMessage);
QAction *dashboardAction = actions()->add<QAction>("show dashboard");
QObject::connect(dashboardAction, &QAction::triggered,
this, &ShellCorona::toggleDashboard);
dashboardAction->setText(i18n("Show Dashboard"));
dashboardAction->setAutoRepeat(true);
dashboardAction->setIcon(QIcon::fromTheme("dashboard-show"));
dashboardAction->setData(Plasma::Types::ControlAction);
dashboardAction->setShortcut(QKeySequence("ctrl+f12"));
dashboardAction->setShortcutContext(Qt::ApplicationShortcut);
}
ShellCorona::~ShellCorona()
@ -417,6 +428,11 @@ void ShellCorona::syncAppConfig()
applicationConfig()->sync();
}
void ShellCorona::toggleDashboard()
{
qDebug() << "TODO: Toggling dashboard view";
}
void ShellCorona::printScriptError(const QString &error)
{
qWarning() << error;

View File

@ -120,6 +120,7 @@ private Q_SLOTS:
void handleContainmentAdded(Plasma::Containment *c);
void showWidgetExplorer();
void syncAppConfig();
void toggleDashboard();
private:
class Private;