cleaned up the directory a bit. Removed winboard-dm-beta, merged the two Changelogs...
[xboard.git] / xboard.c
index 3d5081d..3698728 100644 (file)
--- a/xboard.c
+++ b/xboard.c
@@ -1147,6 +1147,10 @@ XtResource clientResources[] = {
     { "showButtonBar", "showButtonBar", XtRBoolean,
        sizeof(Boolean), XtOffset(AppDataPtr, showButtonBar),
        XtRImmediate, (XtPointer) True },
+       /* icsEngineAnalyze */
+    {"icsEngineAnalyze", "icsEngineAnalyze", XtRBoolean,
+       sizeof(Boolean), XtOffset(AppDataPtr, icsEngineAnalyze),
+       XtRImmediate, (XtPointer) False },
 };
 
 XrmOptionDescRec shellOptions[] = {
@@ -1869,6 +1873,7 @@ main(argc, argv)
 #ifdef ENABLE_NLS
     XtSetLanguageProc(NULL, NULL, NULL);
     bindtextdomain(PRODUCT, LOCALEDIR);
+    bind_textdomain_codeset(PRODUCT, "UTF-8");
     textdomain(PRODUCT);
 #endif
 
@@ -1903,7 +1908,15 @@ main(argc, argv)
     XtGetApplicationResources(shellWidget, (XtPointer) &appData,
                              clientResources, XtNumber(clientResources),
                              NULL, 0);
-
+                             
+    if (appData.debugMode) {
+       if ((debugFP = fopen("xboard.debug", "w")) == NULL)  {
+          printf(_("Failed to open file xboard.debug \n"));
+          exit(errno);
+       }
+        setbuf(debugFP, NULL);
+    }
+    
 #if !HIGHDRAG
     /* This feature does not work; animation needs a rewrite */
     appData.highlightDragging = FALSE;
@@ -2466,9 +2479,6 @@ XBoard square size (hint): %d\n\
                    args, 1);
     }
 
-    /* icsEngineAnalyze - default init */
-    appData.icsEngineAnalyze = FALSE;
-
     /*
      * Create an icon.
      */
@@ -2552,6 +2562,8 @@ XBoard square size (hint): %d\n\
     }
 
     XtAppMainLoop(appContext);
+    if (appData.debugMode) fclose(debugFP);
+    
     return 0;
 }
 
@@ -5028,6 +5040,8 @@ void AnalysisPopDown()
     XtPopdown(analysisShell);
     XSync(xDisplay, False);
     analysisUp = False;
+    /* icsEngineAnalyze */
+    if (appData.icsEngineAnalyze) ExitAnalyzeMode();
 }
 
 
@@ -5877,7 +5891,6 @@ void AnalyzeModeProc(w, event, prms, nprms)
        if (appData.icsEngineAnalyze) {
          if (appData.debugMode)
            fprintf(debugFP, _("Found unexpected active ICS engine analyze \n"));
-           appData.icsEngineAnalyze = FALSE;
            ExitAnalyzeMode();
            ModeHighlight();
            return;
@@ -5886,7 +5899,6 @@ void AnalyzeModeProc(w, event, prms, nprms)
      } else {
         /* if enable, use want disable icsEngineAnalyze */
        if (appData.icsEngineAnalyze) {
-           appData.icsEngineAnalyze = FALSE;
           ExitAnalyzeMode();
           ModeHighlight();
           return;