action for dashboard toggle
This commit is contained in:
parent
70cef22211
commit
f654bf31eb
@ -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;
|
||||
|
@ -120,6 +120,7 @@ private Q_SLOTS:
|
||||
void handleContainmentAdded(Plasma::Containment *c);
|
||||
void showWidgetExplorer();
|
||||
void syncAppConfig();
|
||||
void toggleDashboard();
|
||||
|
||||
private:
|
||||
class Private;
|
||||
|
Loading…
x
Reference in New Issue
Block a user