Don't add PV moves on board clicking in AnalyzeMode
[xboard.git] / dialogs.c
index d7ab360..4aa6478 100644 (file)
--- a/dialogs.c
+++ b/dialogs.c
@@ -1,7 +1,7 @@
 /*
  * dialogs.c -- platform-independent code for dialogs of XBoard
  *
- * Copyright 2000, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ * Copyright 2000, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
  * ------------------------------------------------------------------------
  *
  * GNU XBoard is free software: you can redistribute it and/or modify
@@ -368,13 +368,14 @@ static Option generalOptions[] = {
 { 0,  0, 0, NULL, (void*) &appData.autoFlipView, "", NULL, CheckBox, N_("Auto Flip View") },
 { 0,  0, 0, NULL, (void*) &appData.blindfold, "", NULL, CheckBox, N_("Blindfold") },
 { 0,  0, 0, NULL, (void*) &appData.dropMenu, "", NULL, CheckBox, N_("Drop Menu") },
+{ 0,  0, 0, NULL, (void*) &appData.variations, "", NULL, CheckBox, N_("Enable Variation Trees") },
 { 0,  0, 0, NULL, (void*) &appData.hideThinkingFromHuman, "", NULL, CheckBox, N_("Hide Thinking from Human") },
 { 0,  0, 0, NULL, (void*) &appData.highlightLastMove, "", NULL, CheckBox, N_("Highlight Last Move") },
 { 0,  0, 0, NULL, (void*) &appData.highlightMoveWithArrow, "", NULL, CheckBox, N_("Highlight with Arrow") },
-{ 0,  0, 0, NULL, (void*) &appData.ringBellAfterMoves, "", NULL, CheckBox, N_("Move Sound") },
 { 0,  0, 0, NULL, (void*) &appData.oneClick, "", NULL, CheckBox, N_("One-Click Moving") },
 { 0,  0, 0, NULL, (void*) &appData.periodicUpdates, "", NULL, CheckBox, N_("Periodic Updates (in Analysis Mode)") },
 { 0, SAME_ROW, 0, NULL, NULL, NULL, NULL, Break, "" },
+{ 0,  0, 0, NULL, (void*) &appData.autoExtend, "", NULL, CheckBox, N_("Play Move(s) of Clicked PV (Analysis)") },
 { 0,  0, 0, NULL, (void*) &appData.ponderNextMove, "", NULL, CheckBox, N_("Ponder Next Move") },
 { 0,  0, 0, NULL, (void*) &appData.popupExitMessage, "", NULL, CheckBox, N_("Popup Exit Messages") },
 { 0,  0, 0, NULL, (void*) &appData.popupMoveErrors, "", NULL, CheckBox, N_("Popup Move Errors") },
@@ -569,12 +570,14 @@ Option icsOptions[] = {
 { 0, 0, 0, NULL, (void*) &appData.autoComment, "", NULL, CheckBox, N_("Auto-Comment") },
 { 0, 0, 0, NULL, (void*) &appData.autoObserve, "", NULL, CheckBox, N_("Auto-Observe") },
 { 0, 0, 0, NULL, (void*) &appData.autoRaiseBoard, "", NULL, CheckBox, N_("Auto-Raise Board") },
+{ 0, 0, 0, NULL, (void*) &appData.autoCreateLogon, "", NULL, CheckBox, N_("Auto-Create Logon Script") },
 { 0, 0, 0, NULL, (void*) &appData.bgObserve, "",   NULL, CheckBox, N_("Background Observe while Playing") },
 { 0, 0, 0, NULL, (void*) &appData.dualBoard, "",   NULL, CheckBox, N_("Dual Board for Background-Observed Game") },
 { 0, 0, 0, NULL, (void*) &appData.getMoveList, "", NULL, CheckBox, N_("Get Move List") },
 { 0, 0, 0, NULL, (void*) &appData.quietPlay, "",   NULL, CheckBox, N_("Quiet Play") },
 { 0, 0, 0, NULL, (void*) &appData.seekGraph, "",   NULL, CheckBox, N_("Seek Graph") },
 { 0, 0, 0, NULL, (void*) &appData.autoRefresh, "", NULL, CheckBox, N_("Auto-Refresh Seek Graph") },
+{ 0, 0, 0, NULL, (void*) &appData.autoBox, "", NULL, CheckBox, N_("Auto-InputBox PopUp") },
 { 0, 0, 0, NULL, (void*) &appData.premove, "",     NULL, CheckBox, N_("Premove") },
 { 0, 0, 0, NULL, (void*) &appData.premoveWhite, "", NULL, CheckBox, N_("Premove for White") },
 { 0, 0, 0, NULL, (void*) &appData.premoveWhiteText, "", NULL, TextBox, N_("First White Move:") },
@@ -605,7 +608,7 @@ IcsOptionsProc ()
 
 //-------------------------------------------- Load Game Options ---------------------------------
 
-static char *modeNames[] = { N_("Exact position match"), N_("Shown position is subset"), N_("Same material with exactly same Pawn chain"), 
+static char *modeNames[] = { N_("Exact position match"), N_("Shown position is subset"), N_("Same material with exactly same Pawn chain"),
                      N_("Same material"), N_("Material range (top board half optional)"), N_("Material difference (optional stuff balanced)"), NULL };
 static char *modeValues[] = { "1", "2", "3", "4", "5", "6" };
 static char *searchMode;
@@ -1126,7 +1129,7 @@ NextInHistory ()
 {
   if (histP == histIn) return NULL;
   histP = (histP + 1) % HISTORY_SIZE;
-  return history[histP];   
+  return history[histP];
 }
 // end of borrowed code
 
@@ -1149,7 +1152,7 @@ ICSInputSendText ()
 void
 IcsKey (int n)
 {   // [HGM] input: let up-arrow recall previous line from history
-    char *val;
+    char *val = NULL; // to suppress spurious warning
 
     if (!shellUp[InputBoxDlg]) return;
     switch(n) {
@@ -1226,6 +1229,7 @@ void
 BoxAutoPopUp (char *buf)
 {
        if(appData.icsActive) { // text typed to board in ICS mode: divert to ICS input box
+           if(!appData.autoBox) return;
            if(DialogExists(InputBoxDlg)) { // box already exists: append to current contents
                char *p, newText[MSG_SIZ];
                GetWidgetText(&boxOptions[0], &p);
@@ -1837,7 +1841,7 @@ ErrorPopUp (char *title, char *label, int modal)
 {
     errorUp = True;
     errorOptions[1].name = label;
-    if(dialogError = shellUp[TransientDlg]) 
+    if(dialogError = shellUp[TransientDlg])
        GenericPopUp(errorOptions+1, title, FatalDlg, TransientDlg, MODAL, 0); // pop up as daughter of the transient dialog
     else
        GenericPopUp(errorOptions+modal, title, modal ? FatalDlg: ErrorDlg, BoardWindow, modal, 0); // kludge: option start address indicates modality
@@ -2008,7 +2012,7 @@ DisplayLogos (Option *w1, Option *w2)
 {
        void *whiteLogo = first.programLogo, *blackLogo = second.programLogo;
        if(appData.autoLogo) {
-         
+
          switch(gameMode) { // pick logos based on game mode
            case IcsObserving:
                whiteLogo = second.programLogo; // ICS logo
@@ -2115,7 +2119,7 @@ SizeKludge (int n)
     int w = width - 44 - mainOptions[n].min;
     mainOptions[W_TITLE].max = w; // width left behind menu bar
     if(w < 0.4*width) // if no reasonable amount of space for title, force small layout
-       mainOptions[W_SMALL].type = mainOptions[W_TITLE].type, mainOptions[W_TITLE].type = -1; 
+       mainOptions[W_SMALL].type = mainOptions[W_TITLE].type, mainOptions[W_TITLE].type = -1;
 }
 
 void
@@ -2212,7 +2216,7 @@ SlaveExp (int n, int x, int y)
 Option dualOptions[] = { // auxiliary board window
 { 0, L2L|T2T,              198, NULL, NULL, NULL, NULL, Label, "White" }, // white clock
 { 0, R2R|T2T|SAME_ROW,     198, NULL, NULL, NULL, NULL, Label, "Black" }, // black clock
-{ 0, LR|T2T|BORDER,        401, NULL, NULL, NULL, NULL, Label, "message" }, // message field
+{ 0, LR|T2T|BORDER,        401, NULL, NULL, NULL, NULL, Label, "This feature is experimental" }, // message field
 { 401, LR|TT, 401, NULL, (char*) &SlaveExp, NULL, NULL, Graph, "shadow board" }, // board
 { 0,  NO_OK, 0, NULL, NULL, "", NULL, EndMark , "" }
 };
@@ -2567,14 +2571,7 @@ FileNamePopUp (char *label, char *def, char *filter, FileProc proc, char *openMo
 {
     fileProc = proc;           /* I can't see a way not */
     fileOpenMode = openMode;   /*   to use globals here */
-#ifdef TODO_GTK
-    {   // [HGM] use file-selector dialog stolen from Ghostview
-       // int index; // this is not supported yet
-       Browse(BoardWindow, label, (def[0] ? def : NULL), filter, False, openMode, &openName, &openFP);
-    }
-#else
-    FileNamePopUpGTK(label, def, filter, proc, False, openMode, &openName, &openFP);
-#endif
+    FileNamePopUpWrapper(label, def, filter, proc, False, openMode, &openName, &openFP);
 }
 
 void
@@ -2587,4 +2584,3 @@ Col2Text (int n)
 {
     return NULL;
 }
-