summaryrefslogtreecommitdiff
path: root/plugins/NewStory/src/history_menus.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-09-07 20:39:16 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-09-07 20:39:16 +0300
commit15fd857beeb3838dea083ea6122d360dbaff1424 (patch)
tree4e49979e987de1f194acdd49d047377813eacb30 /plugins/NewStory/src/history_menus.cpp
parent85e8318eb061310e100e7599998b45accc1a31fb (diff)
NewStory: no need to display event actions if there's no event
Diffstat (limited to 'plugins/NewStory/src/history_menus.cpp')
-rw-r--r--plugins/NewStory/src/history_menus.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/plugins/NewStory/src/history_menus.cpp b/plugins/NewStory/src/history_menus.cpp
index fe5d4714dc..c03c8587f3 100644
--- a/plugins/NewStory/src/history_menus.cpp
+++ b/plugins/NewStory/src/history_menus.cpp
@@ -11,6 +11,7 @@ enum
static int hMenuObject;
static HANDLE hEventPreBuildMenu;
static HGENMENU hmiHistory, hmiCopy, hmiSaveAs, hmiDownload, hmiQuote;
+static HGENMENU hmiEdit, hmiBookmark, hmiDelete;
HMENU NSMenu_Build(NewstoryListData *data, ItemData *item)
{
@@ -25,6 +26,11 @@ HMENU NSMenu_Build(NewstoryListData *data, ItemData *item)
}
Menu_ShowItem(hmiQuote, data->pMsgDlg != nullptr);
+
+ bool bShowEventActions = item->hEvent != 0;
+ Menu_ShowItem(hmiEdit, bShowEventActions);
+ Menu_ShowItem(hmiDelete, bShowEventActions);
+ Menu_ShowItem(hmiBookmark, bShowEventActions);
NotifyEventHooks(hEventPreBuildMenu, item->hContact, (LPARAM)&item->dbe);
@@ -198,15 +204,15 @@ void InitMenus()
mi.position = 200000;
mi.name.a = LPGEN("Edit");
- Menu_AddNewStoryMenuItem(&mi, MENU_EDIT);
+ hmiEdit = Menu_AddNewStoryMenuItem(&mi, MENU_EDIT);
mi.position = 200001;
mi.name.a = LPGEN("Delete");
- Menu_AddNewStoryMenuItem(&mi, MENU_DELETE);
+ hmiDelete = Menu_AddNewStoryMenuItem(&mi, MENU_DELETE);
mi.position = 200002;
mi.name.a = LPGEN("Toggle bookmark");
- Menu_AddNewStoryMenuItem(&mi, MENU_BOOKMARK);
+ hmiBookmark = Menu_AddNewStoryMenuItem(&mi, MENU_BOOKMARK);
mi.position = 300000;
mi.name.a = LPGEN("Select all");