Make Fischer castling generally available
[xboard.git] / dialogs.c
index cfd09b8..92845b5 100644 (file)
--- a/dialogs.c
+++ b/dialogs.c
@@ -220,7 +220,7 @@ GenericReadout (Option *opts, int selected)
                    }
                    break;
                case EndMark:
-                   if(opts[i].target) // callback for implementing necessary actions on OK (like redraw)
+                   if(opts[i].target && selected != -2) // callback for implementing necessary actions on OK (like redraw)
                        res = ((OKCallback*) opts[i].target)(i);
                    break;
            default:
@@ -247,6 +247,7 @@ static void AddToTourney P((int n, int sel));
 static void CloneTourney P((void));
 static void ReplaceParticipant P((void));
 static void UpgradeParticipant P((void));
+static void PseudoOK P((void));
 
 static int
 MatchOK (int n)
@@ -306,6 +307,7 @@ static Option matchOptions[] = {
 { 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, SAME_ROW,    0, NULL, (void*) &PseudoOK, NULL, NULL, Button, N_("Continue Later") },
 { 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") },
@@ -327,6 +329,14 @@ UpgradeParticipant ()
 }
 
 static void
+PseudoOK ()
+{
+    GenericReadout(matchOptions, -2); // read all, but suppress calling of MatchOK
+    ASSIGN(appData.participants, engineName);
+    PopDown(MasterDlg); // early popdown to prevent FreezeUI called through MatchEvent from causing XtGrab warning
+}
+
+static void
 CloneTourney ()
 {
     FILE *f;
@@ -399,6 +409,7 @@ static Option generalOptions[] = {
 /* TRANSLATORS: the drop menu is used to drop a piece, e.g. during bughouse or editing a position */
 { 0,  0, 0, NULL, (void*) &appData.dropMenu, "", NULL, CheckBox, N_("Drop Menu") },
 { 0,  0, 0, NULL, (void*) &appData.variations, "", NULL, CheckBox, N_("Enable Variation Trees") },
+{ 0,  0, 0, NULL, (void*) &appData.headers, "", NULL, CheckBox, N_("Headers in Engine Output Window") },
 { 0,  0, 0, NULL, (void*) &appData.hideThinkingFromHuman, "", NULL, CheckBox, N_("Hide Thinking from Human") },
 { 0,  0, 0, NULL, (void*) &appData.highlightLastMove, "", NULL, CheckBox, N_("Highlight Last Move") },
 { 0,  0, 0, NULL, (void*) &appData.highlightMoveWithArrow, "", NULL, CheckBox, N_("Highlight with Arrow") },
@@ -522,6 +533,7 @@ Pick (int n)
 
        shuffleOpenings = FALSE; /* [HGM] shuffle: possible shuffle reset when we switch */
        startedFromPositionFile = FALSE; /* [HGM] loadPos: no longer valid in new variant */
+       appData.fischerCastling = FALSE; /* [HGM] fischer: no longer valid in new variant */
        appData.NrRanks = ranksTmp;
        appData.NrFiles = filesTmp;
        appData.holdingsSize = sizeTmp;
@@ -1444,6 +1456,7 @@ ShuffleOK (int n)
 
 static Option shuffleOptions[] = {
   {   0,  0,    0, NULL, (void*) &shuffleOpenings, NULL, NULL, CheckBox, N_("shuffle") },
+  {   0,  0,    0, NULL, (void*) &appData.fischerCastling, NULL, NULL, CheckBox, N_("Fischer castling") },
   { 0,-1,2000000000, NULL, (void*) &appData.defaultFrcPosition, "", NULL, Spin, N_("Start-position number:") },
   {   0,  0,    0, NULL, (void*) &SetRandom, NULL, NULL, Button, N_("randomize") },
   {   0,  SAME_ROW,    0, NULL, (void*) &SetRandom, NULL, NULL, Button, N_("pick fixed") },