Add Edit Themes List menu item XB
authorH.G.Muller <hgm@hgm-xboard.(none)>
Thu, 21 Apr 2016 07:26:39 +0000 (09:26 +0200)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Thu, 21 Apr 2016 07:26:39 +0000 (09:26 +0200)
The Edit Tags dialog is now also used for editing the -themeName list,
with a menu item in the View menu to pop it up.

dialogs.c
menus.c
menus.h

index 8b53631..56ad841 100644 (file)
--- a/dialogs.c
+++ b/dialogs.c
@@ -1278,11 +1278,11 @@ EditTagsPopUp (char *tags, char **dest)
 }
 
 void
-EditEnginePopUp (char *tags, char **dest)
+EditAnyPopUp (char *tags, char **dest, char *title)
 {   // wrapper to preserve old name used in back-end
     TagsPopDown();
     resPtr = dest; 
-    NewTagsPopup(tags, NULL, _("Registered Engines"));
+    NewTagsPopup(tags, NULL, title);
 }
 
 void
diff --git a/menus.c b/menus.c
index af8e33d..75d56af 100644 (file)
--- a/menus.c
+++ b/menus.c
@@ -387,7 +387,13 @@ DebugProc ()
 void
 EditEngineProc ()
 {
-    EditEnginePopUp(firstChessProgramNames, &firstChessProgramNames);
+    EditAnyPopUp(firstChessProgramNames, &firstChessProgramNames, _("Registered Engines"));
+}
+
+void
+EditThemesProc ()
+{
+    EditAnyPopUp(appData.themeNames, &appData.themeNames, _("Predefined Themes"));
 }
 
 void
@@ -650,6 +656,7 @@ MenuItem viewMenu[] = {
   {N_("ICS Input Box"),      NULL,           "ICSInputBox",     IcsInputBoxProc,        CHECK},
   {N_("ICS/Chat Console"),   NULL,           "OpenChatWindow",  ChatProc,               CHECK},
   {"----",                   NULL,            NULL,             NothingProc},
+  {N_("Edit Theme List..."), NULL,           "EditThemeList",   EditThemesProc},
   {N_("Board..."),           NULL,           "Board",           BoardOptionsProc},
   {N_("Fonts..."),           NULL,           "Fonts",           FontsProc},
   {N_("Game List Tags..."),  NULL,           "GameListTags",    GameListOptionsProc},
diff --git a/menus.h b/menus.h
index b088cc7..9478371 100644 (file)
--- a/menus.h
+++ b/menus.h
@@ -186,7 +186,7 @@ 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));
+void EditAnyPopUp P((char *tags, char **dest, char *title));