Increas number of engine-defined variants to 15 (WB)
[xboard.git] / winboard / wsettings.c
index 215ea18..eb04e41 100644 (file)
@@ -1,7 +1,7 @@
 /*\r
  * woptions.h -- Options dialog box routines for WinBoard\r
  *\r
- * Copyright 2003, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc.\r
+ * Copyright 2003, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Free Software Foundation, Inc.\r
  *\r
  * ------------------------------------------------------------------------\r
  *\r
@@ -575,8 +575,8 @@ void AddOption(int x, int y, Control type, int i)
     int extra, num = ES_NUMBER;\r
 \r
     switch(type) {\r
-//     case Slider+100:\r
-//         num = 0; // needs text control for accepting negative numbers\r
+       case Spin+100:\r
+           num = 0; // needs text control for accepting negative numbers\r
        case Slider:\r
        case Spin:\r
            AddControl(x, y+1, 95, 9, 0x0082, SS_ENDELLIPSIS | WS_VISIBLE | WS_CHILD, i);\r
@@ -886,6 +886,7 @@ int MatchOK()
 \r
 void PseudoOK(HWND hDlg)\r
 {\r
+    if(matchMode) return;\r
     okFunc = 0;\r
     GetOptionValues(hDlg, activeCps, activeList);\r
     EndDialog( hDlg, 0 );\r
@@ -893,7 +894,12 @@ void PseudoOK(HWND hDlg)
 \r
     if(autoinc) appData.loadGameIndex = appData.loadPositionIndex = -(twice + 1); else\r
     if(!appData.loadGameFile[0]) appData.loadGameIndex = -2*twice; // kludge to pass value of "twice" for use in GUI book\r
+    if(!autoinc && !twice) { // prevent auto-inc being remembered in index value if checkboxes not ticked\r
+       if(appData.loadGameIndex < 0) appData.loadGameIndex = 0;\r
+       if(appData.loadPositionIndex < 0) appData.loadPositionIndex = 0;\r
+    }\r
     if(swiss) { appData.defaultMatchGames = 1; appData.tourneyType = -1; }\r
+    ASSIGN(appData.tourneyFile, tfName);\r
 }\r
 \r
 char *GetParticipants(HWND hDlg)\r