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.
#include <stdint.h>
#include "common.h"
+#include "frontend.h"
#include "backend.h"
#include "xboard.h"
#include "menus.h"
void
SettingsPopUp (ChessProgramState *cps)
{
+ if(!cps->nrOptions) { DisplayNote(_("Engine has no options")); return; }
currentCps = cps;
GenericPopUp(cps->option, _("Engine Settings"), TransientDlg, BoardWindow, MODAL, 0);
}
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
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