From 6901aa93e574b65bb1d823ade42fbd23c89dd6cd Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sun, 2 Feb 2014 17:18:56 +0100 Subject: [PATCH] Add Edit Engine List menu item to XBoard In OS X the settings file is hard to find... --- dialogs.c | 8 ++++++-- menus.c | 8 ++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/dialogs.c b/dialogs.c index 59b8e04..e69567e 100644 --- a/dialogs.c +++ b/dialogs.c @@ -1109,12 +1109,14 @@ EditCommentProc () //------------------------------------------------------ Edit Tags ---------------------------------- static void changeTags P((int n)); -static char *tagsText; +static char *tagsText, **resPtr; static int NewTagsCallback (int n) { - if(!bookUp) ReplaceTags(tagsText, &gameInfo); + if(bookUp) SaveToBook(tagsText), DisplayBook(currentMove); else + if(resPtr) { ASSIGN(*resPtr, tagsText); } else + ReplaceTags(tagsText, &gameInfo); return 1; } @@ -1130,6 +1132,7 @@ changeTags (int n) { GenericReadout(tagsOptions, 1); if(bookUp) SaveToBook(tagsText), DisplayBook(currentMove); else + if(resPtr) { ASSIGN(*resPtr, tagsText); } else ReplaceTags(tagsText, &gameInfo); } @@ -1157,6 +1160,7 @@ TagsPopUp (char *tags, char *msg) void EditTagsPopUp (char *tags, char **dest) { // wrapper to preserve old name used in back-end + resPtr = dest; NewTagsPopup(tags, NULL); } diff --git a/menus.c b/menus.c index cb695ad..261f2cf 100644 --- a/menus.c +++ b/menus.c @@ -389,6 +389,12 @@ DebugProc () } void +EditEngineProc () +{ + EditTagsPopUp(firstChessProgramNames, &firstChessProgramNames); +} + +void NothingProc () { return; @@ -681,6 +687,8 @@ MenuItem actionMenu[] = { }; MenuItem engineMenu[100] = { + {N_("Edit Engine List..."), NULL, "EditEngList", EditEngineProc}, + {"----", NULL, NULL, NothingProc}, {N_("Load New 1st Engine..."), NULL, "LoadNew1stEngine", LoadEngine1Proc}, {N_("Load New 2nd Engine..."), NULL, "LoadNew2ndEngine", LoadEngine2Proc}, {"----", NULL, NULL, NothingProc}, -- 1.7.0.4