X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=dialogs.c;h=2e6344254916d1082e468e8e7f7c17008ffd6de5;hb=dd94bfa89dd6dd1238c3f7063e532ab3ed2d0858;hp=8e3936fdce8b7164aacc64554fc32f713a679cb9;hpb=89ca7bf7ee0c418d1a2cdf2830c9a34c78a715b0;p=xboard.git diff --git a/dialogs.c b/dialogs.c index 8e3936f..2e63442 100644 --- a/dialogs.c +++ b/dialogs.c @@ -286,11 +286,11 @@ static Option matchOptions[] = { { 0, 0, 0, NULL, (void*) &appData.cycleSync, "", NULL, CheckBox, N_("Sync after cycle") }, { 0, LR, 175, NULL, NULL, NULL, NULL, Label, N_("Tourney participants:") }, { 0, SAME_ROW|RR, 175, NULL, NULL, NULL, NULL, Label, N_("Select Engine:") }, -{ 150, T_VSCRL | T_FILL | T_WRAP, +{ 200, T_VSCRL | T_FILL | T_WRAP, 175, NULL, (void*) &engineName, NULL, NULL, TextBox, "" }, -{ 150, SAME_ROW|RR, +{ 200, SAME_ROW|RR, 175, NULL, (void*) engineMnemonic, (char*) &AddToTourney, NULL, ListBox, "" }, -{ 0, 0, 0, NULL, NULL, NULL, NULL, Break, "" }, // to decouple alignment above and below boxes +{ 0, SAME_ROW, 0, NULL, NULL, NULL, NULL, Break, "" }, // to decouple alignment above and below boxes //{ 0, COMBO_CALLBACK | NO_GETTEXT, // 0, NULL, (void*) &AddToTourney, (char*) (engineMnemonic+1), (engineMnemonic+1), ComboBox, N_("Select Engine:") }, { 0, 0, 10, NULL, (void*) &appData.tourneyType, "", NULL, Spin, N_("Tourney type (0 = round-robin, 1 = gauntlet):") }, @@ -562,7 +562,6 @@ NewVariantProc () { static int start; int i, last; - char buf[MSG_SIZ]; ranksTmp = filesTmp = sizeTmp = -1; // prefer defaults over actual settings if(appData.noChessProgram) sprintf(warning, _("Only bughouse is not available in viewer mode.")); else sprintf(warning, _("All variants not supported by the first engine\n(currently %s) are disabled."), first.tidy); @@ -586,9 +585,9 @@ NewVariantProc () } variantDescriptors[start-2].type = (last < 0 ? EndMark : Skip); variantDescriptors[start-1].type = (last < 6 ? Skip : Break); - safeStrCpy(buf, engineVariant, MSG_SIZ); *engineVariant = NULLCHAR; // yeghh... + safeStrCpy(engineVariant+100, engineVariant, 100); *engineVariant = NULLCHAR; // yeghh... GenericPopUp(variantDescriptors, _("New Variant"), TransientDlg, BoardWindow, MODAL, 0); - safeStrCpy(engineVariant, buf, MSG_SIZ); // must temporarily clear to avoid enabling all variant buttons + safeStrCpy(engineVariant, engineVariant+100, MSG_SIZ); // must temporarily clear to avoid enabling all variant buttons } //------------------------------------------- Common Engine Options ------------------------------------- @@ -1462,7 +1461,7 @@ SecondSettingsProc () //----------------------------------------------- Load Engine -------------------------------------- char *engineDir, *engineLine, *nickName, *params; -Boolean isUCI, hasBook, storeVariant, v1, addToList, useNick, secondEng; +Boolean isUCI, isUSI, hasBook, storeVariant, v1, addToList, useNick, secondEng; static void EngSel P((int n, int sel)); static int InstallOK P((int n)); @@ -1478,6 +1477,7 @@ static Option installOptions[] = { { 0, 0, 0, NULL, (void*) &engineName, NULL, NULL, FileName, N_("Engine Command:") }, { 0, LR, 0, NULL, NULL, NULL, NULL, Label, N_("(Directory will be derived from engine path when empty)") }, { 0, 0, 0, NULL, (void*) &isUCI, NULL, NULL, CheckBox, N_("UCI") }, +{ 0, 0, 0, NULL, (void*) &isUSI, NULL, NULL, CheckBox, N_("USI/UCCI (uses specified -uxiAdapter)") }, { 0, 0, 0, NULL, (void*) &v1, NULL, NULL, CheckBox, N_("WB protocol v1 (do not wait for engine features)") }, { 0, 0, 0, NULL, (void*) &hasBook, NULL, NULL, CheckBox, N_("Must not use GUI book") }, { 0, 0, 0, NULL, (void*) &addToList, NULL, NULL, CheckBox, N_("Add this engine to the list") }, @@ -1492,6 +1492,10 @@ InstallOK (int n) ASSIGN(engineLine, engineList[n]); } PopDown(TransientDlg); // early popdown, to allow FreezeUI to instate grab + if(isUSI) { + isUCI = 2; // kludge to pass isUSI to Load() + if(!*appData.ucciAdapter) { ASSIGN(appData.ucciAdapter, "usi2wb -%variant \"%fcp\"\"%fd\""); } // make sure -uxiAdapter is defined + } if(!secondEng) Load(&first, 0); else Load(&second, 1); return FALSE; // no double PopDown! } @@ -1517,7 +1521,7 @@ EngSel (int n, int sel) static void LoadEngineProc (int engineNr, char *title) { - isUCI = storeVariant = v1 = useNick = False; addToList = hasBook = True; // defaults + isUCI = isUSI = storeVariant = v1 = useNick = False; addToList = hasBook = True; // defaults secondEng = engineNr; if(engineLine) free(engineLine); engineLine = strdup(""); if(engineDir) free(engineDir); engineDir = strdup("."); @@ -2150,6 +2154,7 @@ GLT_OK (int n) { GLT_ParseList(); appData.gameListTags = strdup(lpUserGLT); + GameListUpdate(); return 1; } @@ -2414,7 +2419,8 @@ DisplayLogos (Option *w1, Option *w2) { void *whiteLogo = first.programLogo, *blackLogo = second.programLogo; if(appData.autoLogo) { - if(appData.noChessProgram) whiteLogo = blackLogo = NULL; else + if(appData.noChessProgram) whiteLogo = blackLogo = NULL; + if(appData.icsActive) whiteLogo = blackLogo = second.programLogo; switch(gameMode) { // pick logos based on game mode case IcsObserving: whiteLogo = second.programLogo; // ICS logo @@ -2589,13 +2595,14 @@ Option * BoardPopUp (int squareSize, int lineGap, void *clockFontThingy) { int i, size = BOARD_WIDTH*(squareSize + lineGap) + lineGap, logo = appData.logoSize; + int f = 2*appData.fixedSize; // width fudge, needed for unknown reasons to not clip board mainOptions[W_WHITE].choice = (char**) clockFontThingy; mainOptions[W_BLACK].choice = (char**) clockFontThingy; mainOptions[W_BOARD].value = BOARD_HEIGHT*(squareSize + lineGap) + lineGap; mainOptions[W_BOARD].max = mainOptions[W_SMALL].max = size; // board size mainOptions[W_SMALL].max = size - 2; // board title (subtract border!) mainOptions[W_BLACK].max = mainOptions[W_WHITE].max = size/2-3; // clock width - mainOptions[W_MESSG].max = appData.showButtonBar ? size-135 : size-2; // message + mainOptions[W_MESSG].max = appData.showButtonBar ? size-135+f : size-2+f; // message mainOptions[W_MENU].max = size-40; // menu bar mainOptions[W_TITLE].type = appData.titleInWindow ? Label : Skip ; if(logo && logo <= size/4) { // Activate logos @@ -2717,6 +2724,7 @@ DisplayMessage (char *message, char *extMessage) #define MAXFILES 1000 +static DialogClass savDlg; static ChessProgramState *savCps; static FILE **savFP; static char *fileName, *extFilter, *savMode, **namePtr; @@ -2799,7 +2807,7 @@ BrowseOK (int n) snprintf(title, MSG_SIZ, "%s", fileName); else snprintf(title, MSG_SIZ, "%s/%s", curDir, fileName); - SetWidgetText((Option*) savFP, title, TransientDlg); + SetWidgetText((Option*) savFP, title, savDlg); currentCps = savCps; // could return to Engine Settings dialog! return TRUE; } @@ -2956,7 +2964,7 @@ void Browse (DialogClass dlg, char *label, char *proposed, char *ext, Boolean pathFlag, char *mode, char **name, FILE **fp) { int j=0; - savFP = fp; savMode = mode, namePtr = name, savCps = currentCps, oldVal = values[9]; // save params, for use in callback + savFP = fp; savMode = mode, namePtr = name, savCps = currentCps, oldVal = values[9], savDlg = dlg; // save params, for use in callback ASSIGN(extFilter, ext); ASSIGN(fileName, proposed ? proposed : ""); for(j=0; Extensions[j]; j++) // look up actual value in list of possible values, to get selection nr