]> Dogcows Code - chaz/openbox/blobdiff - openbox/actions/execute.c
Merge branch 'backport' into work
[chaz/openbox] / openbox / actions / execute.c
index 6f4e4b179ab5bcdefeeaf45638d5929ad18be821..05ab2ef3c6fda7085c8fbf0aea0cd59f078d9567 100644 (file)
@@ -96,11 +96,15 @@ static Options* dup_options(Options *in)
 
 static gboolean run_func(ObActionsData *data, gpointer options);
 
-static void prompt_cb(ObPrompt *p, gint result, gpointer options)
+static gboolean prompt_cb(ObPrompt *p, gint result, gpointer options)
 {
     if (result)
         run_func(NULL, options);
+    return TRUE; /* call the cleanup func */
+}
 
+static void prompt_cleanup(ObPrompt *p, gpointer options)
+{
     prompt_unref(p);
     free_func(options);
 }
@@ -124,7 +128,8 @@ static gboolean run_func(ObActionsData *data, gpointer options)
         };
 
         ocp = dup_options(options);
-        p = prompt_new(o->prompt, answers, 2, 0, 0, prompt_cb, ocp);
+        p = prompt_new(o->prompt, _("Execute"), answers, 2, 0, 0,
+                       prompt_cb, prompt_cleanup, ocp);
         prompt_show(p, NULL, FALSE);
 
         return FALSE;
@@ -166,10 +171,7 @@ static gboolean run_func(ObActionsData *data, gpointer options)
 
             if ((c[1] == 'w' || c[1] == 'W') &&
                 (c[2] == 'i' || c[2] == 'I') &&
-                (c[3] == 'n' || c[3] == 'N') &&
-                (c[4] == 'd' || c[4] == 'D') &&
-                (c[5] == 'o' || c[5] == 'O') &&
-                (c[6] == 'w' || c[6] == 'W') &&
+                (c[3] == 'd' || c[3] == 'D') &&
                 !g_ascii_isalnum(c[7]))
             {
                 /* found $window */
@@ -207,7 +209,7 @@ static gboolean run_func(ObActionsData *data, gpointer options)
 
     e = NULL;
     if (!g_shell_parse_argv(cmd, NULL, &argv, &e)) {
-        g_message(_("Failed to execute \"%s\": %s"), o->cmd, e->message);
+        g_message(e->message, o->cmd);
         g_error_free(e);
     }
     else {
@@ -229,8 +231,7 @@ static gboolean run_func(ObActionsData *data, gpointer options)
                            G_SPAWN_DO_NOT_REAP_CHILD,
                            NULL, NULL, NULL, &e);
         if (!ok) {
-            g_message(_("Failed to execute \"%s\": %s"),
-                      o->cmd, e->message);
+            g_message(e->message, o->cmd);
             g_error_free(e);
         }
 
This page took 0.022394 seconds and 4 git commands to generate.