Updated copyright notice to 2011
[xboard.git] / winboard / woptions.c
old mode 100755 (executable)
new mode 100644 (file)
index 20a3106..03210c4
@@ -1,7 +1,7 @@
 /*\r
  * woptions.c -- Options dialog box routines for WinBoard\r
  *\r
- * Copyright 2000,2009 Free Software Foundation, Inc.\r
+ * Copyright 2000, 2009, 2010, 2011 Free Software Foundation, Inc.\r
  *\r
  * Enhancements Copyright 2005 Alessandro Scotti\r
  *\r
 #include <ctype.h>\r
 \r
 #include "common.h"\r
+#include "frontend.h"\r
 #include "winboard.h"\r
 #include "backend.h"\r
 #include "woptions.h"\r
 #include "defaults.h"\r
-#include "wedittags.h"\r
 #include <richedit.h>\r
 \r
 #if __GNUC__\r
@@ -44,6 +44,9 @@
 #include <string.h>\r
 #endif\r
 \r
+#define _(s) T_(s)\r
+#define N_(s) s\r
+\r
 /* Imports from winboard.c */\r
 \r
 extern MyFont *font[NUM_SIZES][NUM_FONTS];\r
@@ -51,7 +54,7 @@ extern HINSTANCE hInst;          /* current instance */
 extern HWND hwndMain;            /* root window*/\r
 extern BOOLEAN alwaysOnTop;\r
 extern RECT boardRect;\r
-extern COLORREF lightSquareColor, darkSquareColor, whitePieceColor, \r
+extern COLORREF lightSquareColor, darkSquareColor, whitePieceColor,\r
   blackPieceColor, highlightSquareColor, premoveHighlightColor;\r
 extern HPALETTE hPal;\r
 extern BoardSize boardSize;\r
@@ -97,15 +100,15 @@ LRESULT CALLBACK SaveOptions(HWND, UINT, WPARAM, LPARAM);
 LRESULT CALLBACK TimeControl(HWND, UINT, WPARAM, LPARAM);\r
 VOID ChangeBoardSize(BoardSize newSize);\r
 VOID PaintSampleSquare(\r
-    HWND     hwnd, \r
-    int      ctrlid, \r
-    COLORREF squareColor, \r
+    HWND     hwnd,\r
+    int      ctrlid,\r
+    COLORREF squareColor,\r
     COLORREF pieceColor,\r
     COLORREF squareOutlineColor,\r
     COLORREF pieceDetailColor,\r
     BOOL     isWhitePiece,\r
     BOOL     isMono,\r
-    HBITMAP  pieces[3] \r
+    HBITMAP  pieces[3]\r
     );\r
 VOID PaintColorBlock(HWND hwnd, int ctrlid, COLORREF color);\r
 VOID SetBoardOptionEnables(HWND hDlg);\r
@@ -131,7 +134,6 @@ void SelectComboValue(HANDLE hwndCombo, ComboData *cd, unsigned value);
 VOID SetLoadOptionEnables(HWND hDlg);\r
 VOID SetSaveOptionEnables(HWND hDlg);\r
 VOID SetTimeControlEnables(HWND hDlg);\r
-void NewSettingEvent(int option, char *command, int value);\r
 \r
 /*---------------------------------------------------------------------------*\\r
  *\r
@@ -146,15 +148,18 @@ GeneralOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
   static Boolean oldShowCoords;\r
   static Boolean oldBlindfold;\r
   static Boolean oldShowButtonBar;\r
+  static Boolean oldAutoLogo;\r
 \r
   switch (message) {\r
   case WM_INITDIALOG: /* message: initialize dialog box */\r
     oldShowCoords = appData.showCoords;\r
     oldBlindfold  = appData.blindfold;\r
     oldShowButtonBar = appData.showButtonBar;\r
+    oldAutoLogo  = appData.autoLogo;\r
 \r
     /* Center the dialog over the application window */\r
     CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));\r
+    Translate(hDlg, DLG_GeneralOptions);\r
 \r
     /* Initialize the dialog items */\r
 #define CHECK_BOX(x,y) CheckDlgButton(hDlg, (x), (BOOL)(y))\r
@@ -181,6 +186,8 @@ GeneralOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
     CHECK_BOX(OPT_SaveExtPGN, appData.saveExtendedInfoInPGN);\r
     CHECK_BOX(OPT_ExtraInfoInMoveHistory, appData.showEvalInMoveHistory);\r
     CHECK_BOX(OPT_HighlightMoveArrow, appData.highlightMoveWithArrow);\r
+    CHECK_BOX(OPT_AutoLogo, appData.autoLogo); // [HGM] logo\r
+    CHECK_BOX(OPT_SmartMove, appData.oneClick); // [HGM] one-click\r
 \r
 #undef CHECK_BOX\r
 \r
@@ -190,9 +197,9 @@ GeneralOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
                 appData.icsActive || !appData.noChessProgram);\r
     EnableWindow(GetDlgItem(hDlg, OPT_PonderNextMove),\r
                 !appData.noChessProgram);\r
