From 6fd6724b2f4c1a0bed961eeb267381c7d54746c0 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 6 Apr 2013 01:52:59 -0500 Subject: Add warning messages on hot key command execution failure --- khotkeys/shared/actions.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/khotkeys/shared/actions.cpp b/khotkeys/shared/actions.cpp index 3174b1dcf..c8590789a 100644 --- a/khotkeys/shared/actions.cpp +++ b/khotkeys/shared/actions.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #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, "" + i18n("KHotKeys was unable to execute") + " '" + cmd + "'

" + i18n("Please verify existence of the service") + "", 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, "" + i18n("KHotKeys was unable to execute") + " '" + cmd + "'

" + i18n("Please verify existence and permissions of the executable file") + "", i18n("Unable to launch program")); } break; } default: // error + KMessageBox::sorry(0, "" + i18n("KHotKeys was unable to execute") + " '" + cmd + "'

" + i18n("Please verify existence and permissions of the executable file") + "", i18n("Unable to launch program")); return; } timeout.start( 1000, true ); // 1sec timeout -- cgit v1.2.1