summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/web-view.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/web-view.c b/src/web-view.c
index 24cfdcd..b0c99a2 100644
--- a/src/web-view.c
+++ b/src/web-view.c
@@ -823,6 +823,8 @@ void
mq_web_view_open(MqWebView *web_view)
{
GtkWidget *dialog;
+ GtkFileChooser *chooser;
+ gchar *dir;
dialog = gtk_file_chooser_dialog_new("Open File",
GTK_WINDOW(mq_tab_page_get_window(web_view->tab_page)),
@@ -830,6 +832,12 @@ mq_web_view_open(MqWebView *web_view)
"_Cancel", GTK_RESPONSE_CANCEL,
"_Open", GTK_RESPONSE_ACCEPT,
NULL);
+ 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);
+ }
+ g_free(dir);
g_signal_connect(dialog, "response",
G_CALLBACK(open_response_cb), web_view);
gtk_widget_show_all(dialog);