X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwsettings.c;h=10bb4270853df572e6fd412c1d384ab207011277;hb=657beffbe986b3969f625dfe25203dae521ba797;hp=83472f5e6e3d7e17520899dd30583172f0f67445;hpb=53c1e5069c952812b429d7c141cf201edf6afaae;p=xboard.git diff --git a/winboard/wsettings.c b/winboard/wsettings.c index 83472f5..10bb427 100644 --- a/winboard/wsettings.c +++ b/winboard/wsettings.c @@ -366,7 +366,7 @@ GetOptionValues(HWND hDlg, ChessProgramState *cps, Option *optionList) if(!cps) { char *p; p = (optionList[j].type != FileName ? strdup(text) : InterpretFileName(text, homeDir)); // all files relative to homeDir! - FREE(*(char**)optionList[j].target); *(char**)optionList[j].target = p; + FREE(*(char**)optionList[j].target); *(char**)optionList[j].target = p; free(text); text = p; while(*p++ = *text++) if(p[-1] == '\r') p--; // crush CR break; @@ -480,6 +480,7 @@ LRESULT CALLBACK SettingsProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa } if(j < 0) break; if(comboCallback && activeList[j].type == ComboBox && HIWORD(wParam) == CBN_SELCHANGE) { + if(j > 5) break; // Yegh! Must solve problem with more than one ombobox in dialog (*comboCallback)(hDlg); break; } else @@ -628,6 +629,7 @@ EngineOptionsPopup(HWND hwnd, ChessProgramState *cps) int InstallOK() { + if(engineLine[0] == '#') { DisplayError(_("Select single engine from the group"), 0); return 0; } if(isUCCI) isUCI = 2; if(engineChoice[0] == engineNr[0][0]) Load(&first, 0); else Load(&second, 1); return 1; @@ -670,10 +672,27 @@ GenericPopup(HWND hwnd, Option *optionList) return; } -void LoadEnginePopUp(HWND hwnd) +int +EnterGroup(HWND hDlg) { - int n=0; + char buf[MSG_SIZ]; + HANDLE hwndCombo = GetDlgItem(hDlg, 2001+2*1); + int i = ComboBox_GetCurSel(hwndCombo); + if(i == 0) buf[0] = NULLCHAR; // back to top level + else if(engineList[i][0] == '#') safeStrCpy(buf, engineList[i], MSG_SIZ); // group header, open group + else return 0; // normal line, select engine + installOptions[0].max = NamesToList(firstChessProgramNames, engineList, engineMnemonic, buf); // replace list by only the group contents + SendMessage(hwndCombo, CB_RESETCONTENT, 0, 0); + SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM) buf); + for(i=1; i