Blob Blame History Raw
diff -up kdebase-workspace-4.5.0/plasma/generic/containmentactions/contextmenu/menu.cpp.plasma-konsole kdebase-workspace-4.5.0/plasma/generic/containmentactions/contextmenu/menu.cpp
--- kdebase-workspace-4.5.0/plasma/generic/containmentactions/contextmenu/menu.cpp.plasma-konsole	2010-07-28 23:04:55.000000000 +0200
+++ kdebase-workspace-4.5.0/plasma/generic/containmentactions/contextmenu/menu.cpp	2010-08-06 10:25:07.409329979 +0200
@@ -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),
@@ -77,8 +79,8 @@ void ContextMenu::init(const KConfigGrou
         defaultEnabled << true << true << true << true << true;
     } else {
         //FIXME ugly code!
-        m_allActions << "_context" << "_run_command" << "add widgets" << "_add panel" << "add sibling containment" << "manage activities" << "remove" << "lock widgets" << "_sep1" << "_lock_screen" << "_logout" << "_sep2" << "configure" << "configure shortcuts" << "_sep3" << "_wallpaper";
-        defaultEnabled << true << true << true << true << false << true << true << true << true << true << true << true << true << false << true << true;
+        m_allActions << "_context" << "_run_konsole" << "_run_command" << "add widgets" << "_add panel" << "add sibling containment" << "manage activities" << "remove" << "lock widgets" << "_sep1" << "_lock_screen" << "_logout" << "_sep2" << "configure" << "configure shortcuts" << "_sep3" << "_wallpaper";
+        defaultEnabled << true << true << true << true << true << false << true << true << true << true << true << true << true << true << false << true << true;
     }
 
     for (int i = 0; i < m_allActions.count(); ++i) {
@@ -95,6 +97,10 @@ void ContextMenu::init(const KConfigGrou
         //panel does its own config action atm... FIXME how do I fit it in properly?
         //can I do something with configureRequested? damn privateslot...
     } else {
+        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()));
@@ -179,6 +185,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;
@@ -202,6 +210,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 kdebase-workspace-4.5.0/plasma/generic/containmentactions/contextmenu/menu.h.plasma-konsole kdebase-workspace-4.5.0/plasma/generic/containmentactions/contextmenu/menu.h
--- kdebase-workspace-4.5.0/plasma/generic/containmentactions/contextmenu/menu.h.plasma-konsole	2010-02-03 09:50:02.000000000 +0100
+++ kdebase-workspace-4.5.0/plasma/generic/containmentactions/contextmenu/menu.h	2010-08-06 10:21:11.871329425 +0200
@@ -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;