-    EnableWindow(GetDlgItem(hDlg, OPT_PeriodicUpdates), \r
+    EnableWindow(GetDlgItem(hDlg, OPT_PeriodicUpdates),\r
                 !appData.noChessProgram && !appData.icsActive);\r
-    EnableWindow(GetDlgItem(hDlg, OPT_ShowThinking), \r
+    EnableWindow(GetDlgItem(hDlg, OPT_ShowThinking),\r
                 !appData.noChessProgram);\r
     return TRUE;\r
 \r
@@ -201,7 +208,7 @@ GeneralOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
     switch (LOWORD(wParam)) {\r
     case IDOK:\r
       /* Read changed options from the dialog box */\r
-      \r
+\r
 #define IS_CHECKED(x) (Boolean)IsDlgButtonChecked(hDlg, (x))\r
 \r
       alwaysOnTop                  = IS_CHECKED(OPT_AlwaysOnTop);\r
@@ -228,6 +235,8 @@ GeneralOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
       ShowThinkingEvent(); // [HGM] thinking: tests four options\r
       appData.testLegality         = IS_CHECKED(OPT_TestLegality);\r
       appData.highlightMoveWithArrow=IS_CHECKED(OPT_HighlightMoveArrow);\r
+      appData.autoLogo             =IS_CHECKED(OPT_AutoLogo); // [HGM] logo\r
+      appData.oneClick             =IS_CHECKED(OPT_SmartMove); // [HGM] one-click\r
 \r
 #undef IS_CHECKED\r
 \r
@@ -243,15 +252,18 @@ GeneralOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
        ClearHighlights();\r
        DrawPosition(FALSE, NULL);\r
       }\r
-      /* \r
+      /*\r
        * for some reason the redraw seems smoother when we invalidate\r
        * the board rect after the call to EndDialog()\r
        */\r
       EndDialog(hDlg, TRUE);\r
 \r
-      if (oldShowButtonBar != appData.showButtonBar) {\r
+      if (oldAutoLogo != appData.autoLogo) { // [HGM] logo: remove any logos when we switch autologo off\r
+       if(oldAutoLogo) first.programLogo = second.programLogo = NULL;\r
+       InitDrawingSizes(boardSize, 0);\r
+      } else if (oldShowButtonBar != appData.showButtonBar) {\r
        InitDrawingSizes(boardSize, 0);\r
-      } else if ((oldShowCoords != appData.showCoords) || \r
+      } else if ((oldShowCoords != appData.showCoords) ||\r
                 (oldBlindfold != appData.blindfold)) {\r
        InvalidateRect(hwndMain, &boardRect, FALSE);\r
       }\r
@@ -268,7 +280,7 @@ GeneralOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
   return FALSE;\r
 }\r
 \r
-VOID \r
+VOID\r
 GeneralOptionsPopup(HWND hwnd)\r
 {\r
   FARPROC lpProc;\r
@@ -297,15 +309,15 @@ ChangeBoardSize(BoardSize newSize)
 \r
 VOID\r
 PaintSampleSquare(\r
-    HWND     hwnd, \r
-    int      ctrlid, \r
-    COLORREF squareColor, \r
+    HWND     hwnd,\r
+    int      ctrlid,\r
+    COLORREF squareColor,\r
     COLORREF pieceColor,\r
     COLORREF squareOutlineColor,\r
     COLORREF pieceDetailColor,\r
     BOOL     isWhitePiece,\r
     BOOL     isMono,\r
-    HBITMAP  pieces[3] \r
+    HBITMAP  pieces[3]\r
     )\r
 {\r
   HBRUSH  brushSquare;\r
@@ -348,15 +360,15 @@ PaintSampleSquare(
   brushPiece          = CreateSolidBrush(pieceColor);\r
   brushPieceDetail    = CreateSolidBrush(pieceDetailColor);\r
 \r
-  /* \r
-   * first draw the rectangle \r
+  /*\r
+   * first draw the rectangle\r
    */\r
   pen      = CreatePen(PS_SOLID, BORDER, squareOutlineColor);\r
   oldPen   = (HPEN)  SelectObject(hdcMem, pen);\r
   oldBrushSquare = (HBRUSH)SelectObject(hdcMem, brushSquare);\r
   Rectangle(hdcMem, rect.left, rect.top, rect.right, rect.bottom);\r
 \r
-  /* \r
+  /*\r
    * now draw the piece\r
    */\r
   if (isMono) {\r
@@ -368,23 +380,23 @@ PaintSampleSquare(
     if (isWhitePiece) {\r
       oldBitmapTemp = SelectObject(hdcTemp, pieces[WHITE]);\r
       oldBrushPiece = SelectObject(hdcMem, brushPiece);\r
-      BitBlt(hdcMem, x, y, SAMPLE_SQ_SIZE, SAMPLE_SQ_SIZE, \r
+      BitBlt(hdcMem, x, y, SAMPLE_SQ_SIZE, SAMPLE_SQ_SIZE,\r
             hdcTemp, 0, 0, 0x00B8074A);\r
       /* Use black for outline of white pieces */\r
       SelectObject(hdcTemp, pieces[OUTLINE]);\r
-      BitBlt(hdcMem, x, y, SAMPLE_SQ_SIZE, SAMPLE_SQ_SIZE, \r
+      BitBlt(hdcMem, x, y, SAMPLE_SQ_SIZE, SAMPLE_SQ_SIZE,\r
             hdcTemp, 0, 0, SRCAND);\r
     } else {\r
       /* Use square color for details of black pieces */\r
       oldBitmapTemp = SelectObject(hdcTemp, pieces[SOLID]);\r
       oldBrushPiece = SelectObject(hdcMem, brushPiece);\r
-      BitBlt(hdcMem, x, y, SAMPLE_SQ_SIZE, SAMPLE_SQ_SIZE, \r
+      BitBlt(hdcMem, x, y, SAMPLE_SQ_SIZE, SAMPLE_SQ_SIZE,\r
             hdcTemp, 0, 0, 0x00B8074A);\r
     }\r
     SelectObject(hdcMem, oldBrushPiece);\r
     SelectObject(hdcTemp, oldBitmapTemp);\r
   }\r
-  /* \r
+  /*\r
    * copy the memory dc to the screen\r
    */\r
   SelectObject(hdcMem, bufferBitmap);\r
@@ -393,7 +405,7 @@ PaintSampleSquare(
         rect.bottom - rect.top,\r
         hdcMem, rect.left, rect.top, SRCCOPY);\r
   SelectObject(hdcMem, oldBitmapMem);\r
-  /* \r
+  /*\r
    * clean up\r
    */\r
   SelectObject(hdcMem, oldBrushPiece);\r
@@ -456,7 +468,7 @@ SetBoardOptionEnables(HWND hDlg)
   }\r
 }\r
 \r
-BoardSize \r
+BoardSize\r
 BoardOptionsWhichRadio(HWND hDlg)\r
 {\r
   return (IsDlgButtonChecked(hDlg, OPT_SizeTiny) ? SizeTiny :\r
@@ -491,6 +503,7 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
   case WM_INITDIALOG: /* message: initialize dialog box */\r
     /* Center the dialog over the application window */\r
     CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));\r
+    Translate(hDlg, DLG_BoardOptions);\r
     /* Initialize the dialog items */\r
     switch (boardSize) {\r
     case SizeTiny:\r
@@ -561,7 +574,7 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
     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
-       \r
+\r
     lsc = lightSquareColor;\r
     dsc = darkSquareColor;\r
     wpc = whitePieceColor;\r
@@ -593,7 +606,7 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
   case WM_COMMAND: /* message: received a command */\r
     switch (LOWORD(wParam)) {\r
     case IDOK:\r
-      /* \r
+      /*\r
        * if we call EndDialog() after the call to ChangeBoardSize(),\r
        * then ChangeBoardSize() does not take effect, although the new\r
        * boardSize is saved. Go figure...\r
@@ -646,42 +659,42 @@ BoardOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
       return TRUE;\r
 \r
     case OPT_ChooseLightSquareColor:\r
-      if (ChangeColor(hDlg, &lsc)) \r
+      if (ChangeColor(hDlg, &lsc))\r
        PaintColorBlock(hDlg, OPT_LightSquareColor, lsc);\r
        PaintSampleSquare(hDlg, OPT_SampleLightSquare, lsc, wpc, hsc, bpc,\r
            TRUE, mono, pieces);\r
       break;\r
 \r
     case OPT_ChooseDarkSquareColor:\r
-      if (ChangeColor(hDlg, &dsc)) \r
+      if (ChangeColor(hDlg, &dsc))\r
        PaintColorBlock(hDlg, OPT_DarkSquareColor, dsc);\r
        PaintSampleSquare(hDlg, OPT_SampleDarkSquare, dsc, bpc, phc, wpc,\r
            FALSE, mono, pieces);\r
       break;\r
 \r
     case OPT_ChooseWhitePieceColor:\r
-      if (ChangeColor(hDlg, &wpc)) \r
+      if (ChangeColor(hDlg, &wpc))\r
        PaintColorBlock(hDlg, OPT_WhitePieceColor, wpc);\r
        PaintSampleSquare(hDlg, OPT_SampleLightSquare, lsc, wpc, hsc, bpc,\r
            TRUE, mono, pieces);\r
       break;\r
 \r
     case OPT_ChooseBlackPieceColor:\r
-      if (ChangeColor(hDlg, &bpc)) \r
+      if (ChangeColor(hDlg, &bpc))\r
        PaintColorBlock(hDlg, OPT_BlackPieceColor, bpc);\r
        PaintSampleSquare(hDlg, OPT_SampleDarkSquare, dsc, bpc, phc, wpc,\r
            FALSE, mono, pieces);\r
       break;\r
 \r
     case OPT_ChooseHighlightSquareColor:\r
-      if (ChangeColor(hDlg, &hsc)) \r
+      if (ChangeColor(hDlg, &hsc))\r
        PaintColorBlock(hDlg, OPT_HighlightSquareColor, hsc);\r
        PaintSampleSquare(hDlg, OPT_SampleLightSquare, lsc, wpc, hsc, bpc,\r
            TRUE, mono, pieces);\r
       break;\r
 \r
     case OPT_ChoosePremoveHighlightColor:\r
-      if (ChangeColor(hDlg, &phc)) \r
+      if (ChangeColor(hDlg, &phc))\r
        PaintColorBlock(hDlg, OPT_PremoveHighlightColor, phc);\r
        PaintSampleSquare(hDlg, OPT_SampleDarkSquare, dsc, bpc, phc, wpc,\r
            FALSE, mono, pieces);\r
@@ -743,38 +756,71 @@ BoardOptionsPopup(HWND hwnd)
   FreeProcInstance(lpProc);\r
 }\r
 \r
+int radioButton[] = {\r
+    OPT_VariantNormal,\r
+    -1, // Loadable\r
+    OPT_VariantWildcastle,\r
+    OPT_VariantNocastle,\r
+    OPT_VariantFRC,\r
+    OPT_VariantBughouse,\r
+    OPT_VariantCrazyhouse,\r
+    OPT_VariantLosers,\r
+    OPT_VariantSuicide,\r
+    OPT_VariantGiveaway,\r
+    OPT_VariantTwoKings,\r
+    -1, //Kriegspiel\r
+    OPT_VariantAtomic,\r
+    OPT_Variant3Check,\r
+    OPT_VariantShatranj,\r
+    -1,\r
+    -1,\r
+    -1,\r
+    -1,\r
+    -1,\r
+    -1,\r
+    -1,\r
+    -1,\r
+    OPT_VariantShogi,\r
+    OPT_VariantXiangqi,\r
+    OPT_VariantCourier,\r
+    OPT_VariantGothic,\r
+    OPT_VariantCapablanca,\r
+    OPT_VariantKnightmate,\r
+    OPT_VariantFairy,        \r
+    OPT_VariantCylinder,\r
+    OPT_VariantFalcon,\r
+    OPT_VariantCRC,\r
+    OPT_VariantBerolina,\r
+    OPT_VariantJanus,\r
+    OPT_VariantSuper,\r
+    OPT_VariantGreat,\r
+    -1, // Twilight,\r
+    OPT_VariantMakruk,\r
+    OPT_VariantSChess,\r
+    OPT_VariantSpartan, // Spartan\r
+    -2 // sentinel\r
+};\r
+\r
 VariantClass\r
 VariantWhichRadio(HWND hDlg)\r
 {\r
-  return (IsDlgButtonChecked(hDlg, OPT_VariantFairy) ? VariantFairy :\r
-         (IsDlgButtonChecked(hDlg, OPT_VariantGothic) ? VariantGothic :\r
-         (IsDlgButtonChecked(hDlg, OPT_VariantCrazyhouse) ? VariantCrazyhouse :\r
-         (IsDlgButtonChecked(hDlg, OPT_VariantBughouse) ? VariantBughouse :\r
-         (IsDlgButtonChecked(hDlg, OPT_VariantCourier) ? VariantCourier :\r
-         (IsDlgButtonChecked(hDlg, OPT_VariantShatranj) ? VariantShatranj :\r
-         (IsDlgButtonChecked(hDlg, OPT_VariantShogi) ? VariantShogi :\r
-         (IsDlgButtonChecked(hDlg, OPT_VariantXiangqi) ? VariantXiangqi :\r
-         (IsDlgButtonChecked(hDlg, OPT_VariantCapablanca) ? VariantCapablanca :\r
-         (IsDlgButtonChecked(hDlg, OPT_VariantTwoKings) ? VariantTwoKings :\r
-         (IsDlgButtonChecked(hDlg, OPT_VariantKnightmate) ? VariantKnightmate :\r
-         (IsDlgButtonChecked(hDlg, OPT_VariantLosers) ? VariantLosers :\r
-         (IsDlgButtonChecked(hDlg, OPT_VariantSuicide) ? VariantSuicide :\r
-         (IsDlgButtonChecked(hDlg, OPT_VariantAtomic) ? VariantAtomic :\r
-         (IsDlgButtonChecked(hDlg, OPT_VariantShatranj) ? VariantShatranj :\r
-         (IsDlgButtonChecked(hDlg, OPT_VariantFRC) ? VariantFischeRandom :\r
-         (IsDlgButtonChecked(hDlg, OPT_VariantCylinder) ? VariantCylinder :\r
-         (IsDlgButtonChecked(hDlg, OPT_VariantFalcon) ? VariantFalcon :\r
-         (IsDlgButtonChecked(hDlg, OPT_VariantCRC) ? VariantCapaRandom :\r
-         (IsDlgButtonChecked(hDlg, OPT_VariantSuper) ? VariantSuper :\r
-         (IsDlgButtonChecked(hDlg, OPT_VariantBerolina) ? VariantBerolina :\r
-         (IsDlgButtonChecked(hDlg, OPT_VariantJanus) ? VariantJanus :\r
-         (IsDlgButtonChecked(hDlg, OPT_VariantWildcastle) ? VariantWildCastle :\r
-         (IsDlgButtonChecked(hDlg, OPT_VariantNocastle) ? VariantNoCastle :\r
-         (IsDlgButtonChecked(hDlg, OPT_Variant3Check) ? Variant3Check :\r
-         (IsDlgButtonChecked(hDlg, OPT_VariantGreat) ? VariantGreat :\r
-         (IsDlgButtonChecked(hDlg, OPT_VariantGiveaway) ? VariantGiveaway :\r
-         (IsDlgButtonChecked(hDlg, OPT_VariantTwilight) ? VariantTwilight :\r
-          VariantNormal ))))))))))))))))))))))))))));\r
+  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
+  }\r
+  return gameInfo.variant; // If no button checked, keep old\r
+}\r
+\r
+void\r
+VariantShowRadio(HWND hDlg)\r
+{\r
+  int i=0, j;\r
+  CheckDlgButton(hDlg, radioButton[gameInfo.variant], TRUE);\r
+  while((j = radioButton[i++]) != -2) {\r
+       if(j == -1) continue; // no menu button\r
+       EnableWindow(GetDlgItem(hDlg, j), appData.noChessProgram || strstr(first.variants, VariantName(i-1)));\r
+  }\r
 }\r
 \r
 LRESULT CALLBACK\r
@@ -787,94 +833,10 @@ NewVariantDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
   case WM_INITDIALOG: /* message: initialize dialog box */\r
     /* Center the dialog over the application window */\r
     CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));\r
+    Translate(hDlg, DLG_NewVariant);\r
+\r
     /* Initialize the dialog items */\r
-    switch (gameInfo.variant) {\r
-    case VariantNormal:\r
-      CheckDlgButton(hDlg, OPT_VariantNormal, TRUE);\r
-      break;\r
-    case VariantCrazyhouse:\r
-      CheckDlgButton(hDlg, OPT_VariantCrazyhouse, TRUE);\r
-      break;\r
-    case VariantBughouse:\r
-      CheckDlgButton(hDlg, OPT_VariantBughouse, TRUE);\r
-      break;\r
-    case VariantShogi:\r
-      CheckDlgButton(hDlg, OPT_VariantShogi, TRUE);\r
-      break;\r
-    case VariantXiangqi:\r
-      CheckDlgButton(hDlg, OPT_VariantXiangqi, TRUE);\r
-      break;\r
-    case VariantCapablanca:\r
-      CheckDlgButton(hDlg, OPT_VariantCapablanca, TRUE);\r
-      break;\r
-    case VariantGothic:\r
-      CheckDlgButton(hDlg, OPT_VariantGothic, TRUE);\r
-      break;\r
-    case VariantCourier:\r
-      CheckDlgButton(hDlg, OPT_VariantCourier, TRUE);\r
-      break;\r
-    case VariantKnightmate:\r
-      CheckDlgButton(hDlg, OPT_VariantKnightmate, TRUE);\r
-      break;\r
-    case VariantTwoKings:\r
-      CheckDlgButton(hDlg, OPT_VariantTwoKings, TRUE);\r
-      break;\r
-    case VariantFairy:\r
-      CheckDlgButton(hDlg, OPT_VariantFairy, TRUE);\r
-      break;\r
-    case VariantAtomic:\r
-      CheckDlgButton(hDlg, OPT_VariantAtomic, TRUE);\r
-      break;\r
-    case VariantSuicide:\r
-      CheckDlgButton(hDlg, OPT_VariantSuicide, TRUE);\r
-      break;\r
-    case VariantLosers:\r
-      CheckDlgButton(hDlg, OPT_VariantLosers, TRUE);\r
-      break;\r
-    case VariantShatranj:\r
-      CheckDlgButton(hDlg, OPT_VariantShatranj, TRUE);\r
-      break;\r
-    case VariantFischeRandom:\r
-      CheckDlgButton(hDlg, OPT_VariantFRC, TRUE);\r
-      break;\r
-    case VariantCapaRandom:\r
-      CheckDlgButton(hDlg, OPT_VariantCRC, TRUE);\r
-      break;\r
-    case VariantFalcon:\r
-      CheckDlgButton(hDlg, OPT_VariantFalcon, TRUE);\r
-      break;\r
-    case VariantCylinder:\r
-      CheckDlgButton(hDlg, OPT_VariantCylinder, TRUE);\r
-      break;\r
-    case Variant3Check:\r
-      CheckDlgButton(hDlg, OPT_Variant3Check, TRUE);\r
-      break;\r
-    case VariantSuper:\r
-      CheckDlgButton(hDlg, OPT_VariantSuper, TRUE);\r
-      break;\r
-    case VariantBerolina:\r
-      CheckDlgButton(hDlg, OPT_VariantBerolina, TRUE);\r
-      break;\r
-    case VariantJanus:\r
-      CheckDlgButton(hDlg, OPT_VariantJanus, TRUE);\r
-      break;\r
-    case VariantWildCastle:\r
-      CheckDlgButton(hDlg, OPT_VariantWildcastle, TRUE);\r
-      break;\r
-    case VariantNoCastle:\r
-      CheckDlgButton(hDlg, OPT_VariantNocastle, TRUE);\r
-      break;\r
-    case VariantGreat:\r
-      CheckDlgButton(hDlg, OPT_VariantGreat, TRUE);\r
-      break;\r
-    case VariantGiveaway:\r
-      CheckDlgButton(hDlg, OPT_VariantGiveaway, TRUE);\r
-      break;\r
-    case VariantTwilight:\r
-      CheckDlgButton(hDlg, OPT_VariantTwilight, TRUE);\r
-      break;\r
-    default: ;\r
-    }\r
+    VariantShowRadio(hDlg);\r
 \r
     SetDlgItemInt( hDlg, IDC_Files, -1, TRUE );\r
     SendDlgItemMessage( hDlg, IDC_Files, EM_SETSEL, 0, -1 );\r
@@ -892,7 +854,7 @@ NewVariantDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
   case WM_COMMAND: /* message: received a command */\r
     switch (LOWORD(wParam)) {\r
     case IDOK:\r
-      /* \r
+      /*\r
        * if we call EndDialog() after the call to ChangeBoardSize(),\r
        * then ChangeBoardSize() does not take effect, although the new\r
        * boardSize is saved. Go figure...\r
@@ -900,16 +862,17 @@ NewVariantDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
       EndDialog(hDlg, TRUE);\r
 \r
       v = VariantWhichRadio(hDlg);\r
-      if(!appData.noChessProgram) { char *name = VariantName(v), buf[MSG_SIZ];\r
+      if(!appData.noChessProgram) {\r
+       char *name = VariantName(v), buf[MSG_SIZ];\r
        if (first.protocolVersion > 1 && StrStr(first.variants, name) == NULL) {\r
-           /* [HGM] in protocol 2 we check if variant is suported by engine */\r
-           sprintf(buf, "Variant %s not supported by %s", name, first.tidy);\r
-           DisplayError(buf, 0);\r
-           return TRUE; /* treat as "Cancel" if first engine does not support it */\r
+         /* [HGM] in protocol 2 we check if variant is suported by engine */\r
+         snprintf(buf, MSG_SIZ, _("Variant %s not supported by %s"), name, first.tidy);\r
+         DisplayError(buf, 0);\r
+         return TRUE; /* treat as _("Cancel") if first engine does not support it */\r
        } else\r
        if (second.initDone && second.protocolVersion > 1 && StrStr(second.variants, name) == NULL) {\r
-           sprintf(buf, "Warning: second engine (%s) does not support this!", second.tidy);\r
-           DisplayError(buf, 0);   /* use of second engine is optional; only warn user */\r
+         snprintf(buf, MSG_SIZ, _("Warning: second engine (%s) does not support this!"), second.tidy);\r
+         DisplayError(buf, 0);   /* use of second engine is optional; only warn user */\r
        }\r
       }\r
 \r
@@ -1012,7 +975,7 @@ MyCreateFont(HWND hwnd, MyFont *font)
   font->mfp.underline = font->lf.lfUnderline;\r
   font->mfp.strikeout = font->lf.lfStrikeOut;\r
   font->mfp.charset = font->lf.lfCharSet;\r
-  strcpy(font->mfp.faceName, font->lf.lfFaceName);\r
+  safeStrCpy(font->mfp.faceName, font->lf.lfFaceName, sizeof(font->mfp.faceName)/sizeof(font->mfp.faceName[0]) );\r
   return TRUE;\r
 }\r
 \r
@@ -1022,12 +985,12 @@ UpdateSampleText(HWND hDlg, int id, MyColorizeAttribs *mca)
 {\r
   CHARFORMAT cf;\r
   cf.cbSize = sizeof(CHARFORMAT);\r
-  cf.dwMask = \r
+  cf.dwMask =\r
     CFM_COLOR|CFM_CHARSET|CFM_BOLD|CFM_ITALIC|CFM_UNDERLINE|CFM_STRIKEOUT|CFM_FACE|CFM_SIZE;\r
   cf.crTextColor = mca->color;\r
   cf.dwEffects = mca->effects;\r
-  strcpy(cf.szFaceName, font[boardSize][CONSOLE_FONT]->mfp.faceName);\r
-  /* \r
+  safeStrCpy(cf.szFaceName, font[boardSize][CONSOLE_FONT]->mfp.faceName, sizeof(cf.szFaceName)/sizeof(cf.szFaceName[0]) );\r
+  /*\r
    * The 20.0 below is in fact documented. yHeight is expressed in twips.\r
    * A twip is 1/20 of a font's point size. See documentation of CHARFORMAT.\r
    * --msw\r
@@ -1051,6 +1014,7 @@ ColorizeTextDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
     mca = colorizeAttribs[cc];\r
     /* Center the dialog over the application window */\r
     CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));\r
+    Translate(hDlg, DLG_Colorize);\r
     /* Initialize the dialog items */\r
     CheckDlgButton(hDlg, OPT_Bold, (mca.effects & CFE_BOLD) != 0);\r
     CheckDlgButton(hDlg, OPT_Italic, (mca.effects & CFE_ITALIC) != 0);\r
@@ -1058,14 +1022,14 @@ ColorizeTextDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
     CheckDlgButton(hDlg, OPT_Strikeout, (mca.effects & CFE_STRIKEOUT) != 0);\r
 \r
     /* get the current background color from the parent window */\r
-    SendMessage(GetWindow(hDlg, GW_OWNER),WM_COMMAND, \r
-               (WPARAM)WM_USER_GetConsoleBackground, \r
+    SendMessage(GetWindow(hDlg, GW_OWNER),WM_COMMAND,\r
+               (WPARAM)WM_USER_GetConsoleBackground,\r
                (LPARAM)&background);\r
 \r
     /* set the background color */\r
     SendDlgItemMessage(hDlg, OPT_Sample, EM_SETBKGNDCOLOR, FALSE, background);\r
 \r
-    SetDlgItemText(hDlg, OPT_Sample, mca.name);\r
+    SetDlgItemText(hDlg, OPT_Sample, T_(mca.name));\r
     UpdateSampleText(hDlg, OPT_Sample, &mca);\r
     return TRUE;\r
 \r
@@ -1082,7 +1046,7 @@ ColorizeTextDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
        cf.cbSize = sizeof(CHARFORMAT);\r
        cf.dwMask = CFM_COLOR;\r
        cf.crTextColor = mca.color;\r
-       SendDlgItemMessage(hwndConsole, OPT_ConsoleInput, \r
+       SendDlgItemMessage(hwndConsole, OPT_ConsoleInput,\r
          EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&cf);\r
       }\r
       EndDialog(hDlg, TRUE);\r
@@ -1162,15 +1126,22 @@ IcsOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 \r
     /* Center the dialog over the application window */\r
     CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));\r
+    Translate(hDlg, DLG_IcsOptions);\r
 \r
     /* Initialize the dialog items */\r
 #define CHECK_BOX(x,y) CheckDlgButton(hDlg, (x), (BOOL)(y))\r
 \r
+    CHECK_BOX(OPT_AutoKibitz, appData.autoKibitz);\r
     CHECK_BOX(OPT_AutoComment, appData.autoComment);\r
     CHECK_BOX(OPT_AutoObserve, appData.autoObserve);\r
     CHECK_BOX(OPT_GetMoveList, appData.getMoveList);\r
     CHECK_BOX(OPT_LocalLineEditing, appData.localLineEditing);\r
     CHECK_BOX(OPT_QuietPlay, appData.quietPlay);\r
+    CHECK_BOX(OPT_SeekGraph, appData.seekGraph);\r
+    CHECK_BOX(OPT_AutoRefresh, appData.autoRefresh);\r
+    CHECK_BOX(OPT_BgObserve, appData.bgObserve);\r
+    CHECK_BOX(OPT_DualBoard, appData.dualBoard);\r
+    CHECK_BOX(OPT_SmartMove, appData.oneClick);\r
     CHECK_BOX(OPT_Premove, appData.premove);\r
     CHECK_BOX(OPT_PremoveWhite, appData.premoveWhite);\r
     CHECK_BOX(OPT_PremoveBlack, appData.premoveBlack);\r
@@ -1179,10 +1150,11 @@ IcsOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 \r
 #undef CHECK_BOX\r
 \r
-    sprintf(buf, "%d", appData.icsAlarmTime / 1000);\r
+    snprintf(buf, MSG_SIZ, "%d", appData.icsAlarmTime / 1000);\r
     SetDlgItemText(hDlg, OPT_IcsAlarmTime, buf);\r
     SetDlgItemText(hDlg, OPT_PremoveWhiteText, appData.premoveWhiteText);\r
     SetDlgItemText(hDlg, OPT_PremoveBlackText, appData.premoveBlackText);\r
+    SetDlgItemText(hDlg, OPT_StartupChatBoxes, appData.chatBoxes);\r
 \r
     SendDlgItemMessage(hDlg, OPT_SampleShout,     EM_SETBKGNDCOLOR, 0, cbc);\r
     SendDlgItemMessage(hDlg, OPT_SampleSShout,    EM_SETBKGNDCOLOR, 0, cbc);\r
@@ -1195,16 +1167,16 @@ IcsOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
     SendDlgItemMessage(hDlg, OPT_SampleSeek,      EM_SETBKGNDCOLOR, 0, cbc);\r
     SendDlgItemMessage(hDlg, OPT_SampleNormal,    EM_SETBKGNDCOLOR, 0, cbc);\r
 \r
-    SetDlgItemText(hDlg, OPT_SampleShout,     mca[ColorShout].name);\r
-    SetDlgItemText(hDlg, OPT_SampleSShout,    mca[ColorSShout].name);\r
-    SetDlgItemText(hDlg, OPT_SampleChannel1,  mca[ColorChannel1].name);\r
-    SetDlgItemText(hDlg, OPT_SampleChannel,   mca[ColorChannel].name);\r
-    SetDlgItemText(hDlg, OPT_SampleKibitz,    mca[ColorKibitz].name);\r
-    SetDlgItemText(hDlg, OPT_SampleTell,      mca[ColorTell].name);\r
-    SetDlgItemText(hDlg, OPT_SampleChallenge, mca[ColorChallenge].name);\r
-    SetDlgItemText(hDlg, OPT_SampleRequest,   mca[ColorRequest].name);\r
-    SetDlgItemText(hDlg, OPT_SampleSeek,      mca[ColorSeek].name);\r
-    SetDlgItemText(hDlg, OPT_SampleNormal,    mca[ColorNormal].name);\r
+    SetDlgItemText(hDlg, OPT_SampleShout,     T_(mca[ColorShout].name));\r
+    SetDlgItemText(hDlg, OPT_SampleSShout,    T_(mca[ColorSShout].name));\r
+    SetDlgItemText(hDlg, OPT_SampleChannel1,  T_(mca[ColorChannel1].name));\r
+    SetDlgItemText(hDlg, OPT_SampleChannel,   T_(mca[ColorChannel].name));\r
+    SetDlgItemText(hDlg, OPT_SampleKibitz,    T_(mca[ColorKibitz].name));\r
+    SetDlgItemText(hDlg, OPT_SampleTell,      T_(mca[ColorTell].name));\r
+    SetDlgItemText(hDlg, OPT_SampleChallenge, T_(mca[ColorChallenge].name));\r
+    SetDlgItemText(hDlg, OPT_SampleRequest,   T_(mca[ColorRequest].name));\r
+    SetDlgItemText(hDlg, OPT_SampleSeek,      T_(mca[ColorSeek].name));\r
+    SetDlgItemText(hDlg, OPT_SampleNormal,    T_(mca[ColorNormal].name));\r
 \r
     UpdateSampleText(hDlg, OPT_SampleShout,     &mca[ColorShout]);\r
     UpdateSampleText(hDlg, OPT_SampleSShout,    &mca[ColorSShout]);\r
@@ -1223,7 +1195,7 @@ IcsOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
   case WM_COMMAND: /* message: received a command */\r
     switch (LOWORD(wParam)) {\r
 \r
-    case WM_USER_GetConsoleBackground: \r
+    case WM_USER_GetConsoleBackground:\r
       /* the ColorizeTextDialog needs the current background color */\r
       colorref = (COLORREF *)lParam;\r
       *colorref = cbc;\r
@@ -1233,8 +1205,8 @@ IcsOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
       /* Read changed options from the dialog box */\r
       GetDlgItemText(hDlg, OPT_IcsAlarmTime, buf, MSG_SIZ);\r
       if (sscanf(buf, "%d", &number) != 1 || (number < 0)){\r
-         MessageBox(hDlg, "Invalid ICS Alarm Time",\r
-                    "Option Error", MB_OK|MB_ICONEXCLAMATION);\r
+         MessageBox(hDlg, _("Invalid ICS Alarm Time"),\r
+                    _("Option Error"), MB_OK|MB_ICONEXCLAMATION);\r
          return FALSE;\r
       }\r
 \r
@@ -1244,17 +1216,25 @@ IcsOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
       appData.premove          = IS_CHECKED(OPT_Premove);\r
       appData.premoveWhite     = IS_CHECKED(OPT_PremoveWhite);\r
       appData.premoveBlack     = IS_CHECKED(OPT_PremoveBlack);\r
+      appData.autoKibitz       = IS_CHECKED(OPT_AutoKibitz);\r
       appData.autoComment      = IS_CHECKED(OPT_AutoComment);\r
       appData.autoObserve      = IS_CHECKED(OPT_AutoObserve);\r
       appData.getMoveList      = IS_CHECKED(OPT_GetMoveList);\r
       appData.localLineEditing = IS_CHECKED(OPT_LocalLineEditing);\r
       appData.quietPlay        = IS_CHECKED(OPT_QuietPlay);\r
+      appData.seekGraph        = IS_CHECKED(OPT_SeekGraph);\r
+      appData.autoRefresh      = IS_CHECKED(OPT_AutoRefresh);\r
+      appData.bgObserve        = IS_CHECKED(OPT_BgObserve);\r
+      appData.dualBoard        = IS_CHECKED(OPT_DualBoard);\r
+      appData.oneClick         = IS_CHECKED(OPT_SmartMove);\r
 \r
 #undef IS_CHECKED\r
 \r
       appData.icsAlarmTime = number * 1000;\r
       GetDlgItemText(hDlg, OPT_PremoveWhiteText, appData.premoveWhiteText, 5);\r
       GetDlgItemText(hDlg, OPT_PremoveBlackText, appData.premoveBlackText, 5);\r
+      GetDlgItemText(hDlg, OPT_StartupChatBoxes, buf, sizeof(buf));\r
+      buf[sizeof(buf)-1] = NULLCHAR; appData.chatBoxes = StrSave(buf); // memory leak\r
 \r
       if (appData.localLineEditing) {\r
        DontEcho();\r
@@ -1280,20 +1260,20 @@ IcsOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
        cf.dwMask = CFM_COLOR;\r
        cf.crTextColor = ParseColorName(COLOR_NORMAL);\r
 \r
-       SendDlgItemMessage(hwndConsole, OPT_ConsoleInput, \r
+       SendDlgItemMessage(hwndConsole, OPT_ConsoleInput,\r
          EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&cf);\r
-        SendDlgItemMessage(hwndConsole, OPT_ConsoleText, \r
+        SendDlgItemMessage(hwndConsole, OPT_ConsoleText,\r
          EM_SETBKGNDCOLOR, FALSE, background);\r
-       SendDlgItemMessage(hwndConsole, OPT_ConsoleInput, \r
+       SendDlgItemMessage(hwndConsole, OPT_ConsoleInput,\r
          EM_SETBKGNDCOLOR, FALSE, background);\r
       }\r
 \r
       if (cbc != consoleBackgroundColor) {\r
        consoleBackgroundColor = cbc;\r
        if (appData.colorize) {\r
-         SendDlgItemMessage(hwndConsole, OPT_ConsoleText, \r
+         SendDlgItemMessage(hwndConsole, OPT_ConsoleText,\r
            EM_SETBKGNDCOLOR, FALSE, consoleBackgroundColor);\r
-         SendDlgItemMessage(hwndConsole, OPT_ConsoleInput, \r
+         SendDlgItemMessage(hwndConsole, OPT_ConsoleInput,\r
            EM_SETBKGNDCOLOR, FALSE, consoleBackgroundColor);\r
        }\r
       }\r
@@ -1322,7 +1302,7 @@ IcsOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 \r
     case OPT_ChooseChannel1Color:\r
       ColorizeTextPopup(hDlg, ColorChannel1);\r
-      UpdateSampleText(hDlg, OPT_SampleChannel1, \r
+      UpdateSampleText(hDlg, OPT_SampleChannel1,\r
                       &colorizeAttribs[ColorChannel1]);\r
       break;\r
 \r
@@ -1378,7 +1358,7 @@ IcsOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 \r
     case OPT_DefaultColors:\r
       for (i=0; i < NColorClasses - 1; i++)\r
-       ParseAttribs(&mca[i].color, \r
+       ParseAttribs(&mca[i].color,\r
                     &mca[i].effects,\r
                     defaultTextAttribs[i]);\r
 \r
@@ -1443,21 +1423,21 @@ SetSampleFontText(HWND hwnd, int id, const MyFont *mf)
   POINT center;\r
   int len;\r
 \r
-  len = sprintf(buf, "%.0f pt. %s%s%s\n",\r
-               mf->mfp.pointSize, mf->mfp.faceName,\r
-               mf->mfp.bold ? " bold" : "",\r
-               mf->mfp.italic ? " italic" : "");\r
+  len = snprintf(buf, MSG_SIZ, "%.0f pt. %s%s%s\n",\r
+                mf->mfp.pointSize, mf->mfp.faceName,\r
+                mf->mfp.bold ? " bold" : "",\r
+                mf->mfp.italic ? " italic" : "");\r
   SetDlgItemText(hwnd, id, buf);\r
 \r
   hControl = GetDlgItem(hwnd, id);\r
   hdc = GetDC(hControl);\r
   SetMapMode(hdc, MM_TEXT);    /* 1 pixel == 1 logical unit */\r
   oldFont = SelectObject(hdc, mf->hf);\r
-  \r
+\r
   /* get number of logical units necessary to display font name */\r
   GetTextExtentPoint32(hdc, buf, len, &size);\r
 \r
-  /* calculate formatting rectangle in the rich edit control.  \r
+  /* calculate formatting rectangle in the rich edit control.\r
    * May be larger or smaller than the actual control.\r
    */\r
   GetClientRect(hControl, &rectClient);\r
@@ -1473,7 +1453,7 @@ SetSampleFontText(HWND hwnd, int id, const MyFont *mf)
   cf.dwEffects = 0;\r
   if (mf->lf.lfWeight == FW_BOLD) cf.dwEffects |= CFE_BOLD;\r
   if (mf->lf.lfItalic) cf.dwEffects |= CFE_ITALIC;\r
-  strcpy(cf.szFaceName, mf->mfp.faceName);\r
+  safeStrCpy(cf.szFaceName, mf->mfp.faceName, sizeof(cf.szFaceName)/sizeof(cf.szFaceName[0]) );\r
   /*\r
    * yHeight is expressed in twips.  A twip is 1/20 of a font's point\r
    * size. See documentation of CHARFORMAT.  --msw\r
@@ -1500,7 +1480,7 @@ CopyFont(MyFont *dest, const MyFont *src)
   dest->mfp.underline = src->mfp.underline;\r
   dest->mfp.strikeout = src->mfp.strikeout;\r
   dest->mfp.charset   = src->mfp.charset;\r
-  lstrcpy(dest->mfp.faceName, src->mfp.faceName);\r
+  safeStrCpy(dest->mfp.faceName, src->mfp.faceName, sizeof(dest->mfp.faceName)/sizeof(dest->mfp.faceName[0]) );\r
   CreateFontInMF(dest);\r
 }\r
 \r
@@ -1520,6 +1500,7 @@ FontOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
     for (i=0; i < NUM_FONTS; i++)\r
       CopyFont(&workFont[i], font[boardSize][i]);\r
 \r
+    Translate(hDlg, DLG_Fonts);\r
     if (!appData.icsActive)\r
       EnableWindow(GetDlgItem(hDlg, OPT_ChooseConsoleFont), FALSE);\r
 \r
@@ -1582,7 +1563,7 @@ FontOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 \r
       if (commentDialog) {\r
        SendDlgItemMessage(commentDialog, OPT_CommentText,\r
-         WM_SETFONT, (WPARAM)font[boardSize][COMMENT_FONT]->hf, \r
+         WM_SETFONT, (WPARAM)font[boardSize][COMMENT_FONT]->hf,\r
          MAKELPARAM(TRUE, 0));\r
        GetClientRect(GetDlgItem(commentDialog, OPT_CommentText), &rect);\r
        InvalidateRect(commentDialog, &rect, TRUE);\r
@@ -1590,7 +1571,7 @@ FontOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 \r
       if (editTagsDialog) {\r
        SendDlgItemMessage(editTagsDialog, OPT_TagsText,\r
-         WM_SETFONT, (WPARAM)font[boardSize][EDITTAGS_FONT]->hf, \r
+         WM_SETFONT, (WPARAM)font[boardSize][EDITTAGS_FONT]->hf,\r
          MAKELPARAM(TRUE, 0));\r
        GetClientRect(GetDlgItem(editTagsDialog, OPT_TagsText), &rect);\r
        InvalidateRect(editTagsDialog, &rect, TRUE);\r
@@ -1598,7 +1579,7 @@ FontOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 \r
       if( moveHistoryDialog != NULL ) {\r
        SendDlgItemMessage(moveHistoryDialog, IDC_MoveHistory,\r
-         WM_SETFONT, (WPARAM)font[boardSize][MOVEHISTORY_FONT]->hf, \r
+         WM_SETFONT, (WPARAM)font[boardSize][MOVEHISTORY_FONT]->hf,\r
          MAKELPARAM(TRUE, 0));\r
         SendMessage( moveHistoryDialog, WM_INITDIALOG, 0, 0 );\r
 //     InvalidateRect(editTagsDialog, NULL, TRUE); // [HGM] this ws improperly cloned?\r
@@ -1606,10 +1587,10 @@ FontOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 \r
       if( engineOutputDialog != NULL ) {\r
        SendDlgItemMessage(engineOutputDialog, IDC_EngineMemo1,\r
-         WM_SETFONT, (WPARAM)font[boardSize][MOVEHISTORY_FONT]->hf, \r
+         WM_SETFONT, (WPARAM)font[boardSize][MOVEHISTORY_FONT]->hf,\r
          MAKELPARAM(TRUE, 0));\r
        SendDlgItemMessage(engineOutputDialog, IDC_EngineMemo2,\r
-         WM_SETFONT, (WPARAM)font[boardSize][MOVEHISTORY_FONT]->hf, \r
+         WM_SETFONT, (WPARAM)font[boardSize][MOVEHISTORY_FONT]->hf,\r
          MAKELPARAM(TRUE, 0));\r
       }\r
 \r
@@ -1699,22 +1680,22 @@ FontsOptionsPopup(HWND hwnd)
 \r
 \r
 SoundComboData soundComboData[] = {\r
-  {"Move", NULL},\r
-  {"Bell", NULL},\r
-  {"ICS Alarm", NULL},\r
-  {"ICS Win", NULL},\r
-  {"ICS Loss", NULL},\r
-  {"ICS Draw", NULL},\r
-  {"ICS Unfinished", NULL},\r
-  {"Shout", NULL},\r
-  {"SShout/CShout", NULL},\r
-  {"Channel 1", NULL},\r
-  {"Channel", NULL},\r
-  {"Kibitz", NULL},\r
-  {"Tell", NULL},\r
-  {"Challenge", NULL},\r
-  {"Request", NULL},\r
-  {"Seek", NULL},\r
+  {N_("Move"), NULL},\r
+  {N_("Bell"), NULL},\r
+  {N_("ICS Alarm"), NULL},\r
+  {N_("ICS Win"), NULL},\r
+  {N_("ICS Loss"), NULL},\r
+  {N_("ICS Draw"), NULL},\r
+  {N_("ICS Unfinished"), NULL},\r
+  {N_("Shout"), NULL},\r
+  {N_("SShout/CShout"), NULL},\r
+  {N_("Channel 1"), NULL},\r
+  {N_("Channel"), NULL},\r
+  {N_("Kibitz"), NULL},\r
+  {N_("Tell"), NULL},\r
+  {N_("Challenge"), NULL},\r
+  {N_("Request"), NULL},\r
+  {N_("Seek"), NULL},\r
   {NULL, NULL},\r
 };\r
 \r
@@ -1760,9 +1741,9 @@ InitSoundCombo(HWND hwndCombo, SoundComboData *scd)
 \r
   /* send the labels to the combo box */\r
   while (scd->label) {\r
-    err = SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM) scd->label);\r
+    err = SendMessage(hwndCombo, CB_ADDSTRING, 0, (LPARAM) T_(scd->label));\r
     if (err != cnt++) {\r
-      sprintf(buf, "InitSoundCombo(): err '%d', cnt '%d'\n",\r
+      snprintf(buf, MSG_SIZ,  "InitSoundCombo(): err '%d', cnt '%d'\n",\r
          (int)err, (int)cnt);\r
       MessageBox(NULL, buf, NULL, MB_OK);\r
     }\r
@@ -1823,7 +1804,7 @@ void
 DisplaySelectedSound(HWND hDlg, HWND hCombo, const char *name)\r
 {\r
   int radio;\r
-  /* \r
+  /*\r
    * I think it's best to clear the combo and edit boxes. It looks stupid\r
    * to have a value from another sound event sitting there grayed out.\r
    */\r
@@ -1849,7 +1830,7 @@ DisplaySelectedSound(HWND hDlg, HWND hCombo, const char *name)
       radio = OPT_NoSound;\r
     } else {\r
       radio = OPT_BuiltInSound;\r
-      if (SendMessage(hCombo, CB_SELECTSTRING, (WPARAM) -1, \r
+      if (SendMessage(hCombo, CB_SELECTSTRING, (WPARAM) -1,\r
                      (LPARAM) (name + 1)) == CB_ERR) {\r
        SendMessage(hCombo, CB_SETCURSEL, (WPARAM) -1, (LPARAM) 0);\r
        SendMessage(hCombo, WM_SETTEXT, (WPARAM) 0, (LPARAM) (name + 1));\r
@@ -1864,7 +1845,7 @@ DisplaySelectedSound(HWND hDlg, HWND hCombo, const char *name)
   SoundDialogSetEnables(hDlg, radio);\r
   CheckRadioButton(hDlg, OPT_NoSound, OPT_WavFile, radio);\r
 }\r
-    \r
+\r
 \r
 char *builtInSoundNames[] = BUILT_IN_SOUND_NAMES;\r
 \r
@@ -1888,6 +1869,7 @@ SoundOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
   case WM_INITDIALOG:\r
     /* Center the dialog over the application window */\r
     CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));\r
+    Translate(hDlg, DLG_Sound);\r
 \r
     /* Initialize the built-in sounds combo */\r
     hBISN = GetDlgItem(hDlg, OPT_BuiltInSoundName);\r
@@ -1905,16 +1887,16 @@ SoundOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 \r
   case WM_COMMAND: /* message: received a command */\r
 \r
-    if (((HWND)lParam == hSoundCombo) && \r
+    if (((HWND)lParam == hSoundCombo) &&\r
        (HIWORD(wParam) == CBN_SELCHANGE)) {\r
-      /* \r
+      /*\r
        * the user has selected a new sound event. We must store the name for\r
        * the previously selected event, then retrieve the name for the\r
-       * newly selected event and update the dialog. \r
+       * newly selected event and update the dialog.\r
        */\r
       radio = SoundDialogWhichRadio(hDlg);\r
       newName = strdup(SoundDialogGetName(hDlg, radio));\r
-      \r
+\r
       if (strcmp(newName, soundComboData[index].name) != 0) {\r
        free(soundComboData[index].name);\r
        soundComboData[index].name = newName;\r
@@ -1925,13 +1907,13 @@ SoundOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
       /* now get the settings for the newly selected event */\r
       index = SendMessage(hSoundCombo, CB_GETCURSEL, (WPARAM)0, (LPARAM)0);\r
       DisplaySelectedSound(hDlg, hBISN, soundComboData[index].name);\r
-      \r
+\r
       return TRUE;\r
     }\r
     switch (LOWORD(wParam)) {\r
     case IDOK:\r
-      /* \r
-       * save the name for the currently selected sound event \r
+      /*\r
+       * save the name for the currently selected sound event\r
        */\r
       radio = SoundDialogWhichRadio(hDlg);\r
       newName = strdup(SoundDialogGetName(hDlg, radio));\r
@@ -1955,7 +1937,7 @@ SoundOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
       }\r
       for ( cc = (ColorClass)0; cc < NColorClasses - 2; cc++) {\r
        index = (int)cc + (int)NSoundClasses;\r
-       if (strcmp(soundComboData[index].name, \r
+       if (strcmp(soundComboData[index].name,\r
                   textAttribs[cc].sound.name) != 0) {\r
          free(textAttribs[cc].sound.name);\r
          textAttribs[cc].sound.name = strdup(soundComboData[index].name);\r
@@ -2003,7 +1985,7 @@ SoundOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 \r
     case OPT_BrowseSound:\r
       f = OpenFileDialog(hDlg, "rb", NULL, "wav", SOUND_FILT,\r
-       "Browse for Sound File", NULL, NULL, buf);\r
+       _("Browse for Sound File"), NULL, NULL, buf);\r
       if (f != NULL) {\r
        fclose(f);\r
        SetDlgItemText(hDlg, OPT_WavFileName, buf);\r
@@ -2128,7 +2110,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);\r
 }\r
 \r
 \r
@@ -2136,7 +2118,7 @@ VOID PrintCommSettings(FILE *f, char *name, DCB *dcb)
 {\r
   char *flow = "??", *parity = "??", *stopBits = "??";\r
   ComboData *cd;\r
-  \r
+\r
   cd = cdParity;\r
   while (cd->label != NULL) {\r
     if (dcb->Parity == cd->value) {\r
@@ -2208,6 +2190,7 @@ CommPortOptionsDialog(HWND hDlg, UINT message, WPARAM wParam,     LPARAM lParam)
   case WM_INITDIALOG: /* message: initialize dialog box */\r
     /* Center the dialog over the application window */\r
     CenterWindow (hDlg, GetWindow(hDlg, GW_OWNER));\r
+    Translate(hDlg, DLG_CommPort);\r
     /* Initialize the dialog items */\r
     /* !! There should probably be some synchronization\r
        in accessing hCommPort and dcb.  Or does modal nature\r
@@ -2225,7 +2208,7 @@ CommPortOptionsDialog(HWND hDlg, UINT message, WPARAM wParam,     LPARAM lParam)
 \r
     hwndCombo = GetDlgItem(hDlg, OPT_DataRate);\r
     InitCombo(hwndCombo, cdDataRate);\r
-    sprintf(buf, "%u", (int)dcb.BaudRate);\r
+    snprintf(buf, MSG_SIZ, "%u", (int)dcb.BaudRate);\r
     if (SendMessage(hwndCombo, CB_SELECTSTRING, (WPARAM) -1, (LPARAM) buf) == CB_ERR) {\r
       SendMessage(hwndCombo, CB_SETCURSEL, (WPARAM) -1, (LPARAM) 0);\r
       SendMessage(hwndCombo, WM_SETTEXT, (WPARAM) 0, (LPARAM) buf);\r
@@ -2287,8 +2270,8 @@ CommPortOptionsDialog(HWND hDlg, UINT message, WPARAM wParam,     LPARAM lParam)
       hwndCombo = GetDlgItem(hDlg, OPT_DataRate);\r
       SendMessage(hwndCombo, WM_GETTEXT, (WPARAM) MSG_SIZ, (LPARAM) buf);\r
       if (sscanf(buf, "%u", &value) != 1) {\r
-       MessageBox(hDlg, "Invalid data rate",\r
-                  "Option Error", MB_OK|MB_ICONEXCLAMATION);\r
+       MessageBox(hDlg, _("Invalid data rate"),\r
+                  _("Option Error"), MB_OK|MB_ICONEXCLAMATION);\r
        return TRUE;\r
       }\r
       dcb.BaudRate = value;\r
@@ -2331,11 +2314,11 @@ CommPortOptionsDialog(HWND hDlg, UINT message, WPARAM wParam,   LPARAM lParam)
       }\r
       if (!SetCommState(hCommPort, (LPDCB) &dcb)) {\r
        err = GetLastError();\r
-       switch(MessageBox(hDlg, \r
+       switch(MessageBox(hDlg,\r
                         "Failed to set comm port state;\r\ninvalid options?",\r
-                        "Option Error", MB_ABORTRETRYIGNORE|MB_ICONQUESTION)) {\r
+                        _("Option Error"), MB_ABORTRETRYIGNORE|MB_ICONQUESTION)) {\r
        case IDABORT:\r
-         DisplayFatalError("Failed to set comm port state", err, 1);\r
+         DisplayFatalError(_("Failed to set comm port state"), err, 1);\r
          exit(1);  /*is it ok to do this from here?*/\r
 \r
        case IDRETRY:\r
@@ -2396,10 +2379,11 @@ LoadOptions(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
   case WM_INITDIALOG: /* message: initialize dialog box */\r
     /* Center the dialog over the application window */\r
     CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));\r
+    Translate(hDlg, DLG_LoadOptions);\r
     /* Initialize the dialog items */\r
     if (appData.timeDelay >= 0.0) {\r
       CheckDlgButton(hDlg, OPT_Autostep, TRUE);\r
-      sprintf(buf, "%.2g", appData.timeDelay);\r
+      snprintf(buf, MSG_SIZ, "%.2g", appData.timeDelay);\r
       SetDlgItemText(hDlg, OPT_ASTimeDelay, buf);\r
     } else {\r
       CheckDlgButton(hDlg, OPT_Autostep, FALSE);\r
@@ -2414,8 +2398,8 @@ LoadOptions(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
       if (IsDlgButtonChecked(hDlg, OPT_Autostep)) {\r
        GetDlgItemText(hDlg, OPT_ASTimeDelay, buf, MSG_SIZ);\r
        if (sscanf(buf, "%f", &fnumber) != 1) {\r
-         MessageBox(hDlg, "Invalid load game step rate",\r
-                    "Option Error", MB_OK|MB_ICONEXCLAMATION);\r
+         MessageBox(hDlg, _("Invalid load game step rate"),\r
+                    _("Option Error"), MB_OK|MB_ICONEXCLAMATION);\r
          return FALSE;\r
        }\r
        appData.timeDelay = fnumber;\r
@@ -2439,7 +2423,7 @@ LoadOptions(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 }\r
 \r
 \r
-VOID \r
+VOID\r
 LoadOptionsPopup(HWND hwnd)\r
 {\r
   FARPROC lpProc = MakeProcInstance((FARPROC)LoadOptions, hInst);\r
@@ -2481,6 +2465,7 @@ SaveOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
   case WM_INITDIALOG: /* message: initialize dialog box */\r
     /* Center the dialog over the application window */\r
     CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));\r
+    Translate(hDlg, DLG_SaveOptions);\r
     /* Initialize the dialog items */\r
     if (*appData.saveGameFile != NULLCHAR) {\r
       CheckDlgButton(hDlg, OPT_Autosave, (UINT) TRUE);\r
@@ -2512,8 +2497,8 @@ SaveOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
        } else /*if (IsDlgButtonChecked(hDlg, OPT_AVToFile))*/ {\r
          GetDlgItemText(hDlg, OPT_AVFilename, buf, MSG_SIZ);\r
          if (*buf == NULLCHAR) {\r
-           MessageBox(hDlg, "Invalid save game file name",\r
-                      "Option Error", MB_OK|MB_ICONEXCLAMATION);\r
+           MessageBox(hDlg, _("Invalid save game file name"),\r
+                      _("Option Error"), MB_OK|MB_ICONEXCLAMATION);\r
            return FALSE;\r
          }\r
          if ((isalpha(buf[0]) && buf[1] == ':') ||\r
@@ -2546,9 +2531,9 @@ SaveOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
       return TRUE;\r
 \r
     case OPT_AVBrowse:\r
-      f = OpenFileDialog(hDlg, "a", NULL, \r
-                        appData.oldSaveStyle ? "gam" : "pgn", \r
-                        GAME_FILT, "Browse for Auto Save File", \r
+      f = OpenFileDialog(hDlg, "a", NULL,\r
+                        appData.oldSaveStyle ? "gam" : "pgn",\r
+                        GAME_FILT, _("Browse for Auto Save File"),\r
                         NULL, NULL, buf);\r
       if (f != NULL) {\r
        fclose(f);\r
@@ -2611,6 +2596,7 @@ TimeControl(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
   case WM_INITDIALOG: /* message: initialize dialog box */\r
     /* Center the dialog over the application window */\r
     CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));\r
+    Translate(hDlg, DLG_TimeControl);\r
     /* Initialize the dialog items */\r
     if (appData.clockMode && !appData.icsActive) {\r
       if (searchTime) {\r
@@ -2651,8 +2637,8 @@ TimeControl(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
       if (IsDlgButtonChecked(hDlg, OPT_TCUseFixed)) {\r
        st = GetDlgItemInt(hDlg, OPT_TCFixed, &ok, FALSE);\r
        if (!ok || st <= 0) {\r
-         MessageBox(hDlg, "Invalid max time per move",\r
-                    "Option Error", MB_OK|MB_ICONEXCLAMATION);\r
+         MessageBox(hDlg, _("Invalid max time per move"),\r
+                    _("Option Error"), MB_OK|MB_ICONEXCLAMATION);\r
          return FALSE;\r
        }\r
       } else\r
@@ -2660,28 +2646,28 @@ TimeControl(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
        increment = -1;\r
        mps = GetDlgItemInt(hDlg, OPT_TCMoves, &ok, FALSE);\r
        if (!ok || mps <= 0) {\r
-         MessageBox(hDlg, "Invalid moves per time control",\r
-                    "Option Error", MB_OK|MB_ICONEXCLAMATION);\r
+         MessageBox(hDlg, _("Invalid moves per time control"),\r
+                    _("Option Error"), MB_OK|MB_ICONEXCLAMATION);\r
          return FALSE;\r
        }\r
        GetDlgItemText(hDlg, OPT_TCTime, buf, MSG_SIZ);\r
        if (!ParseTimeControl(buf, increment, mps)) {\r
-         MessageBox(hDlg, "Invalid minutes per time control",\r
-                    "Option Error", MB_OK|MB_ICONEXCLAMATION);\r
+         MessageBox(hDlg, _("Invalid minutes per time control"),\r
+                    _("Option Error"), MB_OK|MB_ICONEXCLAMATION);\r
          return FALSE;\r
        }\r
       tc = buf;\r
       } else {\r
        increment = GetDlgItemInt(hDlg, OPT_TCInc, &ok, FALSE);\r
        if (!ok || increment < 0) {\r
-         MessageBox(hDlg, "Invalid increment",\r
-                    "Option Error", MB_OK|MB_ICONEXCLAMATION);\r
+         MessageBox(hDlg, _("Invalid increment"),\r
+                    _("Option Error"), MB_OK|MB_ICONEXCLAMATION);\r
          return FALSE;\r
        }\r
        GetDlgItemText(hDlg, OPT_TCTime2, buf, MSG_SIZ);\r
        if (!ParseTimeControl(buf, increment, mps)) {\r
-         MessageBox(hDlg, "Invalid initial time",\r
-                    "Option Error", MB_OK|MB_ICONEXCLAMATION);\r
+         MessageBox(hDlg, _("Invalid initial time"),\r
+                    _("Option Error"), MB_OK|MB_ICONEXCLAMATION);\r
          return FALSE;\r
        }\r
       tc = buf;\r
@@ -2689,8 +2675,8 @@ TimeControl(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
       odds1 = GetDlgItemInt(hDlg, OPT_TCOdds1, &ok, FALSE);\r
       odds2 = GetDlgItemInt(hDlg, OPT_TCOdds2, &ok2, FALSE);\r
       if (!ok || !ok2 || odds1 <= 0 || odds2 <= 0) {\r
-         MessageBox(hDlg, "Invalid time-odds factor",\r
-                    "Option Error", MB_OK|MB_ICONEXCLAMATION);\r
+         MessageBox(hDlg, _("Invalid time-odds factor"),\r
+                    _("Option Error"), MB_OK|MB_ICONEXCLAMATION);\r
          return FALSE;\r
       }\r
       searchTime = st;\r
@@ -2720,7 +2706,7 @@ VOID
 TimeControlOptionsPopup(HWND hwnd)\r
 {\r
   if (gameMode != BeginningOfGame) {\r
-    DisplayError("Changing time control during a game is not implemented", 0);\r
+    DisplayError(_("Changing time control during a game is not implemented"), 0);\r
   } else {\r
     FARPROC lpProc = MakeProcInstance((FARPROC)TimeControl, hInst);\r
     DialogBox(hInst, MAKEINTRESOURCE(DLG_TimeControl), hwnd, (DLGPROC) lpProc);\r
@@ -2745,6 +2731,7 @@ LRESULT CALLBACK EnginePlayOptionsDialog(HWND hDlg, UINT message, WPARAM wParam,
 \r
     /* Center the dialog over the application window */\r
     CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));\r
+    Translate(hDlg, DLG_EnginePlayOptions);\r
 \r
     /* Initialize the dialog items */\r
     CHECK_BOX(IDC_EpPeriodicUpdates, appData.periodicUpdates);\r
@@ -2793,8 +2780,8 @@ LRESULT CALLBACK EnginePlayOptionsDialog(HWND hDlg, UINT message, WPARAM wParam,
       appData.ruleMoves = GetDlgItemInt(hDlg, IDC_RuleMoves, NULL, FALSE );\r
       appData.drawRepeats = (int) GetDlgItemInt(hDlg, IDC_DrawRepeats, NULL, FALSE );\r
 \r
-      appData.firstScoreIsAbsolute  = IS_CHECKED(IDC_ScoreAbs1);\r
-      appData.secondScoreIsAbsolute = IS_CHECKED(IDC_ScoreAbs2);\r
+      first.scoreIsAbsolute  = appData.firstScoreIsAbsolute  = IS_CHECKED(IDC_ScoreAbs1);\r
+      second.scoreIsAbsolute = appData.secondScoreIsAbsolute = IS_CHECKED(IDC_ScoreAbs2);\r
 \r
       EndDialog(hDlg, TRUE);\r
       return TRUE;\r
@@ -2849,7 +2836,7 @@ static BOOL BrowseForFolder( const char * title, char * path )
 \r
     ZeroMemory( &bi, sizeof(bi) );\r
 \r
-    bi.lpszTitle = title == 0 ? "Choose Folder" : title;\r
+    bi.lpszTitle = title == 0 ? _("Choose Folder") : title;\r
     bi.ulFlags = BIF_RETURNONLYFSDIRS;\r
 \r
     pidl = SHBrowseForFolder( &bi );\r
@@ -2880,6 +2867,7 @@ LRESULT CALLBACK UciOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM
 \r
     /* Center the dialog over the application window */\r
     CenterWindow (hDlg, GetWindow (hDlg, GW_OWNER));\r
+    Translate(hDlg, DLG_OptionsUCI);\r
 \r
     /* Initialize the dialog items */\r
     SetDlgItemText( hDlg, IDC_PolyglotDir, appData.polyglotDir );\r
@@ -2893,6 +2881,9 @@ LRESULT CALLBACK UciOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM
     // [HGM] book: tick boxes for own book use\r
     CheckDlgButton( hDlg, IDC_OwnBook1, (BOOL) appData.firstHasOwnBookUCI );\r
     CheckDlgButton( hDlg, IDC_OwnBook2, (BOOL) appData.secondHasOwnBookUCI );\r
+    SetDlgItemInt( hDlg, IDC_BookDep, appData.bookDepth, TRUE );\r
+    SetDlgItemInt( hDlg, IDC_BookStr, appData.bookStrength, TRUE );\r
+    SetDlgItemInt( hDlg, IDC_Games, appData.defaultMatchGames, TRUE );\r
 \r
     SendDlgItemMessage( hDlg, IDC_PolyglotDir, EM_SETSEL, 0, -1 );\r
 \r
@@ -2913,10 +2904,13 @@ LRESULT CALLBACK UciOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM
       // [HGM] smp: get nr of cores:\r
       oldCores = appData.smpCores;\r
       appData.smpCores = GetDlgItemInt(hDlg, IDC_Cores, NULL, FALSE );\r
-      if(appData.smpCores != oldCores) NewSettingEvent(FALSE, "cores", appData.smpCores);\r
+      if(appData.smpCores != oldCores) NewSettingEvent(FALSE, &(first.maxCores), "cores", appData.smpCores);\r
       // [HGM] book: read tick boxes for own book use\r
       appData.firstHasOwnBookUCI  = (Boolean) IsDlgButtonChecked( hDlg, IDC_OwnBook1 );\r
       appData.secondHasOwnBookUCI = (Boolean) IsDlgButtonChecked( hDlg, IDC_OwnBook2 );\r
+      appData.bookDepth = GetDlgItemInt(hDlg, IDC_BookDep, NULL, FALSE );\r
+      appData.bookStrength = GetDlgItemInt(hDlg, IDC_BookStr, NULL, FALSE );\r
+      appData.defaultMatchGames = GetDlgItemInt(hDlg, IDC_Games, NULL, FALSE );\r
 \r
       if(gameMode == BeginningOfGame) Reset(TRUE, TRUE);\r
       EndDialog(hDlg, TRUE);\r
@@ -2928,7 +2922,7 @@ LRESULT CALLBACK UciOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM
 \r
     case IDC_BrowseForBook:\r
       {\r
-          char filter[] = { \r
+          char filter[] = {\r
               'A','l','l',' ','F','i','l','e','s', 0,\r
               '*','.','*', 0,\r
               'B','I','N',' ','F','i','l','e','s', 0,\r
@@ -2937,7 +2931,7 @@ LRESULT CALLBACK UciOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM
 \r
           OPENFILENAME ofn;\r
 \r
-          strcpy( buf, "" );\r
+          safeStrCpy( buf, "" , sizeof( buf)/sizeof( buf[0]) );\r
 \r
           ZeroMemory( &ofn, sizeof(ofn) );\r
 \r
@@ -2947,7 +2941,7 @@ LRESULT CALLBACK UciOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM
           ofn.lpstrFilter = filter;\r
           ofn.lpstrFile = buf;\r
           ofn.nMaxFile = sizeof(buf);\r
-          ofn.lpstrTitle = "Choose Book";\r
+          ofn.lpstrTitle = _("Choose Book");\r
           ofn.Flags = OFN_FILEMUSTEXIST | OFN_LONGNAMES | OFN_HIDEREADONLY;\r
 \r
           if( GetOpenFileName( &ofn ) ) {\r
@@ -2957,19 +2951,19 @@ LRESULT CALLBACK UciOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM
       return TRUE;\r
 \r
     case IDC_BrowseForPolyglotDir:\r
-      if( BrowseForFolder( "Choose Polyglot Directory", buf ) ) {\r
+      if( BrowseForFolder( _("Choose Polyglot Directory"), buf ) ) {\r
         SetDlgItemText( hDlg, IDC_PolyglotDir, buf );\r
 \r
         strcat( buf, "\\polyglot.exe" );\r
 \r
         if( GetFileAttributes(buf) == 0xFFFFFFFF ) {\r
-            MessageBox( hDlg, "Polyglot was not found in the specified folder!", "Warning", MB_OK | MB_ICONWARNING );\r
+            MessageBox( hDlg, _("Polyglot was not found in the specified folder!"), "Warning", MB_OK | MB_ICONWARNING );\r
         }\r
       }\r
       return TRUE;\r
 \r
     case IDC_BrowseForEGTB:\r
-      if( BrowseForFolder( "Choose EGTB Directory:", buf ) ) {\r
+      if( BrowseForFolder( _("Choose EGTB Directory:"), buf ) ) {\r
         SetDlgItemText( hDlg, IDC_PathToEGTB, buf );\r
       }\r
       return TRUE;\r