static Option commonEngineOptions[] = {
{ 0, 0, 0, NULL, (void*) &appData.ponderNextMove, "", NULL, CheckBox, N_("Ponder Next Move") },
{ 0, 0, 1000, NULL, (void*) &appData.smpCores, "", NULL, Spin, N_("Maximum Number of CPUs per Engine:") },
-{ 0, 0, 0, NULL, (void*) &appData.polyglotDir, "", NULL, PathName, N_("Polygot Directory:") },
+{ 0, 0, 0, NULL, (void*) &appData.polyglotDir, NULL, NULL, PathName, N_("Polygot Directory:") },
{ 0, 0,16000, NULL, (void*) &appData.defaultHashSize, "", NULL, Spin, N_("Hash-Table Size (MB):") },
-{ 0, 0, 0, NULL, (void*) &egtPath, "", NULL, PathName, N_("EGTB Path:") },
+{ 0, 0, 0, NULL, (void*) &egtPath, NULL, NULL, PathName, N_("EGTB Path:") },
{ 0, 0, 1000, NULL, (void*) &appData.defaultCacheSizeEGTB, "", NULL, Spin, N_("EGTB Cache Size (MB):") },
{ 0, 0, 0, NULL, (void*) &appData.usePolyglotBook, "", NULL, CheckBox, N_("Use GUI Book") },
{ 0, 0, 0, NULL, (void*) &appData.polyglotBook, ".bin", NULL, FileName, N_("Opening-Book Filename:") },
void
StartDir (char *filter, char *newName)
{
- static char *gamesDir, *trnDir, *imgDir, *bookDir;
+ static char *gamesDir, *trnDir, *imgDir, *bookDir, *dirDir;
static char curDir[MSG_SIZ];
char **res = NULL;
if(!filter || !*filter) return;
+ if(strstr(filter, "dir")) {
+ res = &dirDir;
+ if(!dirDir) dirDir= strdup(dataDir);
+ } else
if(strstr(filter, "pgn")) res = &gamesDir; else
if(strstr(filter, "bin")) res = &bookDir; else
if(strstr(filter, "png")) res = &imgDir; else
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)
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);