diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2012-09-06 14:31:38 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2012-09-06 14:31:38 -0700 |
commit | 109dab56eb32bca4d43ada6b62f5c29e5e10b687 (patch) | |
tree | b29d8afd53a20e6a9d9c73f7ec63faa39add5ca4 | |
parent | 8c7c11c6446c1adbb1e6fd5c041e48b3a3e9e814 (diff) | |
download | subsurface-109dab56eb32bca4d43ada6b62f5c29e5e10b687.tar.gz |
Set default path for file import to the last path opened
This may not be the path the import files are in, but it's better than the
current default of 'nothing'.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | gtk-gui.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1174,6 +1174,7 @@ static GtkWidget *xml_file_selector(GtkWidget *vbox, GtkWidget *main_dialog) { GtkWidget *hbox, *frame, *chooser, *dialog; GtkFileFilter *filter; + char *current_file, *current_dir; hbox = gtk_hbox_new(FALSE, 6); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 3); @@ -1187,7 +1188,10 @@ static GtkWidget *xml_file_selector(GtkWidget *vbox, GtkWidget *main_dialog) GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(dialog), FALSE); - + current_dir = path_and_file(existing_filename, ¤t_file); + gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(dialog), current_dir); + free(current_dir); + free(current_file); filter = gtk_file_filter_new(); gtk_file_filter_add_pattern(filter, "*.xml"); gtk_file_filter_add_pattern(filter, "*.XML"); |