Add option Display Logo in WB general-options menu
[xboard.git] / winboard / woptions.c
index 461ce73..f5dbb3e 100644 (file)
@@ -146,12 +146,14 @@ 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
@@ -181,6 +183,7 @@ 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
 \r
 #undef CHECK_BOX\r
 \r
@@ -228,6 +231,7 @@ 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
 \r
 #undef IS_CHECKED\r
 \r
@@ -249,7 +253,10 @@ GeneralOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
        */\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
                 (oldBlindfold != appData.blindfold)) {\r
@@ -1175,6 +1182,11 @@ IcsOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
     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
@@ -1187,6 +1199,7 @@ IcsOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
     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
@@ -1253,12 +1266,19 @@ IcsOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
       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