summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/web-view.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/web-view.c b/src/web-view.c
index 02365f9..1f71e32 100644
--- a/src/web-view.c
+++ b/src/web-view.c
@@ -838,7 +838,11 @@ mq_web_view_open(MqWebView *web_view)
"_Cancel", GTK_RESPONSE_CANCEL,
"_Open", GTK_RESPONSE_ACCEPT,
NULL);
+ g_signal_connect(dialog, "response",
+ G_CALLBACK(open_response_cb), web_view);
+ gtk_widget_show_all(dialog);
chooser = GTK_FILE_CHOOSER(dialog);
+
dir = mq_config_get_string(web_view->config, "directories.open-file");
if (dir && dir[0]) {
gtk_file_chooser_set_current_folder(chooser, dir);
@@ -846,9 +850,6 @@ mq_web_view_open(MqWebView *web_view)
/* TODO: Consider setting chooser's folder from current file-scheme URI,
* if any. */
g_free(dir);
- g_signal_connect(dialog, "response",
- G_CALLBACK(open_response_cb), web_view);
- gtk_widget_show_all(dialog);
}
static void
@@ -916,17 +917,20 @@ mq_web_view_save(MqWebView *web_view)
"_Cancel", GTK_RESPONSE_CANCEL,
"_Save", GTK_RESPONSE_ACCEPT,
NULL);
+ g_signal_connect(dialog, "response",
+ G_CALLBACK(save_response_cb), web_view);
+ gtk_widget_show_all(dialog);
chooser = GTK_FILE_CHOOSER(dialog);
+
gtk_file_chooser_set_do_overwrite_confirmation(chooser, TRUE);
+
dir = mq_config_get_string(web_view->config, "directories.downloads");
gtk_file_chooser_set_current_folder(chooser, dir);
g_free(dir);
+
title = get_clean_title(web_view);
filename = g_strconcat(title, ".mhtml", NULL);
g_free(title);
gtk_file_chooser_set_current_name(chooser, filename);
g_free(filename);
- g_signal_connect(dialog, "response",
- G_CALLBACK(save_response_cb), web_view);
- gtk_widget_show_all(dialog);
}