Add final piece count to search criteria
[xboard.git] / winboard / woptions.c
index 977c0c6..2c92e4d 100644 (file)
@@ -2535,6 +2535,7 @@ LoadOptions(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
     SetDlgItemInt(hDlg, OPT_Stretch, appData.stretch, FALSE);\r
     CheckDlgButton(hDlg, OPT_Reversed, appData.ignoreColors);\r
     CheckDlgButton(hDlg, OPT_Mirror, appData.findMirror);\r
+    SetDlgItemText(hDlg, OPT_Range,  "");\r
     switch (appData.searchMode) {\r
     case 1:\r
       CheckDlgButton(hDlg, OPT_Exact, TRUE);\r
@@ -2579,6 +2580,10 @@ LoadOptions(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
       appData.searchMode = LoadOptionsWhichRadio(hDlg);\r
       appData.ignoreColors = IsDlgButtonChecked(hDlg, OPT_Reversed);\r
       appData.findMirror   = IsDlgButtonChecked(hDlg, OPT_Mirror);\r
+      appData.eloThreshold1 = GetDlgItemText(hDlg, OPT_Range, buf, MSG_SIZ);\r
+      appData.minPieces = appData.maxPieces = 0;\r
+      sscanf(buf, "%d-%d", appData.minPieces, appData.maxPieces);\r
+      if(appData.maxPieces < appData.minPieces) appData.maxPieces = appData.minPieces;\r
       EndDialog(hDlg, TRUE);\r
       return TRUE;\r
 \r