From 7930f136b8deed922091be0a99c799dd2d11b9c5 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Thu, 29 Nov 2012 21:05:15 +0100 Subject: [PATCH] Add 'Continue Later' button in Tournament dialog (WB) This button makes it possible to accept the values specified in the dialog without immediately starting the tournament (as OK does), so you can re-open the dialog later, and OK it then. --- winboard/wsettings.c | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletions(-) diff --git a/winboard/wsettings.c b/winboard/wsettings.c index 65f9e78..53d6b16 100644 --- a/winboard/wsettings.c +++ b/winboard/wsettings.c @@ -762,7 +762,7 @@ char *tfName; int MatchOK() { - if(autoinc) appData.loadGameIndex = appData.loadPositionIndex = -(twice + 1); + 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(swiss) { appData.defaultMatchGames = 1; appData.tourneyType = -1; } if(CreateTourney(tfName) && !matchMode) { // CreateTourney reloads original settings if file already existed @@ -772,6 +772,19 @@ int MatchOK() return matchMode || !appData.participants[0]; // if we failed to create and are not in playing, forbid popdown if there are participants } +void PseudoOK(HWND hDlg) +{ + void (*saveOK)(); + saveOK = okFunc; okFunc = 0; + GetOptionValues(hDlg, activeCps, activeList); + EndDialog( hDlg, 0 ); + comboCallback = NULL; activeCps = NULL; + + 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(swiss) { appData.defaultMatchGames = 1; appData.tourneyType = -1; } +} + char *GetParticipants(HWND hDlg) { int len = GetWindowTextLength(GetDlgItem(hDlg, 2001+2*0)) + 1; @@ -844,6 +857,7 @@ Option tourneyOptions[] = { { 0, 0, 0, NULL, (void*) &TimeControlOptionsPopup, "", NULL, Button, N_("Time Control...") }, { 0, 0, 0, NULL, (void*) &UciOptionsPopup, "", NULL, Button, N_("Common Engine...") }, { 0, 0, 0, NULL, (void*) &Inspect, "", NULL, Button, N_("Clone Tourney") }, + { 0, 0, 0, NULL, (void*) &PseudoOK, "", NULL, Button, N_("Continue Later") }, { 0, 0, 0, NULL, (void*) &MatchOK, "", NULL, EndMark , "" } }; -- 1.7.0.4