summaryrefslogtreecommitdiff
path: root/plugins/NewStory/src/history_menus.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-01-13 12:36:01 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-01-13 12:36:05 +0300
commita76d633fcee305009b2c8798d577e16f8dd0d931 (patch)
tree160df24813a5dd0ae0e9d92fe102d6d92be81d9c /plugins/NewStory/src/history_menus.cpp
parentfba3c4711bff68cff5caba08cf8d4f5ea451fea2 (diff)
fixes #4118 (no "Copy URL" menu item for downloaded files)
Diffstat (limited to 'plugins/NewStory/src/history_menus.cpp')
-rw-r--r--plugins/NewStory/src/history_menus.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/plugins/NewStory/src/history_menus.cpp b/plugins/NewStory/src/history_menus.cpp
index 28688cf626..16600a7999 100644
--- a/plugins/NewStory/src/history_menus.cpp
+++ b/plugins/NewStory/src/history_menus.cpp
@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
enum
{
- MENU_COPY, MENU_COPYTEXT, MENU_COPYURL, MENU_OPENFOLDER, MENU_QUOTE,
+ MENU_COPY, MENU_COPYTEXT, MENU_COPYURL, MENU_COPYPATH, MENU_OPENFOLDER, MENU_QUOTE,
MENU_SAVEAS, MENU_DOWNLOAD,
MENU_EDIT, MENU_DELETE, MENU_REPLY,
MENU_SELECTALL, MENU_BOOKMARK,
@@ -28,7 +28,7 @@ enum
static int hMenuObject;
static HANDLE hEventPreBuildMenu;
-static HGENMENU hmiHistory, hmiOpenFolder, hmiCopyUrl, hmiSaveAs, hmiDownload, hmiQuote;
+static HGENMENU hmiHistory, hmiOpenFolder, hmiCopyUrl, hmiCopyPath, hmiSaveAs, hmiDownload, hmiQuote;
static HGENMENU hmiCopy, hmiCopyText, hmiEdit, hmiBookmark, hmiDelete, hmiReply;
HMENU NSMenu_Build(NewstoryListData *data, ItemData *item)
@@ -45,15 +45,16 @@ HMENU NSMenu_Build(NewstoryListData *data, ItemData *item)
Menu_ShowItem(hmiReply, false);
Menu_ShowItem(hmiSaveAs, false);
Menu_ShowItem(hmiCopyUrl, false);
+ Menu_ShowItem(hmiCopyPath, false);
Menu_ShowItem(hmiDownload, false);
Menu_ShowItem(hmiOpenFolder, false);
bool bShowEventActions, bEditable;
if (item != nullptr) {
if (item->m_bOfflineFile) {
- Menu_ModifyItem(hmiCopyUrl, (item->m_bOfflineDownloaded) ? TranslateT("Copy file path") : TranslateT("Copy URL"));
- Menu_ShowItem(hmiCopyUrl, true);
Menu_ShowItem(hmiSaveAs, bNotProtected);
+ Menu_ShowItem(hmiCopyUrl, true);
+ Menu_ShowItem(hmiCopyPath, item->m_bOfflineDownloaded);
Menu_ShowItem(hmiDownload, !item->m_bOfflineDownloaded && bNotProtected);
Menu_ShowItem(hmiOpenFolder, item->m_bOfflineDownloaded);
}
@@ -116,6 +117,10 @@ static INT_PTR NSMenuHelper(WPARAM wParam, LPARAM lParam)
pData->CopyUrl();
break;
+ case MENU_COPYPATH:
+ pData->CopyPath();
+ break;
+
case MENU_OPENFOLDER:
pData->OpenFolder();
break;
@@ -254,6 +259,10 @@ void InitMenus()
hmiCopyUrl = Menu_AddNewStoryMenuItem(&mi, MENU_COPYURL);
mi.position++;
+ mi.name.a = LPGEN("Copy file path");
+ hmiCopyPath = Menu_AddNewStoryMenuItem(&mi, MENU_COPYPATH);
+
+ mi.position++;
mi.name.a = LPGEN("Show in folder");
hmiOpenFolder = Menu_AddNewStoryMenuItem(&mi, MENU_OPENFOLDER);