diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-10-28 18:50:51 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-10-28 18:52:07 (EDT) |
commit | 681956be894e38e5c4515c80a9a4a626ef4d4c9f (patch) | |
tree | 135a77c64cfbe003cf4e853136e9a30d0214a787 | |
parent | f26b05e80c006804f3918cfbbff9eef80491643b (diff) | |
download | marquee-681956be894e38e5c4515c80a9a4a626ef4d4c9f.zip marquee-681956be894e38e5c4515c80a9a4a626ef4d4c9f.tar.gz marquee-681956be894e38e5c4515c80a9a4a626ef4d4c9f.tar.bz2 |
mq_web_view_open(): Set file chooser's current folder
-rw-r--r-- | src/web-view.c | 8 |
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); |