diff options
author | Nick Schermer <nick@xfce.org> | 2012-09-26 18:35:36 +0200 |
---|---|---|
committer | Nick Schermer <nick@xfce.org> | 2012-09-26 19:44:08 +0200 |
commit | 05c7d2372248d0ce90fda57e941958acf92a4a2e (patch) | |
tree | cb141bce367419e9e6fc443fb37c515620c2e3e7 /examples | |
parent | 9e73c836f4df979e7fa6bb1ccb6ed92c5ba1b73e (diff) | |
download | thunar-05c7d2372248d0ce90fda57e941958acf92a4a2e.tar.gz |
Cleanup some example code.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/tex-open-terminal/Makefile.am | 2 | ||||
-rw-r--r-- | 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 e71996ee..a8cf3cec 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 331b70f0..f6e6fcbe 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); } |