Implement auto-creation of ICS logon file
[xboard.git] / winboard / woptions.c
index 3aeab42..cfd5cdb 100644 (file)
@@ -1,7 +1,7 @@
 /*\r
  * woptions.c -- Options dialog box routines for WinBoard\r
  *\r
- * Copyright 2000, 2009, 2010 Free Software Foundation, Inc.\r
+ * Copyright 2000, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.\r
  *\r
  * Enhancements Copyright 2005 Alessandro Scotti\r
  *\r
@@ -135,6 +135,28 @@ VOID SetLoadOptionEnables(HWND hDlg);
 VOID SetSaveOptionEnables(HWND hDlg);\r
 VOID SetTimeControlEnables(HWND hDlg);\r
 \r
+char *\r
+InterpretFileName(char *buf, char *homeDir)\r
+{ // [HGM] file name relative to homeDir. (Taken out of SafeOptionsDialog, because it is generally useful)\r
+  char *result = NULL;\r
+  if ((isalpha(buf[0]) && buf[1] == ':') ||\r
+    (buf[0] == '\\' && buf[1] == '\\')) {\r
+    return strdup(buf);\r
+  } else {\r
+    char buf2[MSG_SIZ], buf3[MSG_SIZ];\r
+    char *dummy;\r
+    GetCurrentDirectory(MSG_SIZ, buf3);\r
+    SetCurrentDirectory(homeDir);\r
+    if (GetFullPathName(buf, MSG_SIZ, buf2, &dummy)) {\r
+      result = strdup(buf2);\r
+    } else {\r
+      result = strdup(buf);\r
+    }\r
+    SetCurrentDirectory(buf3);\r
+  }\r
+  return result;\r
+}\r
+\r
 /*---------------------------------------------------------------------------*\\r
  *\r
  * General Options Dialog functions\r
@@ -494,7 +516,7 @@ BoardOptionsWhichRadio(HWND hDlg)
 LRESULT CALLBACK\r
 BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
 {\r
-  static Boolean  mono, white, flip;\r
+  static Boolean  mono, white, flip, fonts, bitmaps, grid;\r
   static BoardSize size;\r
   static COLORREF lsc, dsc, wpc, bpc, hsc, phc;\r
   static HBITMAP pieces[3];\r
@@ -571,6 +593,15 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
     if (appData.upsideDown)\r
       CheckDlgButton(hDlg, OPT_UpsideDown, TRUE);\r
 \r
+    if (appData.useBitmaps)\r
+      CheckDlgButton(hDlg, OPT_Bitmaps, TRUE);\r
+\r
+    if (appData.useFont)\r
+      CheckDlgButton(hDlg, OPT_PieceFont, TRUE);\r
+\r
+    if (appData.overrideLineGap >= 0)\r
+      CheckDlgButton(hDlg, OPT_Grid, TRUE);\r
+\r
     pieces[0] = DoLoadBitmap(hInst, "n", SAMPLE_SQ_SIZE, "s");\r
     pieces[1] = DoLoadBitmap(hInst, "n", SAMPLE_SQ_SIZE, "w");\r
     pieces[2] = DoLoadBitmap(hInst, "n", SAMPLE_SQ_SIZE, "o");\r
@@ -585,6 +616,9 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
     white= appData.allWhite;\r
     flip = appData.upsideDown;\r
     size = boardSize;\r
+    bitmaps = appData.useBitmaps;\r
+    fonts = appData.useFont;\r
+    grid = appData.overrideLineGap >= 0;\r
 \r
     SetBoardOptionEnables(hDlg);\r
     return TRUE;\r
@@ -622,6 +656,8 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
        ChangeBoardSize(size);\r
       }\r
 \r
+      if (bitmaps && !appData.useBitmaps) InitTextures();\r
+\r
       if ((mono != appData.monoMode) ||\r
          (lsc  != lightSquareColor) ||\r
          (dsc  != darkSquareColor) ||\r
@@ -630,6 +666,9 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
          (hsc  != highlightSquareColor) ||\r
           (flip != appData.upsideDown) ||\r
           (white != appData.allWhite) ||\r
+          (fonts != appData.useFont) ||\r
+          (bitmaps != appData.useBitmaps) ||\r
+          (grid != appData.overrideLineGap >= 0) ||\r
          (phc  != premoveHighlightColor)) {\r
 \r
          lightSquareColor = lsc;\r
@@ -641,6 +680,9 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
          appData.monoMode = mono;\r
           appData.allWhite = white;\r
           appData.upsideDown = flip;\r
+          appData.useFont = fonts;\r
+          appData.useBitmaps = bitmaps;\r
+          if(grid != appData.overrideLineGap >= 0) appData.overrideLineGap = grid - 1;\r
 \r
          InitDrawingColors();\r
          InitDrawingSizes(boardSize, 0);\r
@@ -733,12 +775,22 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 \r
     case OPT_AllWhite:\r
       white = !white;\r
-      SetBoardOptionEnables(hDlg);\r
       break;\r
 \r
     case OPT_UpsideDown:\r
       flip = !flip;\r
-      SetBoardOptionEnables(hDlg);\r
+      break;\r
+\r
+    case OPT_Bitmaps:\r
+      bitmaps = !bitmaps;\r
+      break;\r
+\r
+    case OPT_PieceFont:\r
+      fonts = !fonts;\r
+      break;\r
+\r
+    case OPT_Grid:\r
+      grid = !grid;\r
       break;\r
     }\r
     break;\r
@@ -797,6 +849,7 @@ int radioButton[] = {
     -1, // Twilight,\r
     OPT_VariantMakruk,\r
     OPT_VariantSChess,\r
+    OPT_VariantGrand,\r
     OPT_VariantSpartan, // Spartan\r
     -2 // sentinel\r
 };\r
@@ -807,7 +860,8 @@ VariantWhichRadio(HWND hDlg)
   int i=0, j;\r
   while((j = radioButton[i++]) != -2) {\r
        if(j == -1) continue; // no menu button\r
-       if(IsDlgButtonChecked(hDlg, j)) return (VariantClass) i-1;\r
+       if(IsDlgButtonChecked(hDlg, j) &&\r
+          (appData.noChessProgram || strstr(first.variants, VariantName(i-1)))) return (VariantClass) i-1;\r
   }\r
   return gameInfo.variant; // If no button checked, keep old\r
 }\r
@@ -1134,6 +1188,7 @@ IcsOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
     CHECK_BOX(OPT_AutoKibitz, appData.autoKibitz);\r
     CHECK_BOX(OPT_AutoComment, appData.autoComment);\r
     CHECK_BOX(OPT_AutoObserve, appData.autoObserve);\r
+    CHECK_BOX(OPT_AutoCreate, appData.autoCreateLogon);\r
     CHECK_BOX(OPT_GetMoveList, appData.getMoveList);\r
     CHECK_BOX(OPT_LocalLineEditing, appData.localLineEditing);\r
     CHECK_BOX(OPT_QuietPlay, appData.quietPlay);\r
@@ -1219,6 +1274,7 @@ IcsOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
       appData.autoKibitz       = IS_CHECKED(OPT_AutoKibitz);\r
       appData.autoComment      = IS_CHECKED(OPT_AutoComment);\r
       appData.autoObserve      = IS_CHECKED(OPT_AutoObserve);\r
+      appData.autoCreateLogon  = IS_CHECKED(OPT_AutoCreate);\r
       appData.getMoveList      = IS_CHECKED(OPT_GetMoveList);\r
       appData.localLineEditing = IS_CHECKED(OPT_LocalLineEditing);\r
       appData.quietPlay        = IS_CHECKED(OPT_QuietPlay);\r
@@ -1410,6 +1466,8 @@ IcsOptionsPopup(HWND hwnd)
  *\r
 \*---------------------------------------------------------------------------*/\r
 \r
+char *string; // sorry\r
+\r
 VOID\r
 SetSampleFontText(HWND hwnd, int id, const MyFont *mf)\r
 {\r
@@ -1427,7 +1485,9 @@ SetSampleFontText(HWND hwnd, int id, const MyFont *mf)
                 mf->mfp.pointSize, mf->mfp.faceName,\r
                 mf->mfp.bold ? " bold" : "",\r
                 mf->mfp.italic ? " italic" : "");\r
+ if(id != OPT_SamplePieceFont)\r
   SetDlgItemText(hwnd, id, buf);\r
+ else SetDlgItemText(hwnd, id, string);\r
 \r
   hControl = GetDlgItem(hwnd, id);\r
   hdc = GetDC(hControl);\r
@@ -1464,6 +1524,7 @@ SetSampleFontText(HWND hwnd, int id, const MyFont *mf)
 \r
   /* format the text in the rich edit control */\r
   SendMessage(hControl, EM_SETCHARFORMAT, SCF_ALL, (LPARAM) &cf);\r
+ if(id != OPT_SamplePieceFont)\r
   SendMessage(hControl, EM_SETRECT, (WPARAM)0, (LPARAM) &rectFormat);\r
 \r
   /* clean up */\r
@@ -1488,8 +1549,9 @@ CopyFont(MyFont *dest, const MyFont *src)
 LRESULT CALLBACK\r
 FontOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
 {\r
-  static MyFont workFont[NUM_FONTS];\r
+  static MyFont workFont[NUM_FONTS+1];\r
   static BOOL firstPaint;\r
+  static char pieceText[] = "ABCDEFGHIJKLMNOPQRSTUVWXZabcdefghijklmnopqrstuvwxyz";\r
   int i;\r
   RECT rect;\r
 \r
@@ -1499,6 +1561,9 @@ FontOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
     /* copy the current font settings into a working copy */\r
     for (i=0; i < NUM_FONTS; i++)\r
       CopyFont(&workFont[i], font[boardSize][i]);\r
+    strncpy(workFont[NUM_FONTS].mfp.faceName, appData.renderPiecesWithFont, sizeof(workFont[NUM_FONTS].mfp.faceName));\r
+    workFont[NUM_FONTS].mfp.pointSize = 16.;\r
+    workFont[NUM_FONTS].mfp.charset = DEFAULT_CHARSET;\r
 \r
     Translate(hDlg, DLG_Fonts);\r
     if (!appData.icsActive)\r
@@ -1527,6 +1592,9 @@ FontOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
       SetSampleFontText(hDlg, OPT_SampleCommentsFont, &workFont[COMMENT_FONT]);\r
       SetSampleFontText(hDlg, OPT_SampleConsoleFont, &workFont[CONSOLE_FONT]);\r
       SetSampleFontText(hDlg, OPT_SampleMoveHistoryFont, &workFont[MOVEHISTORY_FONT]);\r
+      SetSampleFontText(hDlg, OPT_SampleGameListFont, &workFont[GAMELIST_FONT]);\r
+      string = appData.fontToPieceTable;\r
+      SetSampleFontText(hDlg, OPT_SamplePieceFont, &workFont[NUM_FONTS]);\r
       firstPaint = FALSE;\r
     }\r
     break;\r
@@ -1542,6 +1610,13 @@ FontOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
       for (i=0; i < NUM_FONTS; i++)\r
        CopyFont(font[boardSize][i], &workFont[i]);\r
 \r
+      { // Make new piece-to-char table\r
+       char buf[MSG_SIZ];\r
+       GetDlgItemText(hDlg, OPT_SamplePieceFont, buf, MSG_SIZ);\r
+       ASSIGN(appData.fontToPieceTable, buf);\r
+      }\r
+      ASSIGN(appData.renderPiecesWithFont, workFont[NUM_FONTS].mfp.faceName); // piece font\r
+\r
       /* a sad necessity due to the original design of having a separate\r
        * console font, tags font, and comment font for each board size.  IMHO\r
        * these fonts should not be dependent on the current board size.  I'm\r
@@ -1555,6 +1630,7 @@ FontOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
        CopyFont(font[i][CONSOLE_FONT],  &workFont[CONSOLE_FONT]);\r
        CopyFont(font[i][COMMENT_FONT],  &workFont[COMMENT_FONT]);\r
        CopyFont(font[i][MOVEHISTORY_FONT],  &workFont[MOVEHISTORY_FONT]);\r
+       CopyFont(font[i][GAMELIST_FONT],  &workFont[GAMELIST_FONT]);\r
       }\r
       /* end sad necessity */\r
 \r
@@ -1644,6 +1720,17 @@ FontOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
       SetSampleFontText(hDlg, OPT_SampleMoveHistoryFont, &workFont[MOVEHISTORY_FONT]);\r
       break;\r
 \r
+    case OPT_ChooseGameListFont:\r
+      MyCreateFont(hDlg, &workFont[GAMELIST_FONT]);\r
+      SetSampleFontText(hDlg, OPT_SampleGameListFont, &workFont[GAMELIST_FONT]);\r
+      break;\r
+\r
+    case OPT_ChoosePieceFont:\r
+      MyCreateFont(hDlg, &workFont[NUM_FONTS]);\r
+      string = pieceText;\r
+      SetSampleFontText(hDlg, OPT_SamplePieceFont, &workFont[NUM_FONTS]);\r
+      break;\r
+\r
     case OPT_DefaultFonts:\r
       for (i=0; i<NUM_FONTS; i++) {\r
        DeleteObject(&workFont[i].hf);\r
@@ -1657,6 +1744,7 @@ FontOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
       SetSampleFontText(hDlg, OPT_SampleCommentsFont, &workFont[COMMENT_FONT]);\r
       SetSampleFontText(hDlg, OPT_SampleConsoleFont, &workFont[CONSOLE_FONT]);\r
       SetSampleFontText(hDlg, OPT_SampleMoveHistoryFont, &workFont[MOVEHISTORY_FONT]);\r
+      SetSampleFontText(hDlg, OPT_SampleGameListFont, &workFont[GAMELIST_FONT]);\r
       break;\r
     }\r
   }\r
@@ -2110,7 +2198,7 @@ ParseCommSettings(char *arg, DCB *dcb)
   if (cd->label == NULL) goto cant_parse;\r
   return;\r
 cant_parse:\r
-    ExitArgError(_("Can't parse com port settings"), arg);\r
+    ExitArgError(_("Can't parse com port settings"), arg, TRUE);\r
 }\r
 \r
 \r
@@ -2359,6 +2447,17 @@ CommPortOptionsPopup(HWND hwnd)
  *\r
 \*---------------------------------------------------------------------------*/\r
 \r
+int\r
+LoadOptionsWhichRadio(HWND hDlg)\r
+{\r
+  return (IsDlgButtonChecked(hDlg, OPT_Exact) ? 1 :\r
+         (IsDlgButtonChecked(hDlg, OPT_Subset) ? 2 :\r
+         (IsDlgButtonChecked(hDlg, OPT_Struct) ? 3 :\r
+         (IsDlgButtonChecked(hDlg, OPT_Material) ? 4 :\r
+         (IsDlgButtonChecked(hDlg, OPT_Range) ? 5 :\r
+         (IsDlgButtonChecked(hDlg, OPT_Difference) ? 6 : -1))))));\r
+}\r
+\r
 VOID\r
 SetLoadOptionEnables(HWND hDlg)\r
 {\r
@@ -2374,6 +2473,7 @@ LoadOptions(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 {\r
   char buf[MSG_SIZ];\r
   float fnumber;\r
+  int ok;\r
 \r
   switch (message) {\r
   case WM_INITDIALOG: /* message: initialize dialog box */\r
@@ -2389,6 +2489,32 @@ LoadOptions(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
       CheckDlgButton(hDlg, OPT_Autostep, FALSE);\r
     }\r
     SetLoadOptionEnables(hDlg);\r
+    SetDlgItemInt(hDlg, OPT_elo1, appData.eloThreshold1, FALSE);\r
+    SetDlgItemInt(hDlg, OPT_elo2, appData.eloThreshold2, FALSE);\r
+    SetDlgItemInt(hDlg, OPT_date, appData.dateThreshold, FALSE);\r
+    SetDlgItemInt(hDlg, OPT_Stretch, appData.stretch, FALSE);\r
+    CheckDlgButton(hDlg, OPT_Reversed, appData.ignoreColors);\r
+    CheckDlgButton(hDlg, OPT_Mirror, appData.findMirror);\r
+    switch (appData.searchMode) {\r
+    case 1:\r
+      CheckDlgButton(hDlg, OPT_Exact, TRUE);\r
+      break;\r
+    case 2:\r
+      CheckDlgButton(hDlg, OPT_Subset, TRUE);\r
+      break;\r
+    case 3:\r
+      CheckDlgButton(hDlg, OPT_Struct, TRUE);\r
+      break;\r
+    case 4:\r
+      CheckDlgButton(hDlg, OPT_Material, TRUE);\r
+      break;\r
+    case 5:\r
+      CheckDlgButton(hDlg, OPT_Range, TRUE);\r
+      break;\r
+    case 6:\r
+      CheckDlgButton(hDlg, OPT_Difference, TRUE);\r
+      break;\r
+    }\r
     return TRUE;\r
 \r
   case WM_COMMAND: /* message: received a command */\r
@@ -2406,6 +2532,13 @@ LoadOptions(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
       } else {\r
        appData.timeDelay = (float) -1.0;\r
       }\r
+      appData.eloThreshold1 = GetDlgItemInt(hDlg, OPT_elo1, &ok, FALSE);\r
+      appData.eloThreshold2 = GetDlgItemInt(hDlg, OPT_elo2, &ok, FALSE);\r
+      appData.dateThreshold = GetDlgItemInt(hDlg, OPT_date, &ok, FALSE);\r
+      appData.stretch = GetDlgItemInt(hDlg, OPT_Stretch, &ok, FALSE);\r
+      appData.searchMode = LoadOptionsWhichRadio(hDlg);\r
+      appData.ignoreColors = IsDlgButtonChecked(hDlg, OPT_Reversed);\r
+      appData.findMirror   = IsDlgButtonChecked(hDlg, OPT_Mirror);\r
       EndDialog(hDlg, TRUE);\r
       return TRUE;\r
 \r
@@ -2493,7 +2626,7 @@ SaveOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
       if (IsDlgButtonChecked(hDlg, OPT_Autosave)) {\r
        appData.autoSaveGames = TRUE;\r
        if (IsDlgButtonChecked(hDlg, OPT_AVPrompt)) {\r
-         appData.saveGameFile = "";\r
+         ASSIGN(appData.saveGameFile, ""); // [HGM] make sure value is ALWAYS in allocated memory\r
        } else /*if (IsDlgButtonChecked(hDlg, OPT_AVToFile))*/ {\r
          GetDlgItemText(hDlg, OPT_AVFilename, buf, MSG_SIZ);\r
          if (*buf == NULLCHAR) {\r
@@ -2501,25 +2634,12 @@ SaveOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
                       _("Option Error"), MB_OK|MB_ICONEXCLAMATION);\r
            return FALSE;\r
          }\r
-         if ((isalpha(buf[0]) && buf[1] == ':') ||\r
-           (buf[0] == '\\' && buf[1] == '\\')) {\r
-           appData.saveGameFile = strdup(buf);\r
-         } else {\r
-           char buf2[MSG_SIZ], buf3[MSG_SIZ];\r
-           char *dummy;\r
-           GetCurrentDirectory(MSG_SIZ, buf3);\r
-           SetCurrentDirectory(installDir);\r
-           if (GetFullPathName(buf, MSG_SIZ, buf2, &dummy)) {\r
-             appData.saveGameFile = strdup(buf2);\r
-           } else {\r
-             appData.saveGameFile = strdup(buf);\r
-           }\r
-           SetCurrentDirectory(buf3);\r
-         }\r
+         FREE(appData.saveGameFile);\r
+         appData.saveGameFile = InterpretFileName(buf, homeDir);\r
        }\r
       } else {\r
        appData.autoSaveGames = FALSE;\r
-       appData.saveGameFile = "";\r
+       ASSIGN(appData.saveGameFile, "");\r
       }\r
       appData.oldSaveStyle = IsDlgButtonChecked(hDlg, OPT_Old);\r
       appData.saveOutOfBookInfo = IsDlgButtonChecked( hDlg, OPT_OutOfBookInfo );\r
@@ -2589,7 +2709,8 @@ LRESULT CALLBACK
 TimeControl(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)\r
 {\r
   char buf[MSG_SIZ], *tc;\r
-  int mps, increment, odds1, odds2, st;\r
+  int mps, odds1, odds2, st;\r
+  float increment;\r
   BOOL ok, ok2;\r
 \r
   switch (message) {\r
@@ -2598,7 +2719,7 @@ TimeControl(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
     CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));\r
     Translate(hDlg, DLG_TimeControl);\r
     /* Initialize the dialog items */\r
-    if (appData.clockMode && !appData.icsActive) {\r
+    if (/*appData.clockMode &&*/ !appData.icsActive) { // [HGM] even if !clockMode, we could want to set it in tournament dialog\r
       if (searchTime) {\r
        CheckRadioButton(hDlg, OPT_TCUseMoves, OPT_TCUseFixed,\r
                         OPT_TCUseFixed);\r
@@ -2613,12 +2734,15 @@ TimeControl(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
        SetDlgItemText(hDlg, OPT_TCTime2, "");\r
        SetDlgItemText(hDlg, OPT_TCInc, "");\r
       } else {\r
+       int i = appData.timeIncrement;\r
+       if(i == appData.timeIncrement) snprintf(buf, MSG_SIZ, "%d", i);\r
+       else snprintf(buf, MSG_SIZ, "%4.2f", appData.timeIncrement);\r
        CheckRadioButton(hDlg, OPT_TCUseMoves, OPT_TCUseFixed,\r
                         OPT_TCUseInc);\r
        SetDlgItemText(hDlg, OPT_TCTime, "");\r
        SetDlgItemText(hDlg, OPT_TCMoves, "");\r
        SetDlgItemText(hDlg, OPT_TCTime2, appData.timeControl);\r
-       SetDlgItemInt(hDlg, OPT_TCInc, appData.timeIncrement, FALSE);\r
+       SetDlgItemText(hDlg, OPT_TCInc, buf);\r
       }\r
       SetDlgItemInt(hDlg, OPT_TCOdds1, 1, FALSE);\r
       SetDlgItemInt(hDlg, OPT_TCOdds2, 1, FALSE);\r
@@ -2658,7 +2782,8 @@ TimeControl(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
        }\r
       tc = buf;\r
       } else {\r
-       increment = GetDlgItemInt(hDlg, OPT_TCInc, &ok, FALSE);\r
+       GetDlgItemText(hDlg, OPT_TCInc, buf, MSG_SIZ);\r
+       ok = (sscanf(buf, "%f%c", &increment, buf) == 1);\r
        if (!ok || increment < 0) {\r
          MessageBox(hDlg, _("Invalid increment"),\r
                     _("Option Error"), MB_OK|MB_ICONEXCLAMATION);\r
@@ -2828,7 +2953,7 @@ VOID EnginePlayOptionsPopup(HWND hwnd)
  * UCI Options Dialog functions\r
  *\r
 \*---------------------------------------------------------------------------*/\r
-static BOOL BrowseForFolder( const char * title, char * path )\r
+BOOL BrowseForFolder( const char * title, char * path )\r
 {\r
     BOOL result = FALSE;\r
     BROWSEINFO bi;\r