From: H.G. Muller Date: Wed, 4 May 2011 13:30:00 +0000 (+0200) Subject: Make option to draw second engine from first list X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=3b38c566e943a0a43f56148108fcb65b794afc56;p=xboard.git Make option to draw second engine from first list --- diff --git a/args.h b/args.h index 42603ba..2471d13 100644 --- a/args.h +++ b/args.h @@ -102,6 +102,7 @@ typedef struct { IcsTextMenuEntry icsTextMenuEntry[ICS_TEXT_MENU_SIZE]; int junk; +Boolean singleList; void EnsureOnScreen(int *x, int *y, int minX, int minY); char StringGet(void *getClosure); @@ -479,10 +480,11 @@ ArgDescriptor argDescriptors[] = { { "-cp", ArgFalse, (void *) &chessProgram, FALSE, INVALID }, { "icsMenu", ArgString, (void *) &icsTextMenuString, TRUE, (ArgIniType) ICS_TEXT_MENU_DEFAULT }, { "icsNames", ArgString, (void *) &icsNames, TRUE, (ArgIniType) ICS_NAMES }, + { "singleEngineList", ArgBoolean, (void *) &singleList, !XBOARD, (ArgIniType) FALSE }, { "firstChessProgramNames", ArgString, (void *) &firstChessProgramNames, TRUE, (ArgIniType) FCP_NAMES }, { "secondChessProgramNames", ArgString, (void *) &secondChessProgramNames, - TRUE, (ArgIniType) SCP_NAMES }, + !XBOARD, (ArgIniType) SCP_NAMES }, { "initialMode", ArgString, (void *) &appData.initialMode, FALSE, (ArgIniType) "" }, { "mode", ArgString, (void *) &appData.initialMode, FALSE, INVALID }, { "variant", ArgString, (void *) &appData.variant, FALSE, (ArgIniType) "normal" }, diff --git a/winboard/winboard.c b/winboard/winboard.c index 8a16fb4..fc0f331 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -6071,8 +6071,8 @@ StartupDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) appData.firstChessProgram, "fd", appData.firstDirectory, firstChessProgramNames); InitEngineBox(hDlg, GetDlgItem(hDlg, OPT_SecondChessEngineName), - appData.secondChessProgram, "sd", appData.secondDirectory, - secondChessProgramNames); + appData.secondChessProgram, singleList ? "fd" : "sd", appData.secondDirectory, + singleList ? firstChessProgramNames : secondChessProgramNames); //[HGM] single: use first list in second combo hwndCombo = GetDlgItem(hDlg, OPT_ChessServerName); InitComboStringsFromOption(hwndCombo, icsNames); snprintf(buf, MSG_SIZ, "%s /icsport=%s", appData.icsHost, appData.icsPort); @@ -6109,10 +6109,12 @@ StartupDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) GetDlgItemText(hDlg, OPT_ChessEngineName, buf + strlen(buf), sizeof(buf) - strlen(buf)); p = buf; ParseArgs(StringGet, &p); - safeStrCpy(buf, "/scp=", sizeof(buf)/sizeof(buf[0]) ); + safeStrCpy(buf, singleList ? "/fcp=" : "/scp=", sizeof(buf)/sizeof(buf[0]) ); GetDlgItemText(hDlg, OPT_SecondChessEngineName, buf + strlen(buf), sizeof(buf) - strlen(buf)); - p = buf; + p = buf; + SwapEngines(singleList); // temporarily swap first and second, to load a second 'first', ... ParseArgs(StringGet, &p); + SwapEngines(singleList); // ... and then make it 'second' appData.noChessProgram = FALSE; appData.icsActive = FALSE; } else if (IsDlgButtonChecked(hDlg, OPT_ChessServer)) {