parent
3881512c90
commit
741a3bc6b9
@ -1,78 +0,0 @@
|
||||
diff -Nurr plasma-workspace-5.24.90-new/containmentactions/contextmenu/menu.cpp plasma-workspace-5.24.90/containmentactions/contextmenu/menu.cpp
|
||||
--- plasma-workspace-5.24.90-new/containmentactions/contextmenu/menu.cpp 2022-05-21 16:42:05.980661922 +0200
|
||||
+++ plasma-workspace-5.24.90/containmentactions/contextmenu/menu.cpp 2022-05-21 16:47:43.503606798 +0200
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <KGlobalAccel>
|
||||
#include <KIO/CommandLauncherJob>
|
||||
#include <KLocalizedString>
|
||||
+#include <KTerminalLauncherJob>
|
||||
#include <QDebug>
|
||||
#include <QIcon>
|
||||
|
||||
@@ -29,6 +30,7 @@
|
||||
|
||||
ContextMenu::ContextMenu(QObject *parent, const QVariantList &args)
|
||||
: Plasma::ContainmentActions(parent, args)
|
||||
+ , m_runKonsoleAction(nullptr)
|
||||
, m_session(new SessionManagement(this))
|
||||
{
|
||||
}
|
||||
@@ -61,6 +63,7 @@
|
||||
<< QStringLiteral("configure shortcuts")
|
||||
<< QStringLiteral("_sep1")
|
||||
<< QStringLiteral("_context")
|
||||
+ << QStringLiteral("_run_konsole")
|
||||
<< QStringLiteral("_run_command")
|
||||
<< QStringLiteral("add widgets")
|
||||
<< QStringLiteral("_add panel")
|
||||
@@ -97,6 +100,10 @@
|
||||
m_runCommandAction->setShortcut(KGlobalAccel::self()->globalShortcut(QStringLiteral("krunner.desktop"), QStringLiteral("_launch")).value(0));
|
||||
connect(m_runCommandAction, &QAction::triggered, this, &ContextMenu::runCommand);
|
||||
|
||||
+ m_runKonsoleAction = new QAction(i18n("Konsole"), this);
|
||||
+ m_runKonsoleAction->setIcon(QIcon::fromTheme("utilities-terminal"));
|
||||
+ connect(m_runKonsoleAction, &QAction::triggered, this, &ContextMenu::runKonsole);
|
||||
+
|
||||
m_lockScreenAction = new QAction(i18nc("plasma_containmentactions_contextmenu", "Lock Screen"), this);
|
||||
m_lockScreenAction->setIcon(QIcon::fromTheme(QStringLiteral("system-lock-screen")));
|
||||
m_lockScreenAction->setShortcut(KGlobalAccel::self()->globalShortcut(QStringLiteral("ksmserver"), QStringLiteral("Lock Session")).value(0));
|
||||
@@ -179,6 +186,8 @@
|
||||
if (KAuthorized::authorizeAction(QStringLiteral("run_command")) && KAuthorized::authorize(QStringLiteral("run_command"))) {
|
||||
return m_runCommandAction;
|
||||
}
|
||||
+ } else if (name == QLatin1String("_run_konsole")) {
|
||||
+ return m_runKonsoleAction;
|
||||
} else if (name == QLatin1String("_lock_screen")) {
|
||||
if (KAuthorized::authorizeAction(QStringLiteral("lock_screen"))) {
|
||||
return m_lockScreenAction;
|
||||
@@ -212,6 +221,13 @@
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
+void ContextMenu::runKonsole()
|
||||
+{
|
||||
+ auto job = new KTerminalLauncherJob(QString());
|
||||
+ job->setWorkingDirectory(QDir::homePath());
|
||||
+ job->start();
|
||||
+}
|
||||
+
|
||||
void ContextMenu::runCommand()
|
||||
{
|
||||
if (!KAuthorized::authorizeAction(QStringLiteral("run_command"))) {
|
||||
diff -Nurr plasma-workspace-5.24.90-new/containmentactions/contextmenu/menu.h plasma-workspace-5.24.90/containmentactions/contextmenu/menu.h
|
||||
--- plasma-workspace-5.24.90-new/containmentactions/contextmenu/menu.h 2022-05-21 16:42:05.980661922 +0200
|
||||
+++ plasma-workspace-5.24.90/containmentactions/contextmenu/menu.h 2022-05-21 16:48:39.122597718 +0200
|
||||
@@ -29,11 +29,13 @@
|
||||
|
||||
public Q_SLOTS:
|
||||
void runCommand();
|
||||
+ void runKonsole();
|
||||
void startLogout();
|
||||
void configureDisplays();
|
||||
|
||||
private:
|
||||
QAction *m_runCommandAction = nullptr;
|
||||
+ QAction *m_runKonsoleAction = nullptr;
|
||||
QAction *m_lockScreenAction = nullptr;
|
||||
QAction *m_logoutAction = nullptr;
|
||||
QAction *m_configureDisplaysAction = nullptr;
|
@ -1,2 +1 @@
|
||||
SHA512 (breeze-fedora-0.2.tar.gz) = ff800e686b0dcb498f321bb94d3a8274c89c092f5408ef1ec3fc65333f046aea43444144ecaf166792f807014383af87b1180dc7540905fc10dc375309f8b2a8
|
||||
SHA512 (plasma-workspace-5.25.5.tar.xz) = 0c6cf5104b584b34a8bcb45d57069fed3b25e871fccf1bfefd47d8fc1b595867c1c4f0fcfcc0e07847534e1e77ce8ed1f3be1ac6cb7eea8669a9c7649c8466cb
|
||||
SHA512 (plasma-workspace-5.25.90.tar.xz) = 90d0a6410a22b4b25682536e80bb7d687f013a51fca1b474c7611fc3348e62c9522c5f1ef73c30a97747a4d5781eed95716d3ad61f12eb457ea74606bc565579
|
||||
|
Loading…
Reference in new issue