Helpviewer/HelpWindow.py

branch
6_1_x
changeset 4794
7a0bb183bee1
parent 4748
ab2ca2fe65ae
child 4994
e8a7367fccd9
--- a/Helpviewer/HelpWindow.py	Sat Feb 27 12:54:01 2016 +0100
+++ b/Helpviewer/HelpWindow.py	Thu Mar 03 19:32:11 2016 +0100
@@ -48,6 +48,7 @@
 from Preferences import Shortcuts
 
 import Utilities
+import Globals
 
 import UI.PixmapCache
 import UI.Config
@@ -608,21 +609,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'),
@@ -1592,7 +1596,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)
@@ -1748,7 +1753,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)

eric ide

mercurial