X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwsettings.c;h=c825d248eef54393e3c32902e1531c71efe4b452;hb=860250c0cf8a2ed671862d447e710686b539945a;hp=f5a1f9bbeb73705d56ffcc01f11e17693df39039;hpb=4e99bea34045f95fa146c9179ad378435e15d9fa;p=xboard.git diff --git a/winboard/wsettings.c b/winboard/wsettings.c index f5a1f9b..c825d24 100644 --- a/winboard/wsettings.c +++ b/winboard/wsettings.c @@ -1,7 +1,8 @@ /* * woptions.h -- Options dialog box routines for WinBoard * - * Copyright 2003, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Free Software Foundation, Inc. + * Copyright 2003, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free + * Software Foundation, Inc. * * ------------------------------------------------------------------------ * @@ -455,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) { @@ -467,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; @@ -477,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: @@ -691,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; @@ -886,6 +901,7 @@ int MatchOK() void PseudoOK(HWND hDlg) { + if(matchMode) return; okFunc = 0; GetOptionValues(hDlg, activeCps, activeList); EndDialog( hDlg, 0 );