diff options
author | Diego Escalante Urrelo <diegoe@svn.gnome.org> | 2007-01-09 08:49:45 +0800 |
---|---|---|
committer | Diego Escalante Urrelo <diegoe@src.gnome.org> | 2007-01-09 08:49:45 +0800 |
commit | f6b01d969273f407b0fdc623aa6acc1986491512 (patch) | |
tree | 9572875e966c498e2f7468b4ff42da0aef75ce5f | |
parent | fc051e29f9dd21db6254ce75f17c97a4012bcf03 (diff) | |
download | gsoc2013-epiphany-f6b01d969273f407b0fdc623aa6acc1986491512.tar gsoc2013-epiphany-f6b01d969273f407b0fdc623aa6acc1986491512.tar.gz gsoc2013-epiphany-f6b01d969273f407b0fdc623aa6acc1986491512.tar.bz2 gsoc2013-epiphany-f6b01d969273f407b0fdc623aa6acc1986491512.tar.lz gsoc2013-epiphany-f6b01d969273f407b0fdc623aa6acc1986491512.tar.xz gsoc2013-epiphany-f6b01d969273f407b0fdc623aa6acc1986491512.tar.zst gsoc2013-epiphany-f6b01d969273f407b0fdc623aa6acc1986491512.zip |
Opens images in a new browser window if EOG is not found. Bug #167595.
2007-01-09 Diego Escalante Urrelo <diegoe@svn.gnome.org>
* src/popup-commands.c:
* lib/ephy-file-helpers.c:
Opens images in a new browser window if EOG is not found. Bug #167595.
Patch by Björn Lindqvist.
svn path=/trunk/; revision=6811
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | lib/ephy-file-helpers.c | 6 | ||||
-rw-r--r-- | src/popup-commands.c | 30 |
3 files changed, 31 insertions, 13 deletions
@@ -1,5 +1,13 @@ 2007-01-09 Diego Escalante Urrelo <diegoe@svn.gnome.org> + * src/popup-commands.c: + * lib/ephy-file-helpers.c: + + Opens images in a new browser window if EOG is not found. Bug #167595. + Patch by Björn Lindqvist. + +2007-01-09 Diego Escalante Urrelo <diegoe@svn.gnome.org> + * src/ephy-history-window.c: * src/ephy-main.c: * src/bookmarks/ephy-bookmarks-editor.c: diff --git a/lib/ephy-file-helpers.c b/lib/ephy-file-helpers.c index 9bc6c04dc..1b30b4cab 100644 --- a/lib/ephy-file-helpers.c +++ b/lib/ephy-file-helpers.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * Copyright © 2002 Jorn Baayen * Copyright © 2003, 2004 Marco Pesenti Gritti @@ -1007,10 +1008,7 @@ ephy_file_launch_handler (const char *mime_type, gnome_vfs_mime_application_free (app); } else - { - /* FIXME: warn user? */ - g_warning ("No handler for found or file type is unsafe!\n"); - } + ret = FALSE; g_free (canonical); diff --git a/src/popup-commands.c b/src/popup-commands.c index c6dcaf969..64e0d0654 100644 --- a/src/popup-commands.c +++ b/src/popup-commands.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * Copyright © 2000-2003 Marco Pesenti Gritti * @@ -367,22 +368,31 @@ popup_cmd_open_frame (GtkAction *action, g_free (location); } +/* Opens an image URI using its associated handler. Or, if that + * doesn't work, fallback to open the URI in a new browser window. + */ static void -image_open_uri (const char *address, - gboolean delete, +image_open_uri (const char *remote_address, + const char *local_address, guint32 user_time) { gboolean success; - success = ephy_file_launch_handler (NULL, address, user_time); + success = ephy_file_launch_handler (NULL, local_address, user_time); - if (delete && success) + if (!success) { - ephy_file_delete_on_exit (address); + ephy_shell_new_tab (ephy_shell, NULL, NULL, remote_address, + EPHY_NEW_TAB_OPEN_PAGE | + EPHY_NEW_TAB_IN_NEW_WINDOW); } - else if (delete) + + if (strcmp (remote_address, local_address) != 0) { - gnome_vfs_unlink (address); + if (success) + ephy_file_delete_on_exit (local_address); + else + gnome_vfs_unlink (local_address); } } @@ -390,13 +400,15 @@ static void save_source_completed_cb (EphyEmbedPersist *persist) { const char *dest; + const char *source; guint32 user_time; user_time = ephy_embed_persist_get_user_time (persist); dest = ephy_embed_persist_get_dest (persist); + source = ephy_embed_persist_get_source (persist); g_return_if_fail (dest != NULL); - image_open_uri (dest, TRUE, user_time); + image_open_uri (source, dest, user_time); } static void @@ -461,7 +473,7 @@ popup_cmd_open_image (GtkAction *action, if (strcmp (scheme, "file") == 0) { - image_open_uri (address, FALSE, + image_open_uri (address, address, gtk_get_current_event_time ()); } else |