aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@novell.com>2004-06-23 03:39:20 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-06-23 03:39:20 +0800
commitcd139a86fd23cfdc4411a7a851334cc484df10f0 (patch)
treef887b22d10c11c3b1f68778160136cbc21fd8978
parentaee2630d0610468ced5ac66a8634807e27948aef (diff)
downloadgsoc2013-evolution-cd139a86fd23cfdc4411a7a851334cc484df10f0.tar
gsoc2013-evolution-cd139a86fd23cfdc4411a7a851334cc484df10f0.tar.gz
gsoc2013-evolution-cd139a86fd23cfdc4411a7a851334cc484df10f0.tar.bz2
gsoc2013-evolution-cd139a86fd23cfdc4411a7a851334cc484df10f0.tar.lz
gsoc2013-evolution-cd139a86fd23cfdc4411a7a851334cc484df10f0.tar.xz
gsoc2013-evolution-cd139a86fd23cfdc4411a7a851334cc484df10f0.tar.zst
gsoc2013-evolution-cd139a86fd23cfdc4411a7a851334cc484df10f0.zip
If the app requires a terminal to run, give it a bloody terminal (who uses
2004-06-22 Jeffrey Stedfast <fejj@novell.com> * 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
-rw-r--r--mail/ChangeLog6
-rw-r--r--mail/em-popup.c26
-rw-r--r--mail/message-list.c2
3 files changed, 29 insertions, 5 deletions
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 <fejj@novell.com>
+
+ * 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 <toshok@ximian.com>
* 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) {