X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=4f1aad8564bf675cb9a0e54f797909925fc67f4a;hb=6a7b0bcfb46092809ac826bf99652b9bce5d9a10;hp=7cc8f9cc9c214fc80a781d97ea02c728f6b55d68;hpb=494c14427dd2854d928019558e1cf8f87ba30ca7;p=xboard.git diff --git a/backend.c b/backend.c index 7cc8f9c..4f1aad8 100644 --- a/backend.c +++ b/backend.c @@ -14784,18 +14784,25 @@ EditTagsEvent () } void -ToggleSecond () +StartSecond () { - if(second.analyzing) { - SendToProgram("exit\n", &second); - second.analyzing = FALSE; - } else { - if (second.pr == NoProc) StartChessProgram(&second); + if(WaitForEngine(&second, StartSecond)) return; InitChessProgram(&second, FALSE); FeedMovesToProgram(&second, currentMove); SendToProgram("analyze\n", &second); second.analyzing = TRUE; + ThawUI(); +} + +void +ToggleSecond () +{ + if(second.analyzing) { + SendToProgram("exit\n", &second); + second.analyzing = FALSE; + } else { + StartSecond(); } } @@ -17362,6 +17369,8 @@ ParseOption (Option *opt, ChessProgramState *cps) opt->type = SaveButton; } else return FALSE; *p = 0; // terminate option name + *(int*) (opt->name + MSG_SIZ - 104) = opt->value; // hide default values somewhere + if(opt->target == &opt->textValue) strncpy(opt->name + MSG_SIZ - 100, opt->textValue, 99); // now look if the command-line options define a setting for this engine option. if(cps->optionSettings && cps->optionSettings[0]) p = strstr(cps->optionSettings, opt->name); else p = NULL; @@ -17374,6 +17383,8 @@ ParseOption (Option *opt, ChessProgramState *cps) if(!strcmp(((char**)opt->textValue)[n], q+1)) opt->value = n; break; case TextBox: + case FileName: + case PathName: safeStrCpy(opt->textValue, q+1, MSG_SIZ - (opt->textValue - opt->name)); break; case Spin: @@ -17385,8 +17396,6 @@ ParseOption (Option *opt, ChessProgramState *cps) strcat(buf, "\n"); SendToProgram(buf, cps); } - *(int*) (opt->name + MSG_SIZ - 104) = opt->value; // hide default values somewhere - if(opt->target == &opt->textValue) strncpy(opt->name + MSG_SIZ - 100, opt->textValue, 99); return TRUE; } @@ -17396,7 +17405,7 @@ FeatureDone (ChessProgramState *cps, int val) DelayedEventCallback cb = GetDelayedEvent(); if ((cb == InitBackEnd3 && cps == &first) || (cb == SettingsMenuIfReady && cps == &second) || - (cb == LoadEngine) || + (cb == LoadEngine) || (cb == StartSecond) || (cb == TwoMachinesEventIfReady)) { CancelDelayedEvent(); ScheduleDelayedEvent(cb, val ? 1 : 3600000);