action for dashboard toggle
This commit is contained in:
parent
70cef22211
commit
f654bf31eb
@ -27,6 +27,7 @@
|
|||||||
#include <QQmlContext>
|
#include <QQmlContext>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
|
#include <KActionCollection>
|
||||||
#include <KLocalizedString>
|
#include <KLocalizedString>
|
||||||
#include <Plasma/Package>
|
#include <Plasma/Package>
|
||||||
#include <Plasma/PluginLoader>
|
#include <Plasma/PluginLoader>
|
||||||
@ -95,6 +96,16 @@ ShellCorona::ShellCorona(QObject *parent)
|
|||||||
connect(d->scriptEngine, &WorkspaceScripting::ScriptEngine::print,
|
connect(d->scriptEngine, &WorkspaceScripting::ScriptEngine::print,
|
||||||
this, &ShellCorona::printScriptMessage);
|
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()
|
ShellCorona::~ShellCorona()
|
||||||
@ -417,6 +428,11 @@ void ShellCorona::syncAppConfig()
|
|||||||
applicationConfig()->sync();
|
applicationConfig()->sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ShellCorona::toggleDashboard()
|
||||||
|
{
|
||||||
|
qDebug() << "TODO: Toggling dashboard view";
|
||||||
|
}
|
||||||
|
|
||||||
void ShellCorona::printScriptError(const QString &error)
|
void ShellCorona::printScriptError(const QString &error)
|
||||||
{
|
{
|
||||||
qWarning() << error;
|
qWarning() << error;
|
||||||
|
@ -120,6 +120,7 @@ private Q_SLOTS:
|
|||||||
void handleContainmentAdded(Plasma::Containment *c);
|
void handleContainmentAdded(Plasma::Containment *c);
|
||||||
void showWidgetExplorer();
|
void showWidgetExplorer();
|
||||||
void syncAppConfig();
|
void syncAppConfig();
|
||||||
|
void toggleDashboard();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class Private;
|
class Private;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user