Add warning messages on hot key command execution failure

pull/2/head
Timothy Pearson 11 years ago
parent 02d43b793c
commit 6fd6724b2f

@ -29,6 +29,7 @@
#include <tdeaccel.h> #include <tdeaccel.h>
#include <kservice.h> #include <kservice.h>
#include <kprocess.h> #include <kprocess.h>
#include <tdemessagebox.h>
#include "windows.h" #include "windows.h"
#include "action_data.h" #include "action_data.h"
@ -153,7 +154,10 @@ void Command_url_action::execute()
KService::Ptr service = KService::serviceByDesktopName( cmd ); KService::Ptr service = KService::serviceByDesktopName( cmd );
if( service != NULL ) 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; break;
} }
} }
@ -166,11 +170,12 @@ void Command_url_action::execute()
if( !KRun::runCommand( if( !KRun::runCommand(
cmd + ( uri.hasArgsAndOptions() ? uri.argsAndOptions() : "" ), cmd + ( uri.hasArgsAndOptions() ? uri.argsAndOptions() : "" ),
cmd, uri.iconName())) { 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; break;
} }
default: // error 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; return;
} }
timeout.start( 1000, true ); // 1sec timeout timeout.start( 1000, true ); // 1sec timeout

Loading…
Cancel
Save