[Xfce4-commits] <thunar:master> Cleanup some example code.

Nick Schermer noreply at xfce.org
Wed Sep 26 19:46:02 CEST 2012


Updating branch refs/heads/master
         to 05c7d2372248d0ce90fda57e941958acf92a4a2e (commit)
       from 9e73c836f4df979e7fa6bb1ccb6ed92c5ba1b73e (commit)

commit 05c7d2372248d0ce90fda57e941958acf92a4a2e
Author: Nick Schermer <nick at xfce.org>
Date:   Wed Sep 26 18:35:36 2012 +0200

    Cleanup some example code.

 examples/tex-open-terminal/Makefile.am         |    2 ++
 examples/tex-open-terminal/tex-open-terminal.c |   14 +++-----------
 2 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/examples/tex-open-terminal/Makefile.am b/examples/tex-open-terminal/Makefile.am
index e71996e..a8cf3ce 100644
--- a/examples/tex-open-terminal/Makefile.am
+++ b/examples/tex-open-terminal/Makefile.am
@@ -18,6 +18,7 @@ tex_open_terminal_la_SOURCES =						\
 
 tex_open_terminal_la_CFLAGS =						\
 	$(GTK_CFLAGS)							\
+	$(LIBXFCE4UI_CFLAGS)						\
 	$(PLATFORM_CFLAGS)
 
 tex_open_terminal_la_DEPENDENCIES =					\
@@ -25,6 +26,7 @@ tex_open_terminal_la_DEPENDENCIES =					\
 
 tex_open_terminal_la_LIBADD =						\
 	$(top_builddir)/thunarx/libthunarx-$(THUNARX_VERSION_API).la	\
+	$(LIBXFCE4UI_LIBS)						\
 	$(GTK_LIBS)
 
 tex_open_terminal_la_LDFLAGS =						\
diff --git a/examples/tex-open-terminal/tex-open-terminal.c b/examples/tex-open-terminal/tex-open-terminal.c
index 331b70f..f6e6fcb 100644
--- a/examples/tex-open-terminal/tex-open-terminal.c
+++ b/examples/tex-open-terminal/tex-open-terminal.c
@@ -29,6 +29,7 @@
 #include <string.h>
 #endif
 
+#include <libxfce4ui/libxfce4ui.h>
 #include <tex-open-terminal/tex-open-terminal.h>
 
 
@@ -143,7 +144,6 @@ tex_open_terminal_activated (GtkAction *action,
                              GtkWidget *window)
 {
   const gchar *path;
-  GtkWidget   *dialog;
   GError      *error = NULL;
   gchar       *command;
 
@@ -156,18 +156,10 @@ tex_open_terminal_activated (GtkAction *action,
   command = g_strdup_printf ("Terminal --working-directory \"%s\"", path);
 
   /* try to run the terminal command */
-  if (!gdk_spawn_command_line_on_screen (gtk_widget_get_screen (window), command, &error))
+  if (!xfce_spawn_command_line_on_screen (gtk_widget_get_screen (window), command, FALSE, FALSE, &error))
     {
       /* display an error dialog */
-      dialog = gtk_message_dialog_new (GTK_WINDOW (window),
-                                       GTK_DIALOG_DESTROY_WITH_PARENT,
-                                       GTK_MESSAGE_ERROR,
-                                       GTK_BUTTONS_CLOSE,
-                                       "Failed to open terminal in folder %s.",
-                                       path);
-      gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), "%s.", error->message);
-      gtk_dialog_run (GTK_DIALOG (dialog));
-      gtk_widget_destroy (dialog);
+      xfce_dialog_show_error (GTK_WINDOW (window), error, "Failed to open terminal in folder %s.", path);
       g_error_free (error);
     }
 


More information about the Xfce4-commits mailing list