From 734efe5910e2696b2fe52370758d888998377142 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Tue, 3 Jan 2017 12:59:46 +0100 Subject: [PATCH] Diversify UCI string options into -string, -path and -file Heuristics is applied to the option name, in order to guess whether UCI string options are filenames or directory paths. In which case they are translated into CECP -file and -path options, so XBoard will give them the appropriate browse button. --- UCI2WB.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/UCI2WB.c b/UCI2WB.c index ebcd79c..2db1424 100644 --- a/UCI2WB.c +++ b/UCI2WB.c @@ -358,6 +358,10 @@ Engine2GUI() sprintf(buf, ",%s,", name); if(strcasestr(EGT, buf)) { buf[strlen(buf)-5] = 0; strcat(egts, buf); continue; } // collect EGT formats // pass on engine-defined option as WB option feature if(!strcmp(type, "filename")) type[4] = 0; + else if(sc == 'c' && !strcmp(type, "string")) { // in UCI try to guess which strings are file or directory names + if(strcasestr(name, "file")) strcpy(type, "file"); else + if(strcasestr(name, "path") || strcasestr(name, "directory") || strcasestr(name, "folder")) strcpy(type, "path"); + } sprintf(buf, "feature option=\"%s -%s", name, type); q = buf + strlen(buf); if( !strcmp(type, "file") || !strcmp(type, "string")) sprintf(q, " %s\"\n", val); -- 1.7.0.4