[easytag] Fix launching an external application



commit afed1362d87b1c070de448dffad7bc5d06929ecd
Author: David King <amigadave amigadave com>
Date:   Thu Nov 20 21:32:19 2014 +0000

    Fix launching an external application
    
    Only display a warning if the program name is empty. Move the status bar
    message printed on successful program execution to EtBrowser.

 src/browser.c |   16 ++++++++++++++++
 src/misc.c    |    8 +-------
 2 files changed, 17 insertions(+), 7 deletions(-)
---
diff --git a/src/browser.c b/src/browser.c
index 60b5b8a..dfebd5b 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -4579,6 +4579,8 @@ Run_Program_With_Directory (EtBrowser *self)
 
     if (program_ran)
     {
+        gchar *msg;
+
         // Append newest choice to the drop down list
         Add_String_To_Combo_List(priv->run_program_model, program_name);
 
@@ -4586,6 +4588,12 @@ Run_Program_With_Directory (EtBrowser *self)
         Save_Run_Program_With_Directory_List(priv->run_program_model, MISC_COMBO_TEXT);
 
         Destroy_Run_Program_Tree_Window (self);
+
+        msg = g_strdup_printf (_("Executed command ‘%s’"), program_name);
+        et_application_window_status_bar_message (ET_APPLICATION_WINDOW (MainWindow),
+                                                  msg, TRUE);
+
+        g_free (msg);
     }
     g_free(program_name);
 }
@@ -4635,6 +4643,8 @@ Run_Program_With_Selected_Files (EtBrowser *self)
 
     if (program_ran)
     {
+        gchar *msg;
+
         // Append newest choice to the drop down list
         //gtk_list_store_prepend(GTK_LIST_STORE(priv->run_program_model), &iter);
         //gtk_list_store_set(priv->run_program_model, &iter, MISC_COMBO_TEXT, program_name, -1);
@@ -4644,6 +4654,12 @@ Run_Program_With_Selected_Files (EtBrowser *self)
         Save_Run_Program_With_File_List(priv->run_program_model, MISC_COMBO_TEXT);
 
         Destroy_Run_Program_List_Window (self);
+
+        msg = g_strdup_printf (_("Executed command ‘%s’"), program_name);
+        et_application_window_status_bar_message (ET_APPLICATION_WINDOW (MainWindow),
+                                                  msg, TRUE);
+
+        g_free (msg);
     }
     g_free(program_name);
 }
diff --git a/src/misc.c b/src/misc.c
index 7ac2f68..da076ca 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -26,7 +26,6 @@
 #include <sys/stat.h>
 #include <errno.h>
 
-#include "application_window.h"
 #include "misc.h"
 #include "easytag.h"
 #include "id3_tag.h"
@@ -234,7 +233,6 @@ et_run_program (const gchar *program_name, GList *args_list)
     gchar **program_args_argv = NULL;
     guint n_program_args = 0;
     gsize i;
-    gchar  *msg;
     GPid pid;
     GError *error = NULL;
     gchar **argv;
@@ -245,7 +243,7 @@ et_run_program (const gchar *program_name, GList *args_list)
     g_return_val_if_fail (program_name != NULL && args_list != NULL, FALSE);
 
     /* Check if a name for the program has been supplied */
-    if (*program_name)
+    if (!*program_name)
     {
         GtkWidget *msgdialog;
 
@@ -333,10 +331,6 @@ et_run_program (const gchar *program_name, GList *args_list)
     {
         g_child_watch_add (pid, et_on_child_exited, NULL);
 
-        msg = g_strdup_printf (_("Executed command ‘%s’"), program_name);
-        et_application_window_status_bar_message (ET_APPLICATION_WINDOW (MainWindow),
-                                                  msg, TRUE);
-        g_free (msg);
         res = TRUE;
     }
     else


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]