X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=gtk%2Fxoptions.c;h=d84d425d14cb6626b48df387bbd3c5932e69103f;hb=b43ae6d0c5d6e3f89236153b0f61c908dd86f551;hp=7a3a83175f67ce60ee304416f23bd7a630c1a74f;hpb=78380102f6e5d4bbe6bacb0df21aa6afec8ff903;p=xboard.git diff --git a/gtk/xoptions.c b/gtk/xoptions.c index 7a3a831..d84d425 100644 --- a/gtk/xoptions.c +++ b/gtk/xoptions.c @@ -1109,15 +1109,16 @@ void BrowseGTK(GtkWidget *widget, gpointer gdata) GtkFileFilter *gtkfilter_all; int opt_i = (intptr_t) gdata; GtkFileChooserAction fc_action; + char buf[MSG_SIZ]; gtkfilter = gtk_file_filter_new(); gtkfilter_all = gtk_file_filter_new(); - char fileext[MSG_SIZ], *filter = currentOption[opt_i].textValue, *old; + char fileext[MSG_SIZ], *filter = currentOption[opt_i].textValue, *old = NULL; + if(currentCps) filter = NULL; else if(currentOption[opt_i].type == PathName && filter) filter = "dir"; GetWidgetText(¤tOption[opt_i], &old); // start in same directory as current widget contents StartDir(filter, old); // change to start directory for this file type - g_free(old); /* select file or folder depending on option_type */ if (currentOption[opt_i].type == PathName) @@ -1132,13 +1133,19 @@ 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); + snprintf(buf, MSG_SIZ, "%s/themes", dataDir); + gtk_file_chooser_add_shortcut_folder(GTK_FILE_CHOOSER(dialog), buf, NULL); + snprintf(buf, MSG_SIZ, "%s/themes/textures", dataDir); + gtk_file_chooser_add_shortcut_folder(GTK_FILE_CHOOSER(dialog), buf, NULL); + /* one filter to show everything */ gtk_file_filter_add_pattern(gtkfilter_all, "*"); gtk_file_filter_set_name (gtkfilter_all, "All Files"); gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog),gtkfilter_all); /* filter for specific filetypes e.g. pgn or fen */ - if (currentOption[opt_i].textValue != NULL) + if (currentOption[opt_i].textValue != NULL && !currentCps) // no filters for engine options! { char *q, *p = currentOption[opt_i].textValue; gtk_file_filter_set_name (gtkfilter, p);