X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=dialogs.c;h=3f445bb58b152890f6cbd4bc1366396412b7d4cd;hb=2eb3eb048b16f2ffd1f1c8dad3987871b0f9bd72;hp=ea0ece7e01e113fe53c1ca9a45e636cba2ad5145;hpb=0ccc0a2f0bb6bf44cd8c0bad873a3f9a56a143aa;p=xboard.git diff --git a/dialogs.c b/dialogs.c index ea0ece7..3f445bb 100644 --- a/dialogs.c +++ b/dialogs.c @@ -93,11 +93,13 @@ int SetCurrentComboSelection (Option *opt) { int j; + if(currentCps) ; else if(!opt->textValue) opt->value = *(int*)opt->target; /* numeric */else { for(j=0; opt->choice[j]; j++) // look up actual value in list of possible values, to get selection nr if(*(char**)opt->target && !strcmp(*(char**)opt->target, ((char**)opt->textValue)[j])) break; opt->value = j + (opt->choice[j] == NULL); } + SetComboChoice(opt, opt->value); return opt->value; } @@ -1460,6 +1462,22 @@ SecondSettingsProc () SettingsPopUp(&second); } +void +RefreshSettingsDialog (ChessProgramState *cps, int val) +{ + if(val == 1) { // option values changed + if(shellUp[TransientDlg] && cps == currentCps) { + GenericUpdate(cps->option, -1); // normally update values when dialog is up + } + return; // and be done + } + if(val == 2) { // option list changed + if(!shellUp[TransientDlg] || cps != currentCps) return; // our dialog is not up, so nothing to do + } + PopDown(TransientDlg); // make sure any other dialog closes first + SettingsPopUp(cps); // and popup new one +} + //----------------------------------------------- Load Engine -------------------------------------- char *engineDir, *engineLine, *nickName, *params;