Thu, 03 Mar 2016 19:30:50 +0100
Made the web browser 'Print to Pdf' available on Linux only.
--- a/Helpviewer/HelpTabWidget.py Sun Feb 28 15:42:45 2016 +0100 +++ b/Helpviewer/HelpTabWidget.py Thu Mar 03 19:30:50 2016 +0100 @@ -27,6 +27,7 @@ import Utilities import Preferences +import Globals from eric6config import getConfig @@ -177,9 +178,10 @@ self.__tabContextMenu.addAction( UI.PixmapCache.getIcon("print.png"), self.tr('Print'), self.__tabContextMenuPrint) - self.__tabContextMenu.addAction( - UI.PixmapCache.getIcon("printPdf.png"), - self.tr('Print as PDF'), self.__tabContextMenuPrintPdf) + if Globals.isLinuxPlatform(): + self.__tabContextMenu.addAction( + UI.PixmapCache.getIcon("printPdf.png"), + self.tr('Print as PDF'), self.__tabContextMenuPrintPdf) self.__tabContextMenu.addSeparator() self.__tabContextMenu.addAction( UI.PixmapCache.getIcon("reload.png"),
--- a/Helpviewer/HelpWindow.py Sun Feb 28 15:42:45 2016 +0100 +++ b/Helpviewer/HelpWindow.py Thu Mar 03 19:30:50 2016 +0100 @@ -50,6 +50,7 @@ from Preferences import Shortcuts import Utilities +import Globals import UI.PixmapCache import UI.Config @@ -612,21 +613,24 @@ self.printAct.triggered.connect(self.tabWidget.printBrowser) self.__actions.append(self.printAct) - self.printPdfAct = E5Action( - self.tr('Print as PDF'), - UI.PixmapCache.getIcon("printPdf.png"), - self.tr('Print as PDF'), - 0, 0, self, 'help_file_print_pdf') - self.printPdfAct.setStatusTip(self.tr( - 'Print the displayed help as PDF')) - self.printPdfAct.setWhatsThis(self.tr( - """<b>Print as PDF</b>""" - """<p>Print the displayed help text as a PDF file.</p>""" - )) - if not self.initShortcutsOnly: - self.printPdfAct.triggered.connect( - self.tabWidget.printBrowserPdf) - self.__actions.append(self.printPdfAct) + if Globals.isLinuxPlatform(): + self.printPdfAct = E5Action( + self.tr('Print as PDF'), + UI.PixmapCache.getIcon("printPdf.png"), + self.tr('Print as PDF'), + 0, 0, self, 'help_file_print_pdf') + self.printPdfAct.setStatusTip(self.tr( + 'Print the displayed help as PDF')) + self.printPdfAct.setWhatsThis(self.tr( + """<b>Print as PDF</b>""" + """<p>Print the displayed help text as a PDF file.</p>""" + )) + if not self.initShortcutsOnly: + self.printPdfAct.triggered.connect( + self.tabWidget.printBrowserPdf) + self.__actions.append(self.printPdfAct) + else: + self.printPdfAct = None self.printPreviewAct = E5Action( self.tr('Print Preview'), @@ -1612,7 +1616,8 @@ menu.addSeparator() menu.addAction(self.printPreviewAct) menu.addAction(self.printAct) - menu.addAction(self.printPdfAct) + if self.printPdfAct: + menu.addAction(self.printPdfAct) menu.addSeparator() menu.addAction(self.closeAct) menu.addAction(self.closeAllAct) @@ -1770,7 +1775,8 @@ filetb.addSeparator() filetb.addAction(self.printPreviewAct) filetb.addAction(self.printAct) - filetb.addAction(self.printPdfAct) + if self.printPdfAct: + filetb.addAction(self.printPdfAct) filetb.addSeparator() filetb.addAction(self.closeAct) filetb.addAction(self.exitAct)