From 681956be894e38e5c4515c80a9a4a626ef4d4c9f Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sat, 28 Oct 2017 18:50:51 -0400 Subject: mq_web_view_open(): Set file chooser's current folder --- 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); -- cgit v0.9.1