aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@src.gnome.org>2007-09-26 06:59:55 +0800
committerCosimo Cecchi <cosimoc@src.gnome.org>2007-09-26 06:59:55 +0800
commit497d90e04609907bb709828c93f73e75c7f118a2 (patch)
tree9adf446fc5f75f4385d060bbc1129bf1a1de37da /lib
parent4d955b0a676fe88d57997b99911080999461461f (diff)
downloadgsoc2013-epiphany-497d90e04609907bb709828c93f73e75c7f118a2.tar
gsoc2013-epiphany-497d90e04609907bb709828c93f73e75c7f118a2.tar.gz
gsoc2013-epiphany-497d90e04609907bb709828c93f73e75c7f118a2.tar.bz2
gsoc2013-epiphany-497d90e04609907bb709828c93f73e75c7f118a2.tar.lz
gsoc2013-epiphany-497d90e04609907bb709828c93f73e75c7f118a2.tar.xz
gsoc2013-epiphany-497d90e04609907bb709828c93f73e75c7f118a2.tar.zst
gsoc2013-epiphany-497d90e04609907bb709828c93f73e75c7f118a2.zip
Make Epiphany properly remember the last saved location in the FileChooser.
Fix for bug #336251. svn path=/trunk/; revision=7494
Diffstat (limited to 'lib')
-rw-r--r--lib/ephy-file-chooser.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/ephy-file-chooser.c b/lib/ephy-file-chooser.c
index e5e9b1250..2edfb11bc 100644
--- a/lib/ephy-file-chooser.c
+++ b/lib/ephy-file-chooser.c
@@ -95,6 +95,29 @@ current_folder_changed_cb (GtkFileChooser *chooser, EphyFileChooser *dialog)
}
static void
+file_chooser_response_cb (GtkWidget *widget,
+ gint response,
+ EphyFileChooser *dialog)
+{
+ if (response == GTK_RESPONSE_ACCEPT)
+ {
+ if (dialog->priv->persist_key != NULL)
+ {
+ char *dir, *filename;
+
+ filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
+
+ dir = g_path_get_dirname (filename);
+
+ eel_gconf_set_path (dialog->priv->persist_key, dir);
+
+ g_free (dir);
+ g_free (filename);
+ }
+ }
+}
+
+static void
ephy_file_chooser_init (EphyFileChooser *dialog)
{
dialog->priv = EPHY_FILE_CHOOSER_GET_PRIVATE (dialog);
@@ -165,6 +188,9 @@ ephy_file_chooser_set_persist_key (EphyFileChooser *dialog, const char *key)
g_signal_connect (dialog, "current-folder-changed",
G_CALLBACK (current_folder_changed_cb), dialog);
+
+ g_signal_connect (dialog, "response",
+ G_CALLBACK (file_chooser_response_cb), dialog);
}
const char *