{
ASSIGN(appData.participants, engineName);
if(!CreateTourney(tfName) || matchMode) return matchMode || !appData.participants[0];
- PopDown(TransientDlg); // early popdown to prevent FreezeUI called through MatchEvent from causing XtGrab warning
+ PopDown(MasterDlg); // early popdown to prevent FreezeUI called through MatchEvent from causing XtGrab warning
MatchEvent(2); // start tourney
return FALSE; // no double PopDown!
}
+static void
+DoTimeControl(int n)
+{
+ TimeControlProc();
+}
+
+static void
+DoCommonEngine(int n)
+{
+ UciMenuProc();
+}
+
+static void
+DoGeneral(int n)
+{
+ OptionsProc();
+}
+
static Option matchOptions[] = {
{ 0, 0, 0, NULL, (void*) &tfName, ".trn", NULL, FileName, N_("Tournament file: ") },
{ 0, 0, 0, NULL, NULL, "", NULL, Label, N_("For concurrent playing of tourney with multiple XBoards:") },
{ 0, -2, 1000000000, NULL, (void*) &appData.loadPositionIndex, "", NULL, Spin, N_("Position Number (-1 or -2 = Auto-Increment):") },
{ 0, 0, 1000000000, NULL, (void*) &appData.rewindIndex, "", NULL, Spin, N_("Rewind Index after this many Games (0 = never):") },
{ 0, 0, 0, NULL, (void*) &appData.defNoBook, "", NULL, CheckBox, N_("Disable own engine books by default") },
+{ 0, 0, 0, NULL, (void*) &DoTimeControl, NULL, NULL, Button, N_("Time Control") },
+{ 0, SAME_ROW, 0, NULL, (void*) &DoCommonEngine, NULL, NULL, Button, N_("Common Engine") },
+{ 0, SAME_ROW, 0, NULL, (void*) &DoGeneral, NULL, NULL, Button, N_("General Options") },
{ 0, 0, 0, NULL, (void*) &ReplaceParticipant, NULL, NULL, Button, N_("Replace Engine") },
{ 0, SAME_ROW, 0, NULL, (void*) &UpgradeParticipant, NULL, NULL, Button, N_("Upgrade Engine") },
{ 0, SAME_ROW, 0, NULL, (void*) &CloneTourney, NULL, NULL, Button, N_("Clone Tourney") },
ASSIGN(tfName, appData.tourneyFile[0] ? appData.tourneyFile : MakeName(appData.defName));
ASSIGN(engineName, appData.participants);
ASSIGN(engineMnemonic[0], "");
- GenericPopUp(matchOptions, _("Tournament Options"), TransientDlg, BoardWindow, MODAL, 0);
+ GenericPopUp(matchOptions, _("Tournament Options"), MasterDlg, BoardWindow, MODAL, 0);
}
// ------------------------------------------- General Options --------------------------------------------------
// I guess BrowserDlg will be abandoned, as GTK has a better browser of its own
if(shellUp[BrowserDlg] && dlg != BrowserDlg || dialogError) return True; // prevent closing dialog when it has an open file-browse daughter
#else
- if(browserUp || dialogError && dlg != FatalDlg) return True; // prevent closing dialog when it has an open file-browse or error-popup daughter
+ if(browserUp || dialogError && dlg != FatalDlg || dlg == MasterDlg && shellUp[TransientDlg])
+ return True; // prevent closing dialog when it has an open file-browse, transient or error-popup daughter
#endif
shells[dlg] = w; // make sure we pop down the right one in case of multiple instances
if(wp[dlgNr]) gtk_window_move(GTK_WINDOW(shells[dlgNr]), wp[dlgNr]->x, wp[dlgNr]->y);
return 0;
}
+ if(dlgNr == TransientDlg && parent == BoardWindow && shellUp[MasterDlg]) parent = MasterDlg; // MasterDlg can always take role of main window
dialogOptions[dlgNr] = option; // make available to callback
// post currentOption globally, so Spin and Combo callbacks can already use it
if(--j < opt->min) return;
} else return;
snprintf(buf, MSG_SIZ, "%d", j);
- SetWidgetText(opt, buf, TransientDlg);
+ SetWidgetText(opt, buf, shellUp[TransientDlg] ? TransientDlg : MasterDlg);
}
static void
{ // to cause popdown through a translation (Delete Window button!)
int dlg = atoi(prms[0]);
Widget sh = shells[dlg];
- if(shellUp[BrowserDlg] && dlg != BrowserDlg || dialogError) return; // prevent closing dialog when it has an open file-browse daughter
+ if(shellUp[BrowserDlg] && dlg != BrowserDlg || dialogError || dlg == MasterDlg && shellUp[TransientDlg])
+ return; // prevent closing dialog when it has an open file-browse or transient daughter
shells[dlg] = w;
PopDown(dlg);
shells[dlg] = sh; // restore
shellUp[dlgNr] = True;
return 0;
}
+ if(dlgNr == TransientDlg && parent == BoardWindow && shellUp[MasterDlg]) parent = MasterDlg; // MasterDlg can always take role of main window
dialogOptions[dlgNr] = option; // make available to callback
// post currentOption globally, so Spin and Combo callbacks can already use it