From: H.G. Muller Date: Thu, 23 Feb 2012 19:01:55 +0000 (+0100) Subject: Use combobox line for recent engines when available X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=71ad75d24941a489a162c6906998f656a7c398be;p=xboard.git Use combobox line for recent engines when available The entry made in the -recentEngineList for the startup engine was derived from the -fcp value, but this would ignore a possible nickname. In WinBoard we now use the full combobox line to derive the entry. --- diff --git a/backend.c b/backend.c index 3cd2f0c..2553afb 100644 --- a/backend.c +++ b/backend.c @@ -1485,6 +1485,8 @@ MatchEvent (int mode) NextMatchGame(); } +char *comboLine = NULL; // [HGM] recent: WinBoard's first-engine combobox line + void InitBackEnd3 P((void)) { @@ -1498,7 +1500,7 @@ InitBackEnd3 P((void)) free(programVersion); programVersion = (char*) malloc(8 + strlen(PACKAGE_STRING) + strlen(first.tidy)); sprintf(programVersion, "%s + %s", PACKAGE_STRING, first.tidy); - FloatToFront(&appData.recentEngineList, appData.firstChessProgram); + FloatToFront(&appData.recentEngineList, comboLine ? comboLine : appData.firstChessProgram); } if (appData.icsActive) { diff --git a/backend.h b/backend.h index 561a0b3..3fef1ea 100644 --- a/backend.h +++ b/backend.h @@ -436,6 +436,7 @@ extern ChessProgramStats programStats; extern int opponentKibitzes; // used by wengineo.c extern int errorExitStatus; extern char *recentEngines; +extern char *comboLine; void SettingsPopUp P((ChessProgramState *cps)); // [HGM] really in front-end, but CPS not known in frontend.h int WaitForEngine P((ChessProgramState *cps, DelayedEventCallback x)); void Load P((ChessProgramState *cps, int n)); diff --git a/winboard/winboard.c b/winboard/winboard.c index 5c9bc1c..8d8b70e 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -6181,6 +6181,7 @@ StartupDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) safeStrCpy(buf, "/fcp=", sizeof(buf)/sizeof(buf[0]) ); GetDlgItemText(hDlg, OPT_ChessEngineName, buf + strlen(buf), sizeof(buf) - strlen(buf)); p = buf; + comboLine = strdup(p+5); // [HGM] recent: remember complete line of first combobox ParseArgs(StringGet, &p); safeStrCpy(buf, singleList ? "/fcp=" : "/scp=", sizeof(buf)/sizeof(buf[0]) ); GetDlgItemText(hDlg, OPT_SecondChessEngineName, buf + strlen(buf), sizeof(buf) - strlen(buf));