X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwsettings.c;h=c825d248eef54393e3c32902e1531c71efe4b452;hb=ebd7f78161504e46896f7d96bb41e29714b2fd53;hp=bbf9003605e46201f6719ac7eb6ff517822dd48c;hpb=0278ebc80411a20fd23303156285e55ce8d2b0a5;p=xboard.git diff --git a/winboard/wsettings.c b/winboard/wsettings.c index bbf9003..c825d24 100644 --- a/winboard/wsettings.c +++ b/winboard/wsettings.c @@ -456,6 +456,7 @@ GetOptionValues(HWND hDlg, ChessProgramState *cps, Option *optionList) } char *defaultExt[] = { NULL, "pgn", "fen", "exe", "trn", "bin", "log", "ini" }; +HWND settingsDlg; LRESULT CALLBACK SettingsProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { @@ -468,7 +469,7 @@ LRESULT CALLBACK SettingsProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa // CenterWindow(hDlg, GetWindow(hDlg, GW_OWNER)); SetOptionValues(hDlg, activeCps, activeList); - + settingsDlg = hDlg; SetFocus(GetDlgItem(hDlg, IDCANCEL)); break; @@ -478,12 +479,12 @@ LRESULT CALLBACK SettingsProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa case IDOK: if(!GetOptionValues(hDlg, activeCps, activeList)) return FALSE; EndDialog( hDlg, 0 ); - comboCallback = NULL; activeCps = NULL; + comboCallback = NULL; activeCps = NULL; settingsDlg = NULL; return TRUE; case IDCANCEL: EndDialog( hDlg, 1 ); - comboCallback = NULL; activeCps = NULL; + comboCallback = NULL; activeCps = NULL; settingsDlg = NULL; return TRUE; default: @@ -692,6 +693,19 @@ EngineOptionsPopup(HWND hwnd, ChessProgramState *cps) return; } +void +RefreshSettingsDialog (ChessProgramState *cps, int val) +{ + int isUp = (settingsDlg != NULL); + if(val == 1) { + if(activeCps == cps && isUp) SetOptionValues(settingsDlg, cps, activeList); + return; + } + if(settingsDlg) EndDialog(settingsDlg, 1); + comboCallback = NULL; activeCps = NULL; settingsDlg = NULL; + if(val == 3 || isUp) EngineOptionsPopup(hwndMain, cps); +} + int EnterGroup P((HWND hDlg)); static int engineNr, selected; @@ -887,6 +901,7 @@ int MatchOK() void PseudoOK(HWND hDlg) { + if(matchMode) return; okFunc = 0; GetOptionValues(hDlg, activeCps, activeList); EndDialog( hDlg, 0 ); @@ -894,7 +909,12 @@ void PseudoOK(HWND hDlg) if(autoinc) appData.loadGameIndex = appData.loadPositionIndex = -(twice + 1); else if(!appData.loadGameFile[0]) appData.loadGameIndex = -2*twice; // kludge to pass value of "twice" for use in GUI book + if(!autoinc && !twice) { // prevent auto-inc being remembered in index value if checkboxes not ticked + if(appData.loadGameIndex < 0) appData.loadGameIndex = 0; + if(appData.loadPositionIndex < 0) appData.loadPositionIndex = 0; + } if(swiss) { appData.defaultMatchGames = 1; appData.tourneyType = -1; } + ASSIGN(appData.tourneyFile, tfName); } char *GetParticipants(HWND hDlg)