Use combobox line for recent engines when available
[xboard.git] / backend.c
index 59103ed..2553afb 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -748,7 +748,7 @@ InitEngine (ChessProgramState *cps, int n)
 
     ClearOptions(cps);
 
-    cps->which = _(engineNames[n]);
+    cps->which = engineNames[n];
     cps->maybeThinking = FALSE;
     cps->pr = NoProc;
     cps->isr = NULL;
@@ -1485,6 +1485,8 @@ MatchEvent (int mode)
        NextMatchGame();
 }
 
+char *comboLine = NULL; // [HGM] recent: WinBoard's first-engine combobox line
+
 void
 InitBackEnd3 P((void))
 {
@@ -1498,7 +1500,7 @@ InitBackEnd3 P((void))
        free(programVersion);
        programVersion = (char*) malloc(8 + strlen(PACKAGE_STRING) + strlen(first.tidy));
        sprintf(programVersion, "%s + %s", PACKAGE_STRING, first.tidy);
-       FloatToFront(&appData.recentEngineList, appData.firstChessProgram);
+       FloatToFront(&appData.recentEngineList, comboLine ? comboLine : appData.firstChessProgram);
     }
 
     if (appData.icsActive) {
@@ -13354,7 +13356,7 @@ WaitForEngine (ChessProgramState *cps, DelayedEventCallback retry)
        } else {
          /* kludge: allow timeout for initial "feature" command */
          FreezeUI();
-         snprintf(buf, MSG_SIZ, _("Starting %s chess program"), cps->which);
+         snprintf(buf, MSG_SIZ, _("Starting %s chess program"), _(cps->which));
          DisplayMessage("", buf);
          ScheduleDelayedEvent(retry, FEATURE_TIMEOUT);
        }