From 2ed2d3bc5dceb2c7d4036abbf0200af7235720e6 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Thu, 21 Apr 2016 10:03:12 +0200 Subject: [PATCH] Add menu item for editing ICS text menu 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 | 1 + frontend.h | 1 + menus.c | 9 ++++++++- 3 files changed, 10 insertions(+), 1 deletions(-) diff --git a/dialogs.c b/dialogs.c index 56ad841..7885f11 100644 --- 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); diff --git a/frontend.h b/frontend.h index b06484f..16d1f5b 100644 --- a/frontend.h +++ b/frontend.h @@ -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 --- 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"), "h", "MoveHistory", HistoryShowProc, CHECK}, // [HGM] hist: activate 4.2.7 code {N_("Evaluation Graph"), "e", "EvaluationGraph", EvalGraphProc, CHECK}, {N_("Game List"), "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}, -- 1.7.0.4