X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwsettings.c;h=3ceaf3421d8c1821baa8d3175fc55e973058f65c;hb=c856b0337e03ec6ef848a1eae6f33c2071683133;hp=bfad5880333ffdf3041a080621d17ff504dbc370;hpb=01bccb194cfca30703d9b49b05a6f2837d67f0f0;p=xboard.git diff --git a/winboard/wsettings.c b/winboard/wsettings.c index bfad588..3ceaf34 100644 --- a/winboard/wsettings.c +++ b/winboard/wsettings.c @@ -694,6 +694,7 @@ char *tfName; int MatchOK() { if(autoinc) appData.loadGameIndex = appData.loadPositionIndex = -(twice + 1); + 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 MatchEvent(2); @@ -726,6 +727,26 @@ void UpgradeParticipant(HWND hDlg) Substitute(participants, FALSE); } +void Inspect(HWND hDlg) +{ + FILE *f; + char name[MSG_SIZ]; + GetDlgItemText(hDlg, 2001+2*1, name, MSG_SIZ ); + if(name && name[0] && (f = fopen(name, "r")) ) { + char *saveSaveFile; + saveSaveFile = appData.saveGameFile; appData.saveGameFile = NULL; // this is a persistent option, protect from change + ParseArgsFromFile(f); + autoinc = ((appData.loadPositionFile[0] ? appData.loadGameIndex : appData.loadPositionIndex) < 0); + twice = ((appData.loadPositionFile[0] ? appData.loadGameIndex : appData.loadPositionIndex) == -2); + swiss = appData.tourneyType < 0; + SetOptionValues(hDlg, NULL, activeList); + FREE(appData.saveGameFile); appData.saveGameFile = saveSaveFile; + } +} + +void TimeControlOptionsPopup P((HWND hDlg)); +void UciOptionsPopup P((HWND hDlg)); + Option tourneyOptions[] = { { 0, 0, 4, NULL, (void*) &tfName, "", NULL, FileName, N_("Tournament file:") }, { 30, 0, 0, NULL, NULL, NULL, NULL, Label, N_("If you specify an existing file, the rest of this dialog will be ignored.") }, @@ -749,6 +770,9 @@ Option tourneyOptions[] = { { 0, 0, 1000000000, NULL, (void*) &appData.matchPause, "", NULL, Spin, N_("Pause between Games (ms):") }, { 0, 0, 0, NULL, (void*) &ReplaceParticipant, "", NULL, Button, N_("Replace Engine") }, { 0, 0, 0, NULL, (void*) &UpgradeParticipant, "", NULL, Button, N_("Upgrade Engine") }, + { 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_("Inspect TourneyFile") }, { 0, 0, 0, NULL, (void*) &MatchOK, "", NULL, EndMark , "" } }; @@ -771,7 +795,7 @@ void TourneyPopup(HWND hwnd) NamesToList(firstChessProgramNames, engineList, engineMnemonic); comboCallback = &AddToTourney; autoinc = appData.loadGameIndex < 0 || appData.loadPositionIndex < 0; - twice = TRUE; swiss = appData.tourneyType < 0; + twice = FALSE; swiss = appData.tourneyType < 0; while(engineList[n]) n++; tourneyOptions[3].max = n-1; snprintf(title, MSG_SIZ, _("Tournament and Match Options")); ASSIGN(tfName, appData.tourneyFile[0] ? appData.tourneyFile : MakeName(appData.defName));