From c1e9da9eed75fc314c113000d7fe01e7de1ae913 Mon Sep 17 00:00:00 2001 From: Wouter Bolsterlee Date: Sun, 15 Oct 2006 14:05:40 +0000 Subject: Automatically open a Nautilus window after downloading has finished. Fixes 2006-10-15 Wouter Bolsterlee * embed/mozilla/ContentHandler.cpp: * embed/mozilla/MozDownload.cpp: * lib/ephy-file-helpers.c: (ephy_file_browse_to): * lib/ephy-file-helpers.h: * src/popup-commands.c: (save_property_url_completed_cb), (save_property_url): Automatically open a Nautilus window after downloading has finished. Fixes bug #138876, patch by Ed Catmur. --- src/popup-commands.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src') diff --git a/src/popup-commands.c b/src/popup-commands.c index 48e3f7c9f..2f81614a7 100644 --- a/src/popup-commands.c +++ b/src/popup-commands.c @@ -167,6 +167,24 @@ popup_cmd_copy_link_address (GtkAction *action, } } +static void +save_property_url_completed_cb (EphyEmbedPersist *persist) +{ + if (!(ephy_embed_persist_get_flags (persist) & + EPHY_EMBED_PERSIST_ASK_DESTINATION)) + { + const char *dest; + guint32 user_time; + + user_time = ephy_embed_persist_get_user_time (persist); + dest = ephy_embed_persist_get_dest (persist); + g_return_if_fail (dest != NULL); + + eel_gconf_get_string (CONF_STATE_DOWNLOAD_DIR); + ephy_file_browse_to (dest, user_time); + } +} + static void save_property_url (GtkAction *action, const char *title, @@ -201,6 +219,9 @@ save_property_url (GtkAction *action, (persist, CONF_STATE_SAVE_DIR); ephy_embed_persist_set_source (persist, location); + g_signal_connect (persist, "completed", + G_CALLBACK (save_property_url_completed_cb), NULL); + ephy_embed_persist_save (persist); g_object_unref (G_OBJECT(persist)); -- cgit v1.2.3