diff -up kde-workspace-4.9.90/plasma/generic/containmentactions/contextmenu/menu.cpp.plasma-konsole kde-workspace-4.9.90/plasma/generic/containmentactions/contextmenu/menu.cpp
--- kde-workspace-4.9.90/plasma/generic/containmentactions/contextmenu/menu.cpp.plasma-konsole 2012-11-14 10:06:18.000000000 -0600
+++ kde-workspace-4.9.90/plasma/generic/containmentactions/contextmenu/menu.cpp 2012-12-03 17:01:20.403223435 -0600
@@ -30,6 +30,7 @@
#include <KDebug>
#include <KIcon>
#include <KMenu>
+#include <ktoolinvocation.h>
#include <Plasma/Containment>
#include <Plasma/Corona>
@@ -46,6 +47,7 @@
ContextMenu::ContextMenu(QObject *parent, const QVariantList &args)
: Plasma::ContainmentActions(parent, args),
+ m_runKonsoleAction(0),
m_runCommandAction(0),
m_lockScreenAction(0),
m_logoutAction(0),
@@ -74,7 +76,7 @@ void ContextMenu::init(const KConfigGrou
m_actionOrder << "add widgets" << "_add panel" << "lock widgets" << "_context" << "remove";
} else {
actions.insert("configure shortcuts", false);
- m_actionOrder << "_context" << "_run_command" << "add widgets" << "_add panel"
+ m_actionOrder << "_context" << "_run_konsole" << "_run_command" << "add widgets" << "_add panel"
<< "manage activities" << "remove" << "lock widgets" << "_sep1"
<<"_lock_screen" << "_logout" << "_sep2" << "configure"
<< "configure shortcuts" << "_sep3" << "_wallpaper";
@@ -96,6 +98,10 @@ void ContextMenu::init(const KConfigGrou
c->containmentType() == Plasma::Containment::CustomPanelContainment) {
//FIXME: panel does its own config action atm...
} else if (!m_runCommandAction) {
+ m_runKonsoleAction = new QAction(i18n("Konsole"), this);
+ m_runKonsoleAction->setIcon(KIcon("utilities-terminal"));
+ connect(m_runKonsoleAction, SIGNAL(triggered(bool)), this, SLOT(runKonsole()));
+
m_runCommandAction = new QAction(i18n("Run Command..."), this);
m_runCommandAction->setIcon(KIcon("system-run"));
connect(m_runCommandAction, SIGNAL(triggered(bool)), this, SLOT(runCommand()));
@@ -168,6 +174,8 @@ QAction *ContextMenu::action(const QStri
if (c->corona() && c->corona()->immutability() == Plasma::Mutable) {
return c->corona()->action("add panel");
}
+ } else if (name == "_run_konsole") {
+ return m_runKonsoleAction;
} else if (name == "_run_command") {
if (KAuthorized::authorizeKAction("run_command")) {
return m_runCommandAction;
@@ -191,6 +199,11 @@ QAction *ContextMenu::action(const QStri
return 0;
}
+void ContextMenu::runKonsole()
+{
+ KToolInvocation::invokeTerminal(QString(), QDir::homePath());
+}
+
void ContextMenu::runCommand()
{
if (!KAuthorized::authorizeKAction("run_command")) {
diff -up kde-workspace-4.9.90/plasma/generic/containmentactions/contextmenu/menu.h.plasma-konsole kde-workspace-4.9.90/plasma/generic/containmentactions/contextmenu/menu.h
--- kde-workspace-4.9.90/plasma/generic/containmentactions/contextmenu/menu.h.plasma-konsole 2012-11-14 10:06:18.000000000 -0600
+++ kde-workspace-4.9.90/plasma/generic/containmentactions/contextmenu/menu.h 2012-12-03 16:59:09.172842770 -0600
@@ -41,12 +41,14 @@ public:
void save(KConfigGroup &config);
public slots:
+ void runKonsole();
void runCommand();
void lockScreen();
void startLogout();
void logout();
private:
+ QAction *m_runKonsoleAction;
QAction *m_runCommandAction;
QAction *m_lockScreenAction;
QAction *m_logoutAction;