16 import os |
16 import os |
17 import shutil |
17 import shutil |
18 import sys |
18 import sys |
19 |
19 |
20 from PyQt5.QtCore import pyqtSlot, pyqtSignal, Qt, QByteArray, QSize, QTimer, \ |
20 from PyQt5.QtCore import pyqtSlot, pyqtSignal, Qt, QByteArray, QSize, QTimer, \ |
21 QUrl, QThread, QTextCodec, QProcess, QEvent |
21 QUrl, QTextCodec, QProcess, QEvent |
22 from PyQt5.QtGui import QDesktopServices, QKeySequence, QFont, QFontMetrics, \ |
22 from PyQt5.QtGui import QDesktopServices, QKeySequence, QFont, QFontMetrics |
23 QIcon |
|
24 from PyQt5.QtWidgets import QWidget, QVBoxLayout, QSizePolicy, QDockWidget, \ |
23 from PyQt5.QtWidgets import QWidget, QVBoxLayout, QSizePolicy, QDockWidget, \ |
25 QComboBox, QLabel, QSplitter, QMenu, QToolButton, QLineEdit, \ |
24 QComboBox, QLabel, QSplitter, QMenu, QToolButton, QLineEdit, \ |
26 QApplication, QWhatsThis, QDialog, QHBoxLayout, QProgressBar, QAction, \ |
25 QApplication, QWhatsThis, QDialog, QHBoxLayout, QProgressBar, QAction, \ |
27 QInputDialog |
26 QInputDialog |
28 ##from PyQt5.QtNetwork import QNetworkAccessManager, QNetworkRequest |
|
29 from PyQt5.QtWebEngineWidgets import QWebEngineSettings, QWebEnginePage, \ |
27 from PyQt5.QtWebEngineWidgets import QWebEngineSettings, QWebEnginePage, \ |
30 QWebEngineProfile, QWebEngineScript |
28 QWebEngineProfile, QWebEngineScript |
31 try: |
29 try: |
32 from PyQt5.QtHelp import QHelpEngine, QHelpEngineCore, QHelpSearchQuery |
30 from PyQt5.QtHelp import QHelpEngine, QHelpEngineCore, QHelpSearchQuery |
33 QTHELP_AVAILABLE = True |
31 QTHELP_AVAILABLE = True |
1682 menu.addAction(self.newAct) |
1678 menu.addAction(self.newAct) |
1683 menu.addAction(self.newPrivateAct) |
1679 menu.addAction(self.newPrivateAct) |
1684 menu.addAction(self.openAct) |
1680 menu.addAction(self.openAct) |
1685 menu.addAction(self.openTabAct) |
1681 menu.addAction(self.openTabAct) |
1686 menu.addSeparator() |
1682 menu.addSeparator() |
|
1683 # TODO: Qt 5.7: Save |
1687 ## menu.addAction(self.saveAsAct) |
1684 ## menu.addAction(self.saveAsAct) |
1688 menu.addAction(self.savePageScreenAct) |
1685 menu.addAction(self.savePageScreenAct) |
1689 menu.addAction(self.saveVisiblePageScreenAct) |
1686 menu.addAction(self.saveVisiblePageScreenAct) |
1690 menu.addSeparator() |
1687 menu.addSeparator() |
1691 menu.addAction(self.printPreviewAct) |
1688 menu.addAction(self.printPreviewAct) |
1842 filetb.addAction(self.newAct) |
1839 filetb.addAction(self.newAct) |
1843 filetb.addAction(self.newPrivateAct) |
1840 filetb.addAction(self.newPrivateAct) |
1844 filetb.addAction(self.openAct) |
1841 filetb.addAction(self.openAct) |
1845 filetb.addAction(self.openTabAct) |
1842 filetb.addAction(self.openTabAct) |
1846 filetb.addSeparator() |
1843 filetb.addSeparator() |
|
1844 # TODO: Qt 5.7: Save |
1847 ## filetb.addAction(self.saveAsAct) |
1845 ## filetb.addAction(self.saveAsAct) |
1848 filetb.addAction(self.savePageScreenAct) |
1846 filetb.addAction(self.savePageScreenAct) |
1849 filetb.addSeparator() |
1847 filetb.addSeparator() |
1850 filetb.addAction(self.printPreviewAct) |
1848 filetb.addAction(self.printPreviewAct) |
1851 filetb.addAction(self.printAct) |
1849 filetb.addAction(self.printAct) |
2861 Private method to show the table of contents window. |
2859 Private method to show the table of contents window. |
2862 """ |
2860 """ |
2863 if WebBrowserWindow.useQtHelp: |
2861 if WebBrowserWindow.useQtHelp: |
2864 self.__activateDock(self.__tocWindow) |
2862 self.__activateDock(self.__tocWindow) |
2865 |
2863 |
2866 ## def __hideTocWindow(self): |
|
2867 ## """ |
|
2868 ## Private method to hide the table of contents window. |
|
2869 ## """ |
|
2870 ## if WebBrowserWindow.UseQtHelp: |
|
2871 ## self.__tocDock.hide() |
|
2872 ## |
|
2873 def __showIndexWindow(self): |
2864 def __showIndexWindow(self): |
2874 """ |
2865 """ |
2875 Private method to show the index window. |
2866 Private method to show the index window. |
2876 """ |
2867 """ |
2877 if WebBrowserWindow.useQtHelp: |
2868 if WebBrowserWindow.useQtHelp: |
2878 self.__activateDock(self.__indexWindow) |
2869 self.__activateDock(self.__indexWindow) |
2879 |
2870 |
2880 ## def __hideIndexWindow(self): |
|
2881 ## """ |
|
2882 ## Private method to hide the index window. |
|
2883 ## """ |
|
2884 ## if WebBrowserWindow.UseQtHelp: |
|
2885 ## self.__indexDock.hide() |
|
2886 ## |
|
2887 def __showSearchWindow(self): |
2871 def __showSearchWindow(self): |
2888 """ |
2872 """ |
2889 Private method to show the search window. |
2873 Private method to show the search window. |
2890 """ |
2874 """ |
2891 if WebBrowserWindow.useQtHelp: |
2875 if WebBrowserWindow.useQtHelp: |
2892 self.__activateDock(self.__searchWindow) |
2876 self.__activateDock(self.__searchWindow) |
2893 |
2877 |
2894 ## def __hideSearchWindow(self): |
|
2895 ## """ |
|
2896 ## Private method to hide the search window. |
|
2897 ## """ |
|
2898 ## if WebBrowserWindow.UseQtHelp: |
|
2899 ## self.__searchDock.hide() |
|
2900 ## |
|
2901 def __activateDock(self, widget): |
2878 def __activateDock(self, widget): |
2902 """ |
2879 """ |
2903 Private method to activate the dock widget of the given widget. |
2880 Private method to activate the dock widget of the given widget. |
2904 |
2881 |
2905 @param widget reference to the widget to be activated (QWidget) |
2882 @param widget reference to the widget to be activated (QWidget) |