From cd139a86fd23cfdc4411a7a851334cc484df10f0 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 22 Jun 2004 19:39:20 +0000 Subject: If the app requires a terminal to run, give it a bloody terminal (who uses 2004-06-22 Jeffrey Stedfast * em-popup.c (emp_apps_open_in): If the app requires a terminal to run, give it a bloody terminal (who uses vi in an xterm to view attached text files? *sigh*). Fixes bug #51259. svn path=/trunk/; revision=26455 --- mail/ChangeLog | 6 ++++++ mail/em-popup.c | 26 ++++++++++++++++++++++---- mail/message-list.c | 2 +- 3 files changed, 29 insertions(+), 5 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index 47f9395c79..946772f93e 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,9 @@ +2004-06-22 Jeffrey Stedfast + + * em-popup.c (emp_apps_open_in): If the app requires a terminal to + run, give it a bloody terminal (who uses vi in an xterm to view + attached text files? *sigh*). Fixes bug #51259. + 2004-06-21 Chris Toshok * em-folder-tree.c (render_display_name): gtk_tree_model_get on a diff --git a/mail/em-popup.c b/mail/em-popup.c index 785321cd11..f4ed82e67e 100644 --- a/mail/em-popup.c +++ b/mail/em-popup.c @@ -880,11 +880,29 @@ emp_apps_open_in(GtkWidget *w, struct _open_in_item *item) path = em_utils_temp_save_part(item->target->widget, item->target->data.part.part); if (path) { - char *command; int douri = (item->app->expects_uris == GNOME_VFS_MIME_APPLICATION_ARGUMENT_TYPE_URIS); - - command = g_strdup_printf(douri?"%s file://%s &":"%s %s &", item->app->command, path); - + char *command; + + if (item->app->requires_terminal) { + char *term, *args = NULL; + GConfClient *gconf; + + gconf = gconf_client_get_default (); + if ((term = gconf_client_get_string (gconf, "/desktop/gnome/applications/terminal/exec", NULL))) + args = gconf_client_get_string (gconf, "/desktop/gnome/applications/terminal/exec_arg", NULL); + g_object_unref (gconf); + + if (term == NULL) + return; + + command = g_strdup_printf ("%s%s%s %s %s%s &", term, args ? " " : "", args ? args : "", + item->app->command, douri ? "file://" : "", path); + g_free (term); + g_free (args); + } else { + command = g_strdup_printf ("%s %s%s &", item->app->command, douri ? "file://" : "", path); + } + /* FIXME: Do not use system here */ system(command); g_free(command); diff --git a/mail/message-list.c b/mail/message-list.c index 8dee97030b..bbbce5bfaf 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -728,7 +728,7 @@ message_list_copy(MessageList *ml, gboolean cut) GPtrArray *uids; clear_selection(ml, &p->clipboard); - + uids = message_list_get_selected(ml); if (uids->len > 0) { -- cgit