diff -r 764178f2124d -r 9c153ce17d74 eric7/HelpViewer/HelpViewerImplQWE.py --- a/eric7/HelpViewer/HelpViewerImplQWE.py Tue Jan 04 15:52:14 2022 +0100 +++ b/eric7/HelpViewer/HelpViewerImplQWE.py Tue Jan 04 17:13:35 2022 +0100 @@ -7,6 +7,7 @@ Module implementing the help viewer base class. """ +import contextlib import functools from PyQt6.QtCore import pyqtSlot, Qt, QEvent, QTimer, QUrl, QPoint @@ -612,6 +613,16 @@ act.triggered.connect( functools.partial(self.__copyLink, act)) + act = menu.addAction( + UI.PixmapCache.getIcon("bookmark22"), + self.tr("Bookmark Page")) + act.setData({ + "title": self.pageTitle(), + "url": self.link() + }) + act.triggered.connect( + functools.partial(self.__bookmarkPage, act)) + menu.addSeparator() act = menu.addAction( @@ -719,6 +730,21 @@ self.__helpViewerWidget.openUrlNewBackgroundPage(url) + def __bookmarkPage(self, act): + """ + Private method called by the context menu to bookmark the page. + + @param act reference to the action that triggered + @type QAction + """ + data = act.data() + if data: + with contextlib.suppress(KeyError): + url = data["url"] + title = data["title"] + + self.__helpViewerWidget.bookmarkPage(title, url) + def __copyLink(self, act): """ Private method called by the context menu to copy a link to the