updated parser.c form parser.l
[xboard.git] / xoptions.c
index b5368a3..6e995ea 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * xoptions.c -- Move list window, part of X front end for XBoard
  *
- * Copyright 2000, 2009, 2010 Free Software Foundation, Inc.
+ * Copyright 2000, 2009, 2010, 2011 Free Software Foundation, Inc.
  * ------------------------------------------------------------------------
  *
  * GNU XBoard is free software: you can redistribute it and/or modify
@@ -966,21 +966,23 @@ struct NewVarButton buttonDesc[] = {
     {N_("give-away"),         "#FFFFBF", 0, VariantGiveaway},
     {N_("losers"),            "#FFFFBF", 0, VariantLosers},
     {N_("fairy"),             "#BFBFBF", 0, VariantFairy},
+    {N_("Seirawan"),          "#FFBFBF", 0, VariantSChess},
     {N_("Superchess"),        "#FFBFBF", 0, VariantSuper},
     {N_("crazyhouse"),        "#FFBFBF", 0, VariantCrazyhouse},
     {N_("bughouse"),          "#FFBFBF", 0, VariantBughouse},
     {N_("shogi (9x9)"),       "#BFFFFF", 0, VariantShogi},
     {N_("xiangqi (9x10)"),    "#BFFFFF", 0, VariantXiangqi},
     {N_("courier (12x8)"),    "#BFFFBF", 0, VariantCourier},
-    {N_("janus (10x8)"),      "#BFBFFF", 0, VariantJanus},
     {N_("Capablanca (10x8)"), "#BFBFFF", 0, VariantCapablanca},
-    {N_("CRC (10x8)"),        "#BFBFFF", 0, VariantCapaRandom},
 #ifdef GOTHIC
     {N_("Gothic (10x8)"),     "#BFBFFF", 0, VariantGothic},
 #endif
+    {N_("janus (10x8)"),      "#BFBFFF", 0, VariantJanus},
+    {N_("CRC (10x8)"),        "#BFBFFF", 0, VariantCapaRandom},
 #ifdef FALCON
     {N_("Falcon (10x8)"),     "#BFBFFF", 0, VariantFalcon},
 #endif
+    {N_("Spartan"),           "#FF0000", 0, VariantSpartan},
     {NULL,                0, 0, (VariantClass) 0}
 };
 
@@ -1086,6 +1088,7 @@ void NewVariantPopUp()
        XtSetArg(args[j], XtNradioData, i+1); j++;
        XtSetArg(args[j], XtNbackground, buttonColor); j++;
        XtSetArg(args[j], XtNstate, gameInfo.variant == buttonDesc[i].variant); j++;
+       XtSetArg(args[j], XtNsensitive, appData.noChessProgram || strstr(first.variants, VariantName(buttonDesc[i].variant))); j++;
        buttonDesc[i].handle = last =
            XtCreateManagedWidget(buttonDesc[i].name, toggleWidgetClass, form, args, j);
     }
@@ -1432,7 +1435,7 @@ void SettingsCallback(w, client_data, call_data)
                    XtSetArg(args[0], XtNstring, &val);
                    XtGetValues(currentCps->option[i].handle, args, 1);
                    if(strcmp(currentCps->option[i].textValue, val)) {
-                     safeStrCpy(currentCps->option[i].textValue, val, sizeof(currentCps->option[i].textValue)/sizeof(currentCps->option[i].textValue[0]));
+                     safeStrCpy(currentCps->option[i].textValue, val, MSG_SIZ - (currentCps->option[i].textValue - currentCps->option[i].name) );
                      snprintf(buf, MSG_SIZ,  "option %s=%s\n", currentCps->option[i].name, val);
                      SendToProgram(buf, currentCps);
                    }
@@ -1745,6 +1748,7 @@ void SecondSettingsProc(w, event, prms, nprms)
      String *prms;
      Cardinal *nprms;
 {
+   if(WaitForSecond(SettingsMenuIfReady)) return;
    SettingsPopUp(&second);
 }