From: H.G.Muller Date: Thu, 2 Nov 2017 11:43:23 +0000 (+0100) Subject: Add option -defaultInstallProtocol X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=718933f1c67acc537f88199e4c72e3ad1b6a32d7 Add option -defaultInstallProtocol A persistent option is added to determine the initial setting of the protocol-selector combobox in the Load Engine dialog. It must be given a value 0-4 corresponding to the choice order. This is mainly intended for configuring Shogi or Xiangqi packages, to select USI or USI (for which auto-detection does not work). --- diff --git a/args.h b/args.h index db6ec8f..3e376e5 100644 --- a/args.h +++ b/args.h @@ -625,6 +625,7 @@ ArgDescriptor argDescriptors[] = { { "showMoveTime", ArgBoolean, (void *) &appData.moveTime, TRUE, (ArgIniType) FALSE }, { "bmpSave", ArgInt, (void *) &appData.bmpSave, FALSE, 0 }, { "defaultEngineInstallDir", ArgFilename, (void *) &appData.defEngDir, FALSE, (ArgIniType) "." }, + { "defaultInstallProtocol", ArgInt, (void *) &appData.defProtocol, TRUE, (ArgIniType) 0 }, // [HGM] tournament options { "tourneyFile", ArgFilename, (void *) &appData.tourneyFile, FALSE, (ArgIniType) "" }, diff --git a/common.h b/common.h index 09ce693..55daf29 100644 --- a/common.h +++ b/common.h @@ -802,6 +802,7 @@ typedef struct { Boolean scoreWhite; Boolean pvSAN[ENGINES]; + int defProtocol; int recentEngines; char *recentEngineList; char *defEngDir; diff --git a/dialogs.c b/dialogs.c index 38b1d08..c1d0930 100644 --- a/dialogs.c +++ b/dialogs.c @@ -1568,7 +1568,9 @@ EngSel (int n, int sel) static void LoadEngineProc (int engineNr, char *title) { + int p = appData.defProtocol; if(*engineListFile) ParseSettingsFile(engineListFile, &engineListFile); // contains engine list + if(p >= 0 && p < 5) protocolChoice = protocols[p]; isUCI = isUSI = storeVariant = v1 = useNick = False; addToList = hasBook = True; // defaults secondEng = engineNr; if(engineLine) free(engineLine); engineLine = strdup("");