summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Andriot <francois.andriot@free.fr>2013-05-09 18:58:29 +0200
committerSlávek Banko <slavek.banko@axis.cz>2013-05-09 18:58:29 +0200
commit18e3729805b1629bea80433ad3b912949123b304 (patch)
tree7a931f4dfc3c6892b5bbe36d62ac4f83354b2208
parentc58d6f5099d45738c33536f593240917bb0189fc (diff)
downloadtdebase-18e3729805b1629bea80433ad3b912949123b304.tar.gz
tdebase-18e3729805b1629bea80433ad3b912949123b304.zip
Kickoff menu: Adds 'kcontrol' and 'run command' in 'computer' tab
-rw-r--r--kicker/kicker/ui/k_new_mnu.cpp26
-rw-r--r--kicker/kicker/ui/k_new_mnu.h1
2 files changed, 24 insertions, 3 deletions
diff --git a/kicker/kicker/ui/k_new_mnu.cpp b/kicker/kicker/ui/k_new_mnu.cpp
index 4e61f8eca..1c9c0f9e2 100644
--- a/kicker/kicker/ui/k_new_mnu.cpp
+++ b/kicker/kicker/ui/k_new_mnu.cpp
@@ -1342,11 +1342,15 @@ void KMenu::insertStaticItems()
m_systemView->insertSeparator( nId++, i18n("Applications"), index++);
- KService::Ptr p = KService::serviceByStorageId("/usr/share/applications/YaST.desktop");
+ KService::Ptr p = KService::serviceByStorageId("KControl.desktop");
m_systemView->insertMenuItem(p, nId++, index++);
- m_systemView->insertItem( "info", i18n( "System Information" ),
- "sysinfo:/", "sysinfo:/", nId++, index++ );
+ // run command
+ if (kapp->authorize("run_command"))
+ {
+ m_systemView->insertItem( "run", i18n("Run Command..."),
+ "", "kicker:/runusercommand", nId++, index++ );
+ }
m_systemView->insertSeparator( nId++, i18n("System Folders"), index++ );
@@ -2600,6 +2604,10 @@ void KMenu::slotStartURL(const TQString& u)
{
runCommand();
}
+ else if ( u == "kicker:/runusercommand" )
+ {
+ runUserCommand();
+ }
else if ( u == "kicker:/shutdown" ) {
#ifdef KDELIBS_SUSE
TQByteArray params;
@@ -3796,4 +3804,16 @@ void KMenu::slotSuspend(int id)
}
+void KMenu::runUserCommand()
+{
+ TQByteArray data;
+ TQCString appname( "kdesktop" );
+ if ( kicker_screen_number )
+ appname.sprintf("kdesktop-screen-%d", kicker_screen_number);
+
+ kapp->updateRemoteUserTimestamp( appname );
+ kapp->dcopClient()->send( appname, "KDesktopIface",
+ "popupExecuteCommand()", data );
+}
+
// vim:cindent:sw=4:
diff --git a/kicker/kicker/ui/k_new_mnu.h b/kicker/kicker/ui/k_new_mnu.h
index 6dff75feb..6bd969f99 100644
--- a/kicker/kicker/ui/k_new_mnu.h
+++ b/kicker/kicker/ui/k_new_mnu.h
@@ -181,6 +181,7 @@ protected:
// void raiseStackWidget(TQWidget *view);
bool runCommand();
+ void runUserCommand();
void setupUi();