Add DATADIR as shortcut folder to file chooser
authorH.G.Muller <hgm@hgm-xboard.(none)>
Sat, 9 Apr 2016 20:47:18 +0000 (22:47 +0200)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Sun, 17 Apr 2016 08:24:58 +0000 (10:24 +0200)
The file chooser invoked by a dialog Browse button now puts XBoard's
DATADIR amongst the shortcuts in the 'Places' list, so you can navigate
there with a single mouse click.

gtk/xoptions.c
xboard2.h

index fd9bc07..4b72904 100644 (file)
@@ -1132,6 +1132,8 @@ void BrowseGTK(GtkWidget *widget, gpointer gdata)
                       GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
                       NULL);
 
+    gtk_file_chooser_add_shortcut_folder(GTK_FILE_CHOOSER(dialog), dataDir, NULL);
+
     /* one filter to show everything */
     gtk_file_filter_add_pattern(gtkfilter_all, "*");
     gtk_file_filter_set_name   (gtkfilter_all, "All Files");
index 3a5539e..a3c8f22 100644 (file)
--- a/xboard2.h
+++ b/xboard2.h
@@ -29,3 +29,4 @@ extern int squareSize, lineGap, defaultLineGap;
 extern int startedFromPositionFile;
 extern char *icsTextMenuString;
 extern int hi2X, hi2Y;
+extern char dataDir[];