diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-04-06 01:52:59 -0500 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2013-04-06 15:11:34 +0200 |
commit | 06f7b3b478e67358c1fcf5f2ae86b9dea83b480a (patch) | |
tree | 437d8ede28509a9080656520b8feb54b16fd5fce /khotkeys/shared | |
parent | 57949121ae0660d162374510ed0cfeec0c3cf13d (diff) | |
download | tdebase-06f7b3b478e67358c1fcf5f2ae86b9dea83b480a.tar.gz tdebase-06f7b3b478e67358c1fcf5f2ae86b9dea83b480a.zip |
Add warning messages on hot key command execution failure
(cherry picked from commit 6fd6724b2f4c1a0bed961eeb267381c7d54746c0)
Diffstat (limited to 'khotkeys/shared')
-rw-r--r-- | khotkeys/shared/actions.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/khotkeys/shared/actions.cpp b/khotkeys/shared/actions.cpp index e37ef395f..655eb977b 100644 --- a/khotkeys/shared/actions.cpp +++ b/khotkeys/shared/actions.cpp @@ -29,6 +29,7 @@ #include <kaccel.h> #include <kservice.h> #include <kprocess.h> +#include <kmessagebox.h> #include "windows.h" #include "action_data.h" @@ -153,7 +154,10 @@ void Command_url_action::execute() KService::Ptr service = KService::serviceByDesktopName( cmd ); if( service != NULL ) { - KRun::run( *service, KURL::List()); + if (!KRun::run( *service, KURL::List())) + { + KMessageBox::sorry(0, "<qt>" + i18n("KHotKeys was unable to execute") + " '" + cmd + "'<p>" + i18n("Please verify existence of the service") + "</qt>", i18n("Unable to launch service!")); + } break; } } @@ -166,11 +170,12 @@ void Command_url_action::execute() if( !KRun::runCommand( cmd + ( uri.hasArgsAndOptions() ? uri.argsAndOptions() : "" ), cmd, uri.iconName())) { - // CHECKME ? + KMessageBox::sorry(0, "<qt>" + i18n("KHotKeys was unable to execute") + " '" + cmd + "'<p>" + i18n("Please verify existence and permissions of the executable file") + "</qt>", i18n("Unable to launch program")); } break; } default: // error + KMessageBox::sorry(0, "<qt>" + i18n("KHotKeys was unable to execute") + " '" + cmd + "'<p>" + i18n("Please verify existence and permissions of the executable file") + "</qt>", i18n("Unable to launch program")); return; } timeout.start( 1000, true ); // 1sec timeout |