projects
/
xboard.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e2f382e
)
Implement engine-requested settings-popup WB
author
H.G.Muller
<hgm@hgm-xboard.(none)>
Mon, 1 Feb 2016 19:45:14 +0000
(20:45 +0100)
committer
H.G.Muller
<hgm@hgm-xboard.(none)>
Mon, 1 Feb 2016 20:50:39 +0000
(21:50 +0100)
winboard/wsettings.c
patch
|
blob
|
history
diff --git
a/winboard/wsettings.c
b/winboard/wsettings.c
index
eb04e41
..
8790bcc
100644
(file)
--- a/
winboard/wsettings.c
+++ b/
winboard/wsettings.c
@@
-455,6
+455,7
@@
GetOptionValues(HWND hDlg, ChessProgramState *cps, Option *optionList)
}
\r
\r
char *defaultExt[] = { NULL, "pgn", "fen", "exe", "trn", "bin", "log", "ini" };
\r
}
\r
\r
char *defaultExt[] = { NULL, "pgn", "fen", "exe", "trn", "bin", "log", "ini" };
\r
+HWND settingsDlg;
\r
\r
LRESULT CALLBACK SettingsProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
\r
{
\r
\r
LRESULT CALLBACK SettingsProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
\r
{
\r
@@
-467,7
+468,7
@@
LRESULT CALLBACK SettingsProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa
\r
// CenterWindow(hDlg, GetWindow(hDlg, GW_OWNER));
\r
SetOptionValues(hDlg, activeCps, activeList);
\r
\r
// CenterWindow(hDlg, GetWindow(hDlg, GW_OWNER));
\r
SetOptionValues(hDlg, activeCps, activeList);
\r
-
\r
+ settingsDlg = hDlg;
\r
SetFocus(GetDlgItem(hDlg, IDCANCEL));
\r
\r
break;
\r
SetFocus(GetDlgItem(hDlg, IDCANCEL));
\r
\r
break;
\r
@@
-477,12
+478,12
@@
LRESULT CALLBACK SettingsProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa
case IDOK:
\r
if(!GetOptionValues(hDlg, activeCps, activeList)) return FALSE;
\r
EndDialog( hDlg, 0 );
\r
case IDOK:
\r
if(!GetOptionValues(hDlg, activeCps, activeList)) return FALSE;
\r
EndDialog( hDlg, 0 );
\r
- comboCallback = NULL; activeCps = NULL;
\r
+ comboCallback = NULL; activeCps = NULL;
settingsDlg = NULL;
\r
return TRUE;
\r
\r
case IDCANCEL:
\r
EndDialog( hDlg, 1 );
\r
return TRUE;
\r
\r
case IDCANCEL:
\r
EndDialog( hDlg, 1 );
\r
- comboCallback = NULL; activeCps = NULL;
\r
+ comboCallback = NULL; activeCps = NULL;
settingsDlg = NULL;
\r
return TRUE;
\r
\r
default:
\r
return TRUE;
\r
\r
default:
\r
@@
-691,6
+692,19
@@
EngineOptionsPopup(HWND hwnd, ChessProgramState *cps)
return;
\r
}
\r
\r
return;
\r
}
\r
\r
+void
\r
+RefreshSettingsDialog (ChessProgramState *cps, int val)
\r
+{
\r
+ int isUp = (settingsDlg != NULL);
\r
+ if(val == 1) {
\r
+ if(activeCps == cps && isUp) SetOptionValues(settingsDlg, cps, activeList);
\r
+ return;
\r
+ }
\r
+ if(settingsDlg) EndDialog(settingsDlg, 1);
\r
+ comboCallback = NULL; activeCps = NULL; settingsDlg = NULL;
\r
+ if(val == 3 || isUp) EngineOptionsPopup(hwndMain, cps);
\r
+}
\r
+
\r
int EnterGroup P((HWND hDlg));
\r
\r
static int engineNr, selected;
\r
int EnterGroup P((HWND hDlg));
\r
\r
static int engineNr, selected;
\r