diff options
author | Jeffrey Stedfast <fejj@novell.com> | 2004-06-23 03:39:20 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2004-06-23 03:39:20 +0800 |
commit | cd139a86fd23cfdc4411a7a851334cc484df10f0 (patch) | |
tree | f887b22d10c11c3b1f68778160136cbc21fd8978 /mail/em-popup.c | |
parent | aee2630d0610468ced5ac66a8634807e27948aef (diff) | |
download | gsoc2013-evolution-cd139a86fd23cfdc4411a7a851334cc484df10f0.tar.gz 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
Diffstat (limited to 'mail/em-popup.c')
-rw-r--r-- | mail/em-popup.c | 26 |
1 files changed, 22 insertions, 4 deletions
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); |