--- a/WebBrowser/WebBrowserWindow.py Sun May 28 16:59:18 2017 +0200 +++ b/WebBrowser/WebBrowserWindow.py Mon May 29 19:16:29 2017 +0200 @@ -826,6 +826,21 @@ else: self.printPreviewAct = None + self.sendPageLinkAct = E5Action( + self.tr('Send Page Link'), + UI.PixmapCache.getIcon("mailSend.png"), + self.tr('Send Page Link'), + 0, 0, self, 'webbrowser_send_page_link') + self.sendPageLinkAct.setStatusTip(self.tr( + 'Send the link of the current page via email')) + self.sendPageLinkAct.setWhatsThis(self.tr( + """<b>Send Page Link</b>""" + """<p>Send the link of the current page via email.</p>""" + )) + if not self.__initShortcutsOnly: + self.sendPageLinkAct.triggered.connect(self.__sendPageLink) + self.__actions.append(self.sendPageLinkAct) + self.closeAct = E5Action( self.tr('Close'), UI.PixmapCache.getIcon("close.png"), @@ -1895,6 +1910,7 @@ menu.addAction(self.printAct) if self.printPdfAct: menu.addAction(self.printPdfAct) + menu.addAction(self.sendPageLinkAct) menu.addSeparator() menu.addAction(self.closeAct) menu.addAction(self.closeAllAct) @@ -2072,7 +2088,7 @@ if self.printPdfAct: menu.addAction(self.printPdfAct) - # TODO: add "Send Page Link" action + self.__superMenu.addAction(self.sendPageLinkAct) self.__superMenu.addSeparator() self.__superMenu.addAction(self.selectAllAct) self.__superMenu.addAction(self.findAct) @@ -3668,6 +3684,15 @@ """ self.newPrivateWindow(url) + def __sendPageLink(self): + """ + Private slot to send the link of the current page via email. + """ + url = self.currentBrowser().url() + if not url.isEmpty(): + urlStr = url.toString() + QDesktopServices.openUrl(QUrl("mailto:?body=" + urlStr)) + @classmethod def historyManager(cls): """