aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog18
-rw-r--r--data/epiphany.schemas.in11
-rw-r--r--embed/ephy-embed-popup.c2
-rw-r--r--embed/ephy-embed-utils.c26
-rw-r--r--embed/mozilla/FilePicker.cpp8
-rw-r--r--embed/mozilla/mozilla-embed-single.cpp27
-rw-r--r--lib/ephy-prefs.h1
-rw-r--r--src/popup-commands.c2
8 files changed, 61 insertions, 34 deletions
diff --git a/ChangeLog b/ChangeLog
index f5d2fb88b..01be4d0ec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2003-06-05 Marco Pesenti Gritti <marco@it.gnome.org>
+
+ * data/epiphany.schemas.in:
+ * embed/ephy-embed-popup.c: (embed_popup_download_link_cmd):
+ * embed/ephy-embed-utils.c: (ephy_embed_utils_save):
+
+ Actually add the ask for dest pref, it was using the wrong key.
+
+ * embed/mozilla/FilePicker.cpp:
+ * embed/mozilla/mozilla-embed-single.cpp:
+
+ Return directory also on cancel.
+
+ * lib/ephy-prefs.h:
+ * src/popup-commands.c: (popup_cmd_download_link):
+
+ Persist directory also on cancel.
+
2003-06-04 David Bordoley <bordoley@msu.edu>
* data/ui/epiphany-ui.xml.in:
diff --git a/data/epiphany.schemas.in b/data/epiphany.schemas.in
index 4e0a42687..f35d6f19a 100644
--- a/data/epiphany.schemas.in
+++ b/data/epiphany.schemas.in
@@ -71,6 +71,17 @@
</locale>
</schema>
<schema>
+ <key>/schemas/apps/epiphany/interface/ask_download_dest</key>
+ <applyto>/apps/epiphany/interface/ask_download_dest</applyto>
+ <owner>epiphany</owner>
+ <type>bool</type>
+ <default>true</default>
+ <locale name="C">
+ <short>Ask download destination</short>
+ <long>Ask download destination.</long>
+ </locale>
+ </schema>
+ <schema>
<key>/schemas/apps/epiphany/interface/open_in_tab</key>
<applyto>/apps/epiphany/interface/open_in_tab</applyto>
<owner>epiphany</owner>
diff --git a/embed/ephy-embed-popup.c b/embed/ephy-embed-popup.c
index 38587fe65..e66678714 100644
--- a/embed/ephy-embed-popup.c
+++ b/embed/ephy-embed-popup.c
@@ -460,7 +460,7 @@ embed_popup_download_link_cmd (BonoboUIComponent *uic,
{
save_property_url (popup,
eel_gconf_get_boolean
- (CONF_STATE_DOWNLOADING_DIR),
+ (CONF_ASK_DOWNLOAD_DEST),
TRUE, "link");
}
diff --git a/embed/ephy-embed-utils.c b/embed/ephy-embed-utils.c
index 57ef3beb4..4e68964b9 100644
--- a/embed/ephy-embed-utils.c
+++ b/embed/ephy-embed-utils.c
@@ -140,28 +140,30 @@ ephy_embed_utils_save (GtkWidget *window,
NULL, NULL);
}
- if (ret == G_OK)
- {
- uri = gnome_vfs_uri_new (retPath);
- g_return_if_fail (uri != NULL);
- retDir = gnome_vfs_uri_extract_dirname (uri);
+ uri = gnome_vfs_uri_new (retPath);
+ g_return_if_fail (uri != NULL);
+
+ retDir = gnome_vfs_uri_extract_dirname (uri);
+ if (ret == G_OK)
+ {
if (with_content) flags |= EMBED_PERSIST_SAVE_CONTENT;
+
ephy_embed_persist_set_flags (persist, flags);
ephy_embed_persist_set_dest (persist, retPath);
ephy_embed_persist_save (persist);
+ }
- /* set default save dir */
- eel_gconf_set_string (default_dir_pref,
- retDir);
+ /* set default save dir */
+ eel_gconf_set_string (default_dir_pref,
+ retDir);
- g_free (retDir);
- gnome_vfs_uri_unref (uri);
- g_free (retPath);
- }
+ g_free (retDir);
+ gnome_vfs_uri_unref (uri);
+ g_free (retPath);
g_object_unref (G_OBJECT(persist));
diff --git a/embed/mozilla/FilePicker.cpp b/embed/mozilla/FilePicker.cpp
index e39419ac8..9e10c1d8f 100644
--- a/embed/mozilla/FilePicker.cpp
+++ b/embed/mozilla/FilePicker.cpp
@@ -280,11 +280,9 @@ NS_IMETHODIMP GFilePicker::Show(PRInt16 *_retval)
gint retVal = gtk_dialog_run(GTK_DIALOG(mFileSelector));
- if (retVal == GTK_RESPONSE_OK)
- {
- HandleFilePickerResult(_retval);
- }
- else
+ HandleFilePickerResult(_retval);
+
+ if (retVal != GTK_RESPONSE_OK)
{
*_retval = returnCancel;
}
diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp
index 211d2eb30..d865c6881 100644
--- a/embed/mozilla/mozilla-embed-single.cpp
+++ b/embed/mozilla/mozilla-embed-single.cpp
@@ -1100,6 +1100,7 @@ impl_show_file_picker (EphyEmbedSingle *shell,
int *ret_file_format)
{
gchar *expanded_directory;
+ gresult result;
GFilePicker *filePicker = new GFilePicker (file_formats);
@@ -1132,19 +1133,15 @@ impl_show_file_picker (EphyEmbedSingle *shell,
*ret_file_format = filePicker->mSelectedFileFormat;
}
- if (retval == nsIFilePicker::returnCancel)
- {
- delete filePicker;
- return G_FAILED;
- }
- else
- {
- nsCOMPtr<nsILocalFile> file;
- filePicker->GetFile (getter_AddRefs(file));
- nsCAutoString tempFullPathStr;
- file->GetNativePath (tempFullPathStr);
- *ret_fullpath = g_strdup (tempFullPathStr.get());
- delete filePicker;
- return G_OK;
- }
+ nsCOMPtr<nsILocalFile> local_file;
+ filePicker->GetFile (getter_AddRefs(local_file));
+ nsCAutoString tempFullPathStr;
+ local_file->GetNativePath (tempFullPathStr);
+ *ret_fullpath = g_strdup (tempFullPathStr.get());
+
+ result = (retval == nsIFilePicker::returnCancel) ? G_FAILED : G_OK;
+
+ delete filePicker;
+
+ return result;
}
diff --git a/lib/ephy-prefs.h b/lib/ephy-prefs.h
index 3686a53fb..c4fde28da 100644
--- a/lib/ephy-prefs.h
+++ b/lib/ephy-prefs.h
@@ -31,6 +31,7 @@ G_BEGIN_DECLS
#define CONF_WINDOWS_SHOW_STATUSBAR "/apps/epiphany/interface/show_statusbar"
#define CONF_BOOKMARKS_SELECTED_NODE "/apps/epiphany/interface/bookmark_keyword_selected_node"
#define CONF_INTERFACE_MIDDLE_CLICK_OPEN_URL "/apps/epiphany/interface/middle_click_open_url"
+#define CONF_ASK_DOWNLOAD_DEST "/apps/epiphany/interface/ask_download_dest"
/* Downloader */
#define CONF_DOWNLOADING_SHOW_DETAILS "/apps/epiphany/downloader/show_details"
diff --git a/src/popup-commands.c b/src/popup-commands.c
index de002689f..64311ddf3 100644
--- a/src/popup-commands.c
+++ b/src/popup-commands.c
@@ -329,7 +329,7 @@ popup_cmd_download_link (EggAction *action,
{
save_property_url (action, window,
eel_gconf_get_boolean
- (CONF_STATE_DOWNLOADING_DIR),
+ (CONF_ASK_DOWNLOAD_DEST),
TRUE, "link");
}