move testing for no options to back-end
[xboard.git] / dialogs.c
index af767e5..6287a91 100644 (file)
--- a/dialogs.c
+++ b/dialogs.c
@@ -48,6 +48,7 @@ extern char *getenv();
 #include <stdint.h>
 
 #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);
 }
@@ -1400,6 +1402,7 @@ TimeControlProc ()
    tmpOdds1 = tmpOdds2 = 1; tcType = 0;
    tmpTc = atoi(appData.timeControl);
    GenericPopUp(tcOptions, _("Time Control"), TransientDlg, BoardWindow, MODAL, 0);
+   SetTcType(searchTime ? 2 : appData.timeIncrement < 0 ? 0 : 1);
 }
 
 //------------------------------- Ask Question -----------------------------------------