Continued porting the web browser. QtWebEngine

Thu, 03 Mar 2016 19:34:04 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 03 Mar 2016 19:34:04 +0100
branch
QtWebEngine
changeset 4795
6e0a26c633b2
parent 4792
f55fa7eb3cf3
child 4798
ee1a24311b03

Continued porting the web browser.

- made the web browser 'Print to Pdf' available on Linux only.

WebBrowser/WebBrowserTabWidget.py file | annotate | diff | comparison | revisions
WebBrowser/WebBrowserWindow.py file | annotate | diff | comparison | revisions
--- a/WebBrowser/WebBrowserTabWidget.py	Wed Mar 02 19:41:59 2016 +0100
+++ b/WebBrowser/WebBrowserTabWidget.py	Thu Mar 03 19:34:04 2016 +0100
@@ -29,6 +29,7 @@
 
 import Utilities
 import Preferences
+import Globals
 
 from eric6config import getConfig
 
@@ -179,9 +180,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/WebBrowser/WebBrowserWindow.py	Wed Mar 02 19:41:59 2016 +0100
+++ b/WebBrowser/WebBrowserWindow.py	Thu Mar 03 19:34:04 2016 +0100
@@ -46,6 +46,7 @@
 from Preferences import Shortcuts
 
 import Utilities
+import Globals
 
 import UI.PixmapCache
 import UI.Config
@@ -686,21 +687,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, 'webbrowser_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, 'webbrowser_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'),
@@ -1760,7 +1764,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)
@@ -1927,7 +1932,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