From a6d7392c2cb298dcaa0dea4e370e07dbb9f87f07 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Mon, 7 Mar 2016 12:26:07 +0100 Subject: [PATCH] Cleanup Edit Tags/Book/EngineList a bit The Tags dialog is also used for two other functions, and this hack causes some problems. This patch ameliorates these a bit. The Edit Engine List now displays its own title (instead of "Tags"), and popping it up pops down which other function was in use first. (Unfortunately this can result in data loss for uncommitted changes.) The name of the "save changes" button has been changed to "commit changes", to suggest less strongly that a change in the Engine List would be immediately saved to file (which in reality requires Save Settings Now as well). --- dialogs.c | 18 +++++++++++++----- menus.c | 2 +- menus.h | 2 ++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/dialogs.c b/dialogs.c index 890ed13..252fffa 100644 --- a/dialogs.c +++ b/dialogs.c @@ -1225,7 +1225,7 @@ static Option tagsOptions[] = { { 0, 0, 0, NULL, NULL, NULL, NULL, Label, NULL }, { 200, T_VSCRL | T_FILL | T_WRAP | T_TOP, 200, NULL, (void*) &tagsText, NULL, (char **) &TagsClick, TextBox, "", &appData.tagsFont }, { 0, 0, 100, NULL, (void*) &NewMove, NULL, NULL, Button, N_("add next move") }, -{ 0,SAME_ROW,100,NULL, (void*) &changeTags, NULL, NULL, Button, N_("save changes") }, +{ 0,SAME_ROW,100,NULL, (void*) &changeTags, NULL, NULL, Button, N_("commit changes") }, { 0,SAME_ROW, 0, NULL, (void*) &NewTagsCallback, "", NULL, EndMark , "" } }; @@ -1246,9 +1246,9 @@ changeTags (int n) } void -NewTagsPopup (char *text, char *msg) +NewTagsPopup (char *text, char *msg, char *ttl) { - char *title = bookUp ? _("Edit book") : _("Tags"); + char *title = bookUp ? _("Edit book") : ttl; tagsOptions[2].type = bookUp ? Button : Skip; tagsOptions[3].min = bookUp ? SAME_ROW : 0; @@ -1265,14 +1265,22 @@ NewTagsPopup (char *text, char *msg) void TagsPopUp (char *tags, char *msg) { - NewTagsPopup(tags, cmailMsgLoaded ? msg : NULL); + NewTagsPopup(tags, cmailMsgLoaded ? msg : NULL, _("Tags")); } void EditTagsPopUp (char *tags, char **dest) { // wrapper to preserve old name used in back-end resPtr = dest; - NewTagsPopup(tags, NULL); + NewTagsPopup(tags, NULL, _("Tags")); +} + +void +EditEnginePopUp (char *tags, char **dest) +{ // wrapper to preserve old name used in back-end + TagsPopDown(); + resPtr = dest; + NewTagsPopup(tags, NULL, _("Registered Engines")); } void diff --git a/menus.c b/menus.c index ffb52ba..71f9ae0 100644 --- a/menus.c +++ b/menus.c @@ -387,7 +387,7 @@ DebugProc () void EditEngineProc () { - EditTagsPopUp(firstChessProgramNames, &firstChessProgramNames); + EditEnginePopUp(firstChessProgramNames, &firstChessProgramNames); } void diff --git a/menus.h b/menus.h index 0d82f89..be19f6c 100644 --- a/menus.h +++ b/menus.h @@ -185,6 +185,8 @@ void EnableButtonBar P((int state)); char *ModeToWidgetName P((GameMode mode)); void CreateAnimVars P((void)); void CopySomething P((char *s)); +void EditEnginePopUp P((char *tags, char **dest)); + extern char *gameCopyFilename, *gamePasteFilename; -- 1.7.0.4