From ee5c4592139dec24b8514a6fd217600fa414a9a3 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Sun, 29 Oct 2017 22:20:48 +0100 Subject: [PATCH] Also update engine list when saving engine settings The 'Make Persistent' button in the Engine Settings dialog will now also cause the -engineList file to be read before being processed, and be written back after it, to keep the list up to date for all open XBoard instances. There still is a problem here, that when another instance has changed settings of the currently loaded engine, this engine is no longerrecognized as being in the list. But at least the user will be warned in such a case that makig the settings change persistent has failed. --- backend.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/backend.c b/backend.c index 43d9b1f..e5c7f72 100644 --- a/backend.c +++ b/backend.c @@ -11401,6 +11401,7 @@ SaveEngineSettings (int n) { int len; char *p, *q, *s, buf[MSG_SIZ], *optionSettings; if(!currentEngine[n] || !currentEngine[n][0]) { DisplayMessage("saving failed: engine not from list", ""); return; } // no engine from list is loaded + if(*engineListFile) ParseSettingsFile(engineListFile, &engineListFile); // update engine list p = strstr(firstChessProgramNames, currentEngine[n]); if(!p) { DisplayMessage("saving failed: engine not found in list", ""); return; } // sanity check; engine could be deleted from list after loading optionSettings = ResendOptions(n ? &second : &first, FALSE); @@ -11420,6 +11421,7 @@ SaveEngineSettings (int n) s = malloc(len); snprintf(s, len, "%s%s%s", firstChessProgramNames, currentEngine[n], q); FREE(firstChessProgramNames); firstChessProgramNames = s; // new list + if(*engineListFile) SaveEngineList(); } // following implemented as macro to avoid type limitations -- 1.7.0.4