Add menu item for editing ICS text menu
authorH.G.Muller <hgm@hgm-xboard.(none)>
Thu, 21 Apr 2016 08:03:12 +0000 (10:03 +0200)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Thu, 21 Apr 2016 09:43:54 +0000 (11:43 +0200)
An item Edit ICS Menu was added in the View menu, and will pop up
the Edit Tags dialog for editing the -icsMenu option that determines
how the ICS Text Menu will look.

dialogs.c
frontend.h
menus.c

index 56ad841..7885f11 100644 (file)
--- a/dialogs.c
+++ b/dialogs.c
@@ -1041,6 +1041,7 @@ void
 SendString (char *p)
 {
     char buf[MSG_SIZ], buf2[MSG_SIZ], *q;
+
     if(q = strstr(p, "$name")) { // in Xaw this is already intercepted
        if(!shellUp[TextMenuDlg] || !clickedWord[0]) return;
        strncpy(buf2, p, MSG_SIZ);
index b06484f..16d1f5b 100644 (file)
@@ -215,6 +215,7 @@ void CopyFENToClipboard P((void));
 extern char *programName;
 extern int commentUp;
 extern char *firstChessProgramNames;
+extern char *icsTextMenuString;
 
 void GreyRevert P((Boolean grey));
 void EnableNamedMenuItem P((char *menuRef, int state));
diff --git a/menus.c b/menus.c
index 75d56af..50968c1 100644 (file)
--- a/menus.c
+++ b/menus.c
@@ -397,6 +397,12 @@ EditThemesProc ()
 }
 
 void
+EditMenuProc ()
+{
+    EditAnyPopUp(icsTextMenuString, &icsTextMenuString, _("ICS Text-Menu Definition"));
+}
+
+void
 NothingProc ()
 {
     return;
@@ -649,12 +655,13 @@ MenuItem viewMenu[] = {
   {N_("Move History"),      "<Alt><Shift>h", "MoveHistory",     HistoryShowProc,        CHECK}, // [HGM] hist: activate 4.2.7 code
   {N_("Evaluation Graph"),  "<Alt><Shift>e", "EvaluationGraph", EvalGraphProc,          CHECK},
   {N_("Game List"),         "<Alt><Shift>g", "GameList",        ShowGameListProc,       CHECK},
-  {N_("ICS text menu"),      NULL,           "ICStextmenu",     IcsTextProc,            CHECK},
   {"----",                   NULL,            NULL,             NothingProc},
   {N_("Tags"),               NULL,           "Tags",            EditTagsProc,           CHECK},
   {N_("Comments"),           NULL,           "Comments",        EditCommentProc,        CHECK},
   {N_("ICS Input Box"),      NULL,           "ICSInputBox",     IcsInputBoxProc,        CHECK},
   {N_("ICS/Chat Console"),   NULL,           "OpenChatWindow",  ChatProc,               CHECK},
+  {N_("ICS text menu"),      NULL,           "ICStextmenu",     IcsTextProc,            CHECK},
+  {N_("Edit ICS menu..."),   NULL,           "EditTextMenu",    EditMenuProc},
   {"----",                   NULL,            NULL,             NothingProc},
   {N_("Edit Theme List..."), NULL,           "EditThemeList",   EditThemesProc},
   {N_("Board..."),           NULL,           "Board",           BoardOptionsProc},