Allow grouping of engines in engine list
[xboard.git] / xoptions.c
index 0ace8b6..d3e2462 100644 (file)
@@ -83,6 +83,7 @@ extern char *getenv();
 // [HGM] the following code for makng menu popups was cloned from the FileNamePopUp routines
 
 static Widget previous = NULL;
+extern Pixel timerBackgroundPixel;
 
 void
 SetFocus (Widget w, XtPointer data, XEvent *event, Boolean *b)
@@ -310,7 +311,7 @@ char *engineName, *engineDir, *engineChoice, *engineLine, *nickName, *params, *t
 Boolean isUCI, hasBook, storeVariant, v1, addToList, useNick;
 extern Option installOptions[], matchOptions[];
 char *engineNr[] = { N_("First Engine"), N_("Second Engine"), NULL };
-char *engineList[100] = {" "}, *engineMnemonic[100] = {""};
+char *engineList[MAXENGINES] = {" "}, *engineMnemonic[MAXENGINES] = {""};
 
 int
 AppendText (Option *opt, char *s)
@@ -727,7 +728,7 @@ SetColor (char *colorName, Option *box)
            } else {
                buttonColor = *(Pixel *) vTo.addr;
            }
-       } else buttonColor = (Pixel) 0;
+       } else buttonColor = timerBackgroundPixel;
        XtSetArg(args[0], XtNbackground, buttonColor);;
        XtSetValues(box->handle, args, 1);
 }
@@ -1412,7 +1413,7 @@ OptionsProc (Widget w, XEvent *event, String *prms, Cardinal *nprms)
 void
 MatchOptionsProc (Widget w, XEvent *event, String *prms, Cardinal *nprms)
 {
-   NamesToList(firstChessProgramNames, engineList, engineMnemonic);
+   NamesToList(firstChessProgramNames, engineList, engineMnemonic, "all");
    comboCallback = &AddToTourney;
    matchOptions[5].min = -(appData.pairingEngine[0] != NULLCHAR); // with pairing engine, allow Swiss
    ASSIGN(tfName, appData.tourneyFile[0] ? appData.tourneyFile : MakeName(appData.defName));
@@ -1741,7 +1742,7 @@ LoadEngineProc (Widget w, XEvent *event, String *prms, Cardinal *nprms)
    if(engineDir)    free(engineDir);    engineDir = strdup("");
    if(nickName)     free(nickName);     nickName = strdup("");
    if(params)       free(params);       params = strdup("");
-   NamesToList(firstChessProgramNames, engineList, engineMnemonic);
+   NamesToList(firstChessProgramNames, engineList, engineMnemonic, "all");
    GenericPopUp(installOptions, _("Load engine"), 0);
 }