From: H.G. Muller Date: Sun, 14 Oct 2012 10:14:07 +0000 (+0200) Subject: move testing for no options to back-end X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=c82483e9f02cc7e6efb6ee7c8140d8dd2fbd5573;p=xboard.git move testing for no options to back-end The test if an engine has options and display a note instead of the Engine Settings dialog when this is not the case is moved to outside of GenericPopUp, to make the later independent of calling other routines. --- diff --git a/dialogs.c b/dialogs.c index c4971d4..6287a91 100644 --- a/dialogs.c +++ b/dialogs.c @@ -48,6 +48,7 @@ extern char *getenv(); #include #include "common.h" +#include "frontend.h" #include "backend.h" #include "xboard.h" #include "menus.h" @@ -1173,6 +1174,7 @@ BoxAutoPopUp (char *buf) void SettingsPopUp (ChessProgramState *cps) { + if(!cps->nrOptions) { DisplayNote(_("Engine has no options")); return; } currentCps = cps; GenericPopUp(cps->option, _("Engine Settings"), TransientDlg, BoardWindow, MODAL, 0); } diff --git a/xaw/xoptions.c b/xaw/xoptions.c index 21281d2..7bbff9b 100644 --- a/xaw/xoptions.c +++ b/xaw/xoptions.c @@ -791,7 +791,6 @@ GenericPopUp (Option *option, char *title, DialogClass dlgNr, DialogClass parent if(engineDlg) { // Settings popup for engine: format through heuristic int n = currentCps->nrOptions; - if(!n) { DisplayNote(_("Engine has no options")); currentCps = NULL; return 0; } if(n > 50) width = 4; else if(n>24) width = 2; else width = 1; height = n / width + 1; if(n && (currentOption[n-1].type == Button || currentOption[n-1].type == SaveButton)) currentOption[n].min = SAME_ROW; // OK on same line diff --git a/xoptions.c b/xoptions.c index a475c58..7ed256a 100644 --- a/xoptions.c +++ b/xoptions.c @@ -781,7 +781,6 @@ GenericPopUp (Option *option, char *title, DialogClass dlgNr, DialogClass parent if(engineDlg) { // Settings popup for engine: format through heuristic int n = currentCps->nrOptions; - if(!n) { DisplayNote(_("Engine has no options")); currentCps = NULL; return 0; } if(n > 50) width = 4; else if(n>24) width = 2; else width = 1; height = n / width + 1; if(n && (currentOption[n-1].type == Button || currentOption[n-1].type == SaveButton)) currentOption[n].min = SAME_ROW; // OK on same line