WebBrowser/WebBrowserWindow.py

Fri, 05 Feb 2016 20:02:09 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 05 Feb 2016 20:02:09 +0100
branch
QtWebEngine
changeset 4717
5841f229baf7
parent 4715
79009bc4acd5
child 4725
b19ff70ba509
permissions
-rw-r--r--

Continued porting the web browser.

0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
4631
5c1a96925da4 Updated copyright for 2016.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4629
diff changeset
3 # Copyright (c) 2002 - 2016 Detlev Offenbach <detlev@die-offenbachs.de>
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
7 Module implementing the web browser main window.
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
3145
a9de05d4a22f # __IGNORE_WARNING__ added/ removed.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 3080
diff changeset
10 from __future__ import unicode_literals
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2411
diff changeset
11 try:
4715
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
12 str = unicode # __IGNORE_EXCEPTION__
3484
645c12de6b0c Merge with default branch.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 3178 3345
diff changeset
13 except NameError:
2525
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2411
diff changeset
14 pass
8b507a9a2d40 Script changes: Future import added, super calls modified and unicode behavior for str.
T.Rzepka <Tobias.Rzepka@gmail.com>
parents: 2411
diff changeset
15
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16 import os
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
18 from PyQt5.QtCore import pyqtSlot, pyqtSignal, Qt, QByteArray, QSize, QTimer, \
2999
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
19 QUrl, QThread, QTextCodec
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
20 from PyQt5.QtGui import QDesktopServices, QKeySequence, QFont, QFontMetrics, \
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
21 QIcon
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
22 from PyQt5.QtWidgets import QWidget, QVBoxLayout, QSizePolicy, QDockWidget, \
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
23 QComboBox, QLabel, QSplitter, QMenu, QToolButton, QLineEdit, \
4335
a25c157625c4 Started implementing the VirusTotal APIv2 interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4332
diff changeset
24 QApplication, QWhatsThis, QDialog, QHBoxLayout, QProgressBar, QAction, \
a25c157625c4 Started implementing the VirusTotal APIv2 interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4332
diff changeset
25 QInputDialog
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
26 ##from PyQt5.QtNetwork import QNetworkAccessManager, QNetworkRequest
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
27 from PyQt5.QtWebEngineWidgets import QWebEngineSettings, QWebEnginePage
2411
aec0a8a6e548 Removed the QtHelp dependancy; support is only available, if the QtHelp module could be imported.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
28 try:
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
29 from PyQt5.QtHelp import QHelpEngine, QHelpEngineCore, QHelpSearchQuery
2411
aec0a8a6e548 Removed the QtHelp dependancy; support is only available, if the QtHelp module could be imported.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
30 QTHELP_AVAILABLE = True
aec0a8a6e548 Removed the QtHelp dependancy; support is only available, if the QtHelp module could be imported.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
31 except ImportError:
aec0a8a6e548 Removed the QtHelp dependancy; support is only available, if the QtHelp module could be imported.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
32 QTHELP_AVAILABLE = False
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
33 ##
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
34 ##from .Network.NetworkAccessManager import SSL_AVAILABLE
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
35 ##
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
36 ##from .data import icons_rc # __IGNORE_WARNING__
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
37 ##from .data import html_rc # __IGNORE_WARNING__
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
38 ##from .data import javascript_rc # __IGNORE_WARNING__
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
39 ##
55
b5c84934de9c Renamed E4Gui to E5Gui.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 54
diff changeset
40 from E5Gui.E5Action import E5Action
2697
1cd7fa670b05 Added a dialog to edit the list of unwanted error messages.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2411
diff changeset
41 from E5Gui import E5MessageBox, E5FileDialog, E5ErrorMessage
2101
5bac7dee9e1a Introduced the E5MainWindow class allowing to set a style for all the main windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2100
diff changeset
42 from E5Gui.E5MainWindow import E5MainWindow
2192
61b3849df76d Changed a few places to use the new notification system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2149
diff changeset
43 from E5Gui.E5Application import e5App
4715
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
44 from E5Gui.E5ZoomWidget import E5ZoomWidget
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
45
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
46 ##from E5Network.E5NetworkIcon import E5NetworkIcon
4629
99aaac59be4f Added a status bar icon to show the online status.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4618
diff changeset
47
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48 import Preferences
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 from Preferences import Shortcuts
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
51 import Utilities
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
52
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
53 import UI.PixmapCache
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 import UI.Config
1580
7495b3e892a9 Enhanced the web browser about box and corrected the behavior of the web browser full screen toolbutton.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1562
diff changeset
55 from UI.Info import Version
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
57
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
58 class WebBrowserWindow(E5MainWindow):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60 Class implementing the web browser main window.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
62 @signal webBrowserClosed() emitted after the window was requested to close
2999
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
63 @signal zoomTextOnlyChanged(bool) emitted after the zoom text only setting
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
64 was changed
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65 """
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
66 ## zoomTextOnlyChanged = pyqtSignal(bool)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
67 webBrowserClosed = pyqtSignal()
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
68 ## privacyChanged = pyqtSignal(bool)
487
4d41d03d3d00 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 464
diff changeset
69
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
70 BrowserWindows = []
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
72 ## maxMenuFilePathLen = 75
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
73 ##
2192
61b3849df76d Changed a few places to use the new notification system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2149
diff changeset
74 _fromEric = False
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
75 UseQtHelp = QTHELP_AVAILABLE
2192
61b3849df76d Changed a few places to use the new notification system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2149
diff changeset
76
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
77 ## _networkAccessManager = None
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
78 ## _cookieJar = None
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
79 ## _helpEngine = None
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
80 ## _bookmarksManager = None
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
81 ## _historyManager = None
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
82 ## _passwordManager = None
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
83 ## _adblockManager = None
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
84 ## _downloadManager = None
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
85 ## _feedsManager = None
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
86 ## _userAgentsManager = None
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
87 ## _syncManager = None
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
88 ## _speedDial = None
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
89 ## _personalInformationManager = None
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
90 ## _greaseMonkeyManager = None
2192
61b3849df76d Changed a few places to use the new notification system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2149
diff changeset
91 _notification = None
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
92 ## _featurePermissionManager = None
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
93 ## _flashCookieManager = None
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
94 ## _zoomManager = None
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
96 def __init__(self, home, path, parent, name, fromEric=False,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
97 initShortcutsOnly=False, searchWord=None):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 Constructor
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101 @param home the URL to be shown (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102 @param path the path of the working dir (usually '.') (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 @param parent parent widget of this window (QWidget)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104 @param name name of this window (string)
2999
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
105 @param fromEric flag indicating whether it was called from within
3670
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3656
diff changeset
106 eric6 (boolean)
2999
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
107 @keyparam initShortcutsOnly flag indicating to just initialize the
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
108 keyboard shortcuts (boolean)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 @keyparam searchWord word to search for (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110 """
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
111 super(WebBrowserWindow, self).__init__(parent)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112 self.setObjectName(name)
3670
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3656
diff changeset
113 self.setWindowTitle(self.tr("eric6 Web Browser"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
115 self.__fromEric = fromEric
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
116 WebBrowserWindow._fromEric = fromEric
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
117 self.__initShortcutsOnly = initShortcutsOnly
1580
7495b3e892a9 Enhanced the web browser about box and corrected the behavior of the web browser full screen toolbutton.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1562
diff changeset
118 self.setWindowIcon(UI.PixmapCache.getIcon("ericWeb.png"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
120 self.__mHistory = []
934
657269549914 Changed the configuration dialog to remember the last show page name.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 923
diff changeset
121 self.__lastConfigurationPageName = ""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
123 ## self.__eventMouseButtons = Qt.NoButton
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
124 ## self.__eventKeyboardModifiers = Qt.NoModifier
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
125 ##
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
126 if self.__initShortcutsOnly:
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
127 self.__initActions()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
128 else:
2400
c1726b754f96 Started with delaying the import upon the time it is needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2361
diff changeset
129 from .SearchWidget import SearchWidget
4715
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
130 # TODO: QtHelp
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
131 ## from .HelpTocWidget import HelpTocWidget
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
132 ## from .HelpIndexWidget import HelpIndexWidget
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
133 ## from .HelpSearchWidget import HelpSearchWidget
4715
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
134 from .WebBrowserView import WebBrowserView
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
135 from .WebBrowserTabWidget import WebBrowserTabWidget
4715
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
136 # TODO: AdBlock
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
137 ## from .AdBlock.AdBlockIcon import AdBlockIcon
4715
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
138 # TODO: VirusTotal
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
139 ## from .VirusTotal.VirusTotalApi import VirusTotalAPI
2400
c1726b754f96 Started with delaying the import upon the time it is needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2361
diff changeset
140
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
141 # TODO: allow using Qt Help even if not called from eric6
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
142 WebBrowserWindow.setUseQtHelp(self.__fromEric)
2411
aec0a8a6e548 Removed the QtHelp dependancy; support is only available, if the QtHelp module could be imported.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2400
diff changeset
143
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
144 if not self.__fromEric:
2999
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
145 self.setStyle(Preferences.getUI("Style"),
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
146 Preferences.getUI("StyleSheet"))
4317
0de465a93200 Added code to limit SSL sockets to ciphers with at least 128 bits for Qt < 5.3.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
147
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
148 # TODO: Check if this is needed with QtWebEngine
4317
0de465a93200 Added code to limit SSL sockets to ciphers with at least 128 bits for Qt < 5.3.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4021
diff changeset
149 # initialize some SSL stuff
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
150 ## from E5Network.E5SslUtilities import initSSL
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
151 ## initSSL()
2100
fb16f4650860 Added a style sheet file to disable single click activation and an interface configuration page for the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2099
diff changeset
152
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
153 # TODO: do these once Qt 5.6 is available
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
154 ## if WebBrowserWindow.UseQtHelp:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
155 ## self.__helpEngine = \
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
156 ## QHelpEngine(os.path.join(Utilities.getConfigDir(),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
157 ## "browser", "eric6help.qhc"), self)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
158 ## self.__removeOldDocumentation()
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
159 ## self.__helpEngine.warning.connect(self.__warning)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
160 ## else:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
161 ## self.__helpEngine = None
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
162 ## self.__helpInstaller = None
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
163
4715
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
164 self.__zoomWidget = E5ZoomWidget(
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
165 UI.PixmapCache.getPixmap("zoomOut.png"),
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
166 UI.PixmapCache.getPixmap("zoomIn.png"),
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
167 UI.PixmapCache.getPixmap("zoomReset.png"), self)
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
168 self.statusBar().addPermanentWidget(self.__zoomWidget)
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
169 self.__zoomWidget.setMapping(
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
170 WebBrowserView.ZoomLevels, WebBrowserView.ZoomLevelDefault)
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
171 self.__zoomWidget.valueChanged.connect(self.__zoomValueChanged)
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
172
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
173 self.__tabWidget = WebBrowserTabWidget(self)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
174 self.__tabWidget.currentChanged[int].connect(self.__currentChanged)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
175 self.__tabWidget.titleChanged.connect(self.__titleChanged)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
176 self.__tabWidget.showMessage.connect(self.statusBar().showMessage)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
177 self.__tabWidget.browserClosed.connect(self.__browserClosed)
4715
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
178 self.__tabWidget.browserZoomValueChanged.connect(
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
179 self.__zoomWidget.setValue)
2334
fc69ad77e18a Introduced a zoom widget in the status bar of several windows.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2302
diff changeset
180
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
181 self.__searchWidget = SearchWidget(self, self)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
182 centralWidget = QWidget()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
183 layout = QVBoxLayout()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
184 layout.setContentsMargins(1, 1, 1, 1)
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
185 layout.addWidget(self.__tabWidget)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
186 layout.addWidget(self.__searchWidget)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
187 self.__tabWidget.setSizePolicy(
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
188 QSizePolicy.Preferred, QSizePolicy.Expanding)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
189 centralWidget.setLayout(layout)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
190 self.setCentralWidget(centralWidget)
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
191 self.__searchWidget.hide()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
192
4715
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
193 # TODO: QtHelp, do these once Qt 5.6 is available
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
194 ## if WebBrowserWindow.UseQtHelp:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
195 ## # setup the TOC widget
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
196 ## self.__tocWindow = HelpTocWidget(self.__helpEngine, self)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
197 ## self.__tocDock = QDockWidget(self.tr("Contents"), self)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
198 ## self.__tocDock.setObjectName("TocWindow")
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
199 ## self.__tocDock.setWidget(self.__tocWindow)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
200 ## self.addDockWidget(Qt.LeftDockWidgetArea, self.__tocDock)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
201 ##
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
202 ## # setup the index widget
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
203 ## self.__indexWindow = HelpIndexWidget(self.__helpEngine, self)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
204 ## self.__indexDock = QDockWidget(self.tr("Index"), self)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
205 ## self.__indexDock.setObjectName("IndexWindow")
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
206 ## self.__indexDock.setWidget(self.__indexWindow)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
207 ## self.addDockWidget(Qt.LeftDockWidgetArea, self.__indexDock)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
208 ##
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
209 ## # setup the search widget
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
210 ## self.__searchWord = searchWord
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
211 ## self.__indexing = False
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
212 ## self.__indexingProgress = None
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
213 ## self.__searchEngine = self.__helpEngine.searchEngine()
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
214 ## self.__searchEngine.indexingStarted.connect(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
215 ## self.__indexingStarted)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
216 ## self.__searchEngine.indexingFinished.connect(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
217 ## self.__indexingFinished)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
218 ## self.__searchWindow = HelpSearchWidget(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
219 ## self.__searchEngine, self)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
220 ## self.__searchDock = QDockWidget(self.tr("Search"), self)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
221 ## self.__searchDock.setObjectName("SearchWindow")
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
222 ## self.__searchDock.setWidget(self.__searchWindow)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
223 ## self.addDockWidget(Qt.LeftDockWidgetArea, self.__searchDock)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
224 ##
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
225 if Preferences.getWebBrowser("SaveGeometry"):
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
226 g = Preferences.getGeometry("WebBrowserGeometry")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
227 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
228 g = QByteArray()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
229 if g.isEmpty():
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
230 s = QSize(800, 800)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
231 self.resize(s)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
232 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
233 self.restoreGeometry(g)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
234
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
235 ## self.__setIconDatabasePath()
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
236 self.__initWebEngineSettings()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
237
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
238 self.__initActions()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
239 self.__initMenus()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
240 self.__initToolbars()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
241
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
242 ## self.historyManager()
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
243 ##
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
244 ## syncMgr = self.syncManager()
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
245 ## syncMgr.syncMessage.connect(self.statusBar().showMessage)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
246 ## syncMgr.syncError.connect(self.statusBar().showMessage)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
247 ##
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
248 self.__tabWidget.newBrowser(home)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
249 self.__tabWidget.currentBrowser().setFocus()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
250
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
251 WebBrowserWindow.BrowserWindows.append(self)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
252
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
253 ## self.__adBlockIcon = AdBlockIcon(self)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
254 ## self.statusBar().addPermanentWidget(self.__adBlockIcon)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
255 ## self.__adBlockIcon.setEnabled(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
256 ## Preferences.getHelp("AdBlockEnabled"))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
257 ## self.__tabWidget.currentChanged[int].connect(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
258 ## self.__adBlockIcon.currentChanged)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
259 ## self.__tabWidget.sourceChanged.connect(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
260 ## self.__adBlockIcon.sourceChanged)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
261 ##
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
262 ## self.networkIcon = E5NetworkIcon(self)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
263 ## self.statusBar().addPermanentWidget(self.networkIcon)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
264 ##
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
265 QDesktopServices.setUrlHandler("http", self.__linkActivated)
8
0ae9bd4d2993 Fixed a few bugs introduced introduced by the change to the QVariant v2 API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7
diff changeset
266 QDesktopServices.setUrlHandler("https", self.__linkActivated)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
267
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
268 # setup connections
2099
afde0e9110f7 Implemented guards against double activation of list entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2071
diff changeset
269 self.__activating = False
4715
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
270 # TODO: QtHelp, do these once Qt 5.6 is available
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
271 ## if WebBrowserWindow.UseQtHelp:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
272 ## # TOC window
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
273 ## self.__tocWindow.linkActivated.connect(self.__linkActivated)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
274 ## self.__tocWindow.escapePressed.connect(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
275 ## self.__activateCurrentBrowser)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
276 ## # index window
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
277 ## self.__indexWindow.linkActivated.connect(self.__linkActivated)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
278 ## self.__indexWindow.linksActivated.connect(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
279 ## self.__linksActivated)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
280 ## self.__indexWindow.escapePressed.connect(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
281 ## self.__activateCurrentBrowser)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
282 ## # search window
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
283 ## self.__searchWindow.linkActivated.connect(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
284 ## self.__linkActivated)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
285 ## self.__searchWindow.escapePressed.connect(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
286 ## self.__activateCurrentBrowser)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
287
4713
8dca047daf4b Continued with the web view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4709
diff changeset
288 state = Preferences.getWebBrowser("WebBrowserState")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
289 self.restoreState(state)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
290
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
291 ## self.__initHelpDb()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
292
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
293 ## self.__virusTotal = VirusTotalAPI(self)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
294 ## self.__virusTotal.submitUrlError.connect(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
295 ## self.__virusTotalSubmitUrlError)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
296 ## self.__virusTotal.urlScanReport.connect(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
297 ## self.__virusTotalUrlScanReport)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
298 ## self.__virusTotal.fileScanReport.connect(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
299 ## self.__virusTotalFileScanReport)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
300 ##
1196
77da430b4080 Added an action to preview the file in the eric web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1170
diff changeset
301 self.__previewer = None
2149
bd0bbb3043df Fixed a shutdown issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2101
diff changeset
302 self.__shutdownCalled = False
1196
77da430b4080 Added an action to preview the file in the eric web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1170
diff changeset
303
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
304 ## self.flashCookieManager()
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
305 ##
4715
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
306 # TODO: QtHelp, do these once Qt 5.6 is available
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
307 ## if WebBrowserWindow.UseQtHelp:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
308 ## QTimer.singleShot(0, self.__lookForNewDocumentation)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
309 ## if self.__searchWord is not None:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
310 ## QTimer.singleShot(0, self.__searchForWord)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
311 ##
4359
ac1dda9f3f19 Started adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4355
diff changeset
312 self.__lastActiveWindow = None
ac1dda9f3f19 Started adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4355
diff changeset
313 e5App().focusChanged[QWidget, QWidget].connect(
ac1dda9f3f19 Started adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4355
diff changeset
314 self.__appFocusChanged)
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
315 ##
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
316 ## QTimer.singleShot(0, syncMgr.loadSettings)
3236
92e15257b24e Added an empty destructor to the HelpWindow class to get rid of some Qt message.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3201
diff changeset
317
92e15257b24e Added an empty destructor to the HelpWindow class to get rid of some Qt message.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3201
diff changeset
318 def __del__(self):
92e15257b24e Added an empty destructor to the HelpWindow class to get rid of some Qt message.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3201
diff changeset
319 """
92e15257b24e Added an empty destructor to the HelpWindow class to get rid of some Qt message.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3201
diff changeset
320 Special method called during object destruction.
92e15257b24e Added an empty destructor to the HelpWindow class to get rid of some Qt message.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3201
diff changeset
321
92e15257b24e Added an empty destructor to the HelpWindow class to get rid of some Qt message.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3201
diff changeset
322 Note: This empty variant seems to get rid of the Qt message
92e15257b24e Added an empty destructor to the HelpWindow class to get rid of some Qt message.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3201
diff changeset
323 'Warning: QBasicTimer::start: QBasicTimer can only be used with
92e15257b24e Added an empty destructor to the HelpWindow class to get rid of some Qt message.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3201
diff changeset
324 threads started with QThread'
92e15257b24e Added an empty destructor to the HelpWindow class to get rid of some Qt message.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3201
diff changeset
325 """
92e15257b24e Added an empty destructor to the HelpWindow class to get rid of some Qt message.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3201
diff changeset
326 pass
92e15257b24e Added an empty destructor to the HelpWindow class to get rid of some Qt message.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3201
diff changeset
327
4715
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
328 def fromEric(self):
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
329 """
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
330 Public method to check, if the web browser was called from within the
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
331 eric IDE.
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
332 """
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
333 return self.__fromEric
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
334
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
335 ## def __setIconDatabasePath(self, enable=True):
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
336 ## """
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
337 ## Private method to set the favicons path.
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
338 ##
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
339 ## @param enable flag indicating to enabled icon storage (boolean)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
340 ## """
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
341 ## if enable:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
342 ## iconDatabasePath = os.path.join(Utilities.getConfigDir(),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
343 ## "browser", "favicons")
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
344 ## if not os.path.exists(iconDatabasePath):
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
345 ## os.makedirs(iconDatabasePath)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
346 ## else:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
347 ## iconDatabasePath = "" # setting an empty path disables it
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
348 ## QWebSettings.setIconDatabasePath(iconDatabasePath)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
349 ##
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
350 def __initWebEngineSettings(self):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
351 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
352 Private method to set the global web settings.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
353 """
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
354 standardFont = Preferences.getWebBrowser("StandardFont")
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
355 fixedFont = Preferences.getWebBrowser("FixedFont")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
356
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
357 settings = QWebEngineSettings.globalSettings()
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
358 ## settings.setAttribute(QWebSettings.DeveloperExtrasEnabled, True)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
359
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
360 settings.setFontFamily(QWebEngineSettings.StandardFont,
2999
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
361 standardFont.family())
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
362 settings.setFontSize(QWebEngineSettings.DefaultFontSize,
2999
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
363 standardFont.pointSize())
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
364 settings.setFontFamily(QWebEngineSettings.FixedFont,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
365 fixedFont.family())
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
366 settings.setFontSize(QWebEngineSettings.DefaultFixedFontSize,
2999
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
367 fixedFont.pointSize())
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
368
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
369 ## styleSheet = Preferences.getHelp("UserStyleSheet")
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
370 ## settings.setUserStyleSheetUrl(self.__userStyleSheet(styleSheet))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
371 ##
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
372 settings.setAttribute(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
373 QWebEngineSettings.AutoLoadImages,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
374 Preferences.getWebBrowser("AutoLoadImages"))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
375 ## settings.setAttribute(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
376 ## QWebSettings.JavaEnabled,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
377 ## Preferences.getHelp("JavaEnabled"))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
378 settings.setAttribute(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
379 QWebEngineSettings.JavascriptEnabled,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
380 Preferences.getWebBrowser("JavaScriptEnabled"))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
381 settings.setAttribute(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
382 QWebEngineSettings.JavascriptCanOpenWindows,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
383 Preferences.getWebBrowser("JavaScriptCanOpenWindows"))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
384 settings.setAttribute(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
385 QWebEngineSettings.JavascriptCanAccessClipboard,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
386 Preferences.getWebBrowser("JavaScriptCanAccessClipboard"))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
387 ## settings.setAttribute(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
388 ## QWebSettings.PluginsEnabled,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
389 ## Preferences.getHelp("PluginsEnabled"))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
390
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
391 ## if hasattr(QWebSettings, "PrintElementBackgrounds"):
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
392 ## settings.setAttribute(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
393 ## QWebSettings.PrintElementBackgrounds,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
394 ## Preferences.getHelp("PrintBackgrounds"))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
395 ##
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
396 ## if hasattr(QWebSettings, "setOfflineStoragePath"):
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
397 ## settings.setAttribute(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
398 ## QWebSettings.OfflineStorageDatabaseEnabled,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
399 ## Preferences.getHelp("OfflineStorageDatabaseEnabled"))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
400 ## webDatabaseDir = os.path.join(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
401 ## Utilities.getConfigDir(), "browser", "webdatabases")
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
402 ## if not os.path.exists(webDatabaseDir):
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
403 ## os.makedirs(webDatabaseDir)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
404 ## settings.setOfflineStoragePath(webDatabaseDir)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
405 ## settings.setOfflineStorageDefaultQuota(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
406 ## Preferences.getHelp("OfflineStorageDatabaseQuota") *
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
407 ## 1024 * 1024)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
408 ##
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
409 ## if hasattr(QWebSettings, "OfflineWebApplicationCacheEnabled"):
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
410 ## settings.setAttribute(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
411 ## QWebSettings.OfflineWebApplicationCacheEnabled,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
412 ## Preferences.getHelp("OfflineWebApplicationCacheEnabled"))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
413 ## appCacheDir = os.path.join(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
414 ## Utilities.getConfigDir(), "browser", "webappcaches")
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
415 ## if not os.path.exists(appCacheDir):
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
416 ## os.makedirs(appCacheDir)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
417 ## settings.setOfflineWebApplicationCachePath(appCacheDir)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
418 ## settings.setOfflineWebApplicationCacheQuota(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
419 ## Preferences.getHelp("OfflineWebApplicationCacheQuota") *
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
420 ## 1024 * 1024)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
421 ##
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
422 settings.setAttribute(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
423 QWebEngineSettings.LocalStorageEnabled,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
424 Preferences.getWebBrowser("LocalStorageEnabled"))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
425 ## localStorageDir = os.path.join(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
426 ## Utilities.getConfigDir(), "browser", "weblocalstorage")
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
427 ## if not os.path.exists(localStorageDir):
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
428 ## os.makedirs(localStorageDir)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
429 ## settings.setLocalStoragePath(localStorageDir)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
430 ##
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
431 ## if hasattr(QWebSettings, "DnsPrefetchEnabled"):
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
432 ## settings.setAttribute(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
433 ## QWebSettings.DnsPrefetchEnabled,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
434 ## Preferences.getHelp("DnsPrefetchEnabled"))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
435 ##
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
436 settings.setDefaultTextEncoding(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
437 Preferences.getWebBrowser("DefaultTextEncoding"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
438
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
439 settings.setAttribute(
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
440 QWebEngineSettings.SpatialNavigationEnabled,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
441 Preferences.getWebBrowser("SpatialNavigationEnabled"))
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
442 settings.setAttribute(
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
443 QWebEngineSettings.LinksIncludedInFocusChain,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
444 Preferences.getWebBrowser("LinksIncludedInFocusChain"))
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
445 settings.setAttribute(
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
446 QWebEngineSettings.LocalContentCanAccessRemoteUrls,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
447 Preferences.getWebBrowser("LocalContentCanAccessRemoteUrls"))
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
448 settings.setAttribute(
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
449 QWebEngineSettings.LocalContentCanAccessFileUrls,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
450 Preferences.getWebBrowser("LocalContentCanAccessFileUrls"))
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
451 settings.setAttribute(
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
452 QWebEngineSettings.XSSAuditingEnabled,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
453 Preferences.getWebBrowser("XSSAuditingEnabled"))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
454 ## if hasattr(QWebSettings, "SiteSpecificQuirksEnabled"):
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
455 ## settings.setAttribute(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
456 ## QWebSettings.SiteSpecificQuirksEnabled,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
457 ## Preferences.getHelp("SiteSpecificQuirksEnabled"))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
458 ##
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
459 ## QWebSecurityOrigin.addLocalScheme("eric")
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
460 settings.setAttribute(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
461 QWebEngineSettings.ScrollAnimatorEnabled,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
462 Preferences.getWebBrowser("ScrollAnimatorEnabled"))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
463 settings.setAttribute(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
464 QWebEngineSettings.ErrorPageEnabled,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
465 Preferences.getWebBrowser("ErrorPageEnabled"))
1337
95ceea538e4c Started to implement a few more browser options for the eric web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1232
diff changeset
466
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
467 def __initActions(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
468 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
469 Private method to define the user interface actions.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
470 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
471 # list of all actions
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
472 self.__actions = []
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
473
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
474 self.newTabAct = E5Action(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
475 self.tr('New Tab'),
638
265c31231d9d Did some refactoring of the web browser code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 637
diff changeset
476 UI.PixmapCache.getIcon("tabNew.png"),
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
477 self.tr('&New Tab'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
478 QKeySequence(self.tr("Ctrl+T", "File|New Tab")),
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
479 0, self, 'webbrowser_file_new_tab')
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
480 self.newTabAct.setStatusTip(self.tr('Open a new web browser tab'))
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
481 self.newTabAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
482 """<b>New Tab</b>"""
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
483 """<p>This opens a new web browser tab.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
484 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
485 if not self.__initShortcutsOnly:
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3236
diff changeset
486 self.newTabAct.triggered.connect(self.newTab)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
487 self.__actions.append(self.newTabAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
488
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
489 self.newAct = E5Action(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
490 self.tr('New Window'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
491 UI.PixmapCache.getIcon("newWindow.png"),
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
492 self.tr('New &Window'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
493 QKeySequence(self.tr("Ctrl+N", "File|New Window")),
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
494 0, self, 'webbrowser_file_new_window')
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
495 self.newAct.setStatusTip(self.tr('Open a new web browser window'))
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
496 self.newAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
497 """<b>New Window</b>"""
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
498 """<p>This opens a new web browser window.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
499 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
500 if not self.__initShortcutsOnly:
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3236
diff changeset
501 self.newAct.triggered.connect(self.newWindow)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
502 self.__actions.append(self.newAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
503
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
504 self.openAct = E5Action(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
505 self.tr('Open File'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
506 UI.PixmapCache.getIcon("open.png"),
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
507 self.tr('&Open File'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
508 QKeySequence(self.tr("Ctrl+O", "File|Open")),
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
509 0, self, 'webbrowser_file_open')
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
510 self.openAct.setStatusTip(self.tr('Open a file for display'))
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
511 self.openAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
512 """<b>Open File</b>"""
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
513 """<p>This opens a new file for display."""
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
514 """ It pops up a file selection dialog.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
515 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
516 if not self.__initShortcutsOnly:
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3236
diff changeset
517 self.openAct.triggered.connect(self.__openFile)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
518 self.__actions.append(self.openAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
519
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
520 self.openTabAct = E5Action(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
521 self.tr('Open File in New Tab'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
522 UI.PixmapCache.getIcon("openNewTab.png"),
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
523 self.tr('Open File in New &Tab'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
524 QKeySequence(self.tr("Shift+Ctrl+O", "File|Open in new tab")),
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
525 0, self, 'webbrowser_file_open_tab')
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 545
diff changeset
526 self.openTabAct.setStatusTip(
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
527 self.tr('Open a file for display in a new tab'))
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
528 self.openTabAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
529 """<b>Open File in New Tab</b>"""
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
530 """<p>This opens a new file for display in a new tab."""
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
531 """ It pops up a file selection dialog.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
532 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
533 if not self.__initShortcutsOnly:
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3236
diff changeset
534 self.openTabAct.triggered.connect(self.__openFileNewTab)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
535 self.__actions.append(self.openTabAct)
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
536 ##
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
537 ## self.saveAsAct = E5Action(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
538 ## self.tr('Save As'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
539 ## UI.PixmapCache.getIcon("fileSaveAs.png"),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
540 ## self.tr('&Save As...'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
541 ## QKeySequence(self.tr("Shift+Ctrl+S", "File|Save As")),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
542 ## 0, self, 'webbrowser_file_save_as')
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
543 ## self.saveAsAct.setStatusTip(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
544 ## self.tr('Save the current page to disk'))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
545 ## self.saveAsAct.setWhatsThis(self.tr(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
546 ## """<b>Save As...</b>"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
547 ## """<p>Saves the current page to disk.</p>"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
548 ## ))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
549 ## if not self.__initShortcutsOnly:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
550 ## self.saveAsAct.triggered.connect(self.__savePageAs)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
551 ## self.__actions.append(self.saveAsAct)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
552 ##
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
553 ## self.savePageScreenAct = E5Action(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
554 ## self.tr('Save Page Screen'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
555 ## UI.PixmapCache.getIcon("fileSavePixmap.png"),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
556 ## self.tr('Save Page Screen...'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
557 ## 0, 0, self, 'webbrowser_file_save_page_screen')
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
558 ## self.savePageScreenAct.setStatusTip(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
559 ## self.tr('Save the current page as a screen shot'))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
560 ## self.savePageScreenAct.setWhatsThis(self.tr(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
561 ## """<b>Save Page Screen...</b>"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
562 ## """<p>Saves the current page as a screen shot.</p>"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
563 ## ))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
564 ## if not self.__initShortcutsOnly:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
565 ## self.savePageScreenAct.triggered.connect(self.__savePageScreen)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
566 ## self.__actions.append(self.savePageScreenAct)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
567 ##
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
568 ## self.saveVisiblePageScreenAct = E5Action(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
569 ## self.tr('Save Visible Page Screen'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
570 ## UI.PixmapCache.getIcon("fileSaveVisiblePixmap.png"),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
571 ## self.tr('Save Visible Page Screen...'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
572 ## 0, 0, self, 'webbrowser_file_save_visible_page_screen')
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
573 ## self.saveVisiblePageScreenAct.setStatusTip(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
574 ## self.tr('Save the visible part of the current page as a'
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
575 ## ' screen shot'))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
576 ## self.saveVisiblePageScreenAct.setWhatsThis(self.tr(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
577 ## """<b>Save Visible Page Screen...</b>"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
578 ## """<p>Saves the visible part of the current page as a"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
579 ## """ screen shot.</p>"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
580 ## ))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
581 ## if not self.__initShortcutsOnly:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
582 ## self.saveVisiblePageScreenAct.triggered.connect(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
583 ## self.__saveVisiblePageScreen)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
584 ## self.__actions.append(self.saveVisiblePageScreenAct)
2804
a331371462a3 Added the capability to save the visible part of the current page as a screen shot.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2697
diff changeset
585
4715
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
586 # TODO: Bookmarks
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
587 ## bookmarksManager = self.bookmarksManager()
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
588 ## self.importBookmarksAct = E5Action(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
589 ## self.tr('Import Bookmarks'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
590 ## self.tr('&Import Bookmarks...'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
591 ## 0, 0, self, 'webbrowser_file_import_bookmarks')
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
592 ## self.importBookmarksAct.setStatusTip(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
593 ## self.tr('Import bookmarks from other browsers'))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
594 ## self.importBookmarksAct.setWhatsThis(self.tr(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
595 ## """<b>Import Bookmarks</b>"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
596 ## """<p>Import bookmarks from other browsers.</p>"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
597 ## ))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
598 ## if not self.__initShortcutsOnly:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
599 ## self.importBookmarksAct.triggered.connect(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
600 ## bookmarksManager.importBookmarks)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
601 ## self.__actions.append(self.importBookmarksAct)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
602 ##
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
603 ## self.exportBookmarksAct = E5Action(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
604 ## self.tr('Export Bookmarks'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
605 ## self.tr('&Export Bookmarks...'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
606 ## 0, 0, self, 'webbrowser_file_export_bookmarks')
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
607 ## self.exportBookmarksAct.setStatusTip(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
608 ## self.tr('Export the bookmarks into a file'))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
609 ## self.exportBookmarksAct.setWhatsThis(self.tr(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
610 ## """<b>Export Bookmarks</b>"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
611 ## """<p>Export the bookmarks into a file.</p>"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
612 ## ))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
613 ## if not self.__initShortcutsOnly:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
614 ## self.exportBookmarksAct.triggered.connect(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
615 ## bookmarksManager.exportBookmarks)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
616 ## self.__actions.append(self.exportBookmarksAct)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
617
4715
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
618 # TODO: print stuff
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
619 ## self.printAct = E5Action(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
620 ## self.tr('Print'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
621 ## UI.PixmapCache.getIcon("print.png"),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
622 ## self.tr('&Print'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
623 ## QKeySequence(self.tr("Ctrl+P", "File|Print")),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
624 ## 0, self, 'webbrowser_file_print')
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
625 ## self.printAct.setStatusTip(self.tr('Print the displayed help'))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
626 ## self.printAct.setWhatsThis(self.tr(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
627 ## """<b>Print</b>"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
628 ## """<p>Print the displayed help text.</p>"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
629 ## ))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
630 ## if not self.__initShortcutsOnly:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
631 ## self.printAct.triggered.connect(self.__tabWidget.printBrowser)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
632 ## self.__actions.append(self.printAct)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
633 ##
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
634 ## self.printPdfAct = E5Action(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
635 ## self.tr('Print as PDF'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
636 ## UI.PixmapCache.getIcon("printPdf.png"),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
637 ## self.tr('Print as PDF'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
638 ## 0, 0, self, 'webbrowser_file_print_pdf')
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
639 ## self.printPdfAct.setStatusTip(self.tr(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
640 ## 'Print the displayed help as PDF'))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
641 ## self.printPdfAct.setWhatsThis(self.tr(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
642 ## """<b>Print as PDF</b>"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
643 ## """<p>Print the displayed help text as a PDF file.</p>"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
644 ## ))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
645 ## if not self.__initShortcutsOnly:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
646 ## self.printPdfAct.triggered.connect(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
647 ## self.__tabWidget.printBrowserPdf)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
648 ## self.__actions.append(self.printPdfAct)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
649 ##
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
650 ## self.printPreviewAct = E5Action(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
651 ## self.tr('Print Preview'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
652 ## UI.PixmapCache.getIcon("printPreview.png"),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
653 ## self.tr('Print Preview'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
654 ## 0, 0, self, 'webbrowser_file_print_preview')
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
655 ## self.printPreviewAct.setStatusTip(self.tr(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
656 ## 'Print preview of the displayed help'))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
657 ## self.printPreviewAct.setWhatsThis(self.tr(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
658 ## """<b>Print Preview</b>"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
659 ## """<p>Print preview of the displayed help text.</p>"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
660 ## ))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
661 ## if not self.__initShortcutsOnly:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
662 ## self.printPreviewAct.triggered.connect(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
663 ## self.__tabWidget.printPreviewBrowser)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
664 ## self.__actions.append(self.printPreviewAct)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
665
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
666 self.closeAct = E5Action(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
667 self.tr('Close'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
668 UI.PixmapCache.getIcon("close.png"),
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
669 self.tr('&Close'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
670 QKeySequence(self.tr("Ctrl+W", "File|Close")),
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
671 0, self, 'webbrowser_file_close')
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
672 self.closeAct.setStatusTip(self.tr(
2999
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
673 'Close the current help window'))
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
674 self.closeAct.setWhatsThis(self.tr(
2999
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
675 """<b>Close</b>"""
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
676 """<p>Closes the current web browser window.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
677 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
678 if not self.__initShortcutsOnly:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
679 self.closeAct.triggered.connect(self.__tabWidget.closeBrowser)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
680 self.__actions.append(self.closeAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
681
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
682 self.closeAllAct = E5Action(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
683 self.tr('Close All'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
684 self.tr('Close &All'),
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
685 0, 0, self, 'webbrowser_file_close_all')
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
686 self.closeAllAct.setStatusTip(self.tr('Close all help windows'))
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
687 self.closeAllAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
688 """<b>Close All</b>"""
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
689 """<p>Closes all web browser windows except the first one.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
690 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
691 if not self.__initShortcutsOnly:
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3236
diff changeset
692 self.closeAllAct.triggered.connect(
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
693 self.__tabWidget.closeAllBrowsers)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
694 self.__actions.append(self.closeAllAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
695
4715
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
696 # TODO: Private Browsing
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
697 ## self.privateBrowsingAct = E5Action(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
698 ## self.tr('Private Browsing'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
699 ## UI.PixmapCache.getIcon("privateBrowsing.png"),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
700 ## self.tr('Private &Browsing'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
701 ## 0, 0, self, 'webbrowser_file_private_browsing')
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
702 ## self.privateBrowsingAct.setStatusTip(self.tr('Private Browsing'))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
703 ## self.privateBrowsingAct.setWhatsThis(self.tr(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
704 ## """<b>Private Browsing</b>"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
705 ## """<p>Enables private browsing. In this mode no history is"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
706 ## """ recorded anymore.</p>"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
707 ## ))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
708 ## if not self.__initShortcutsOnly:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
709 ## self.privateBrowsingAct.triggered.connect(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
710 ## self.__privateBrowsing)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
711 ## self.privateBrowsingAct.setCheckable(True)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
712 ## self.__actions.append(self.privateBrowsingAct)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
713
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
714 self.exitAct = E5Action(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
715 self.tr('Quit'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
716 UI.PixmapCache.getIcon("exit.png"),
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
717 self.tr('&Quit'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
718 QKeySequence(self.tr("Ctrl+Q", "File|Quit")),
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
719 0, self, 'webbrowser_file_quit')
3670
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3656
diff changeset
720 self.exitAct.setStatusTip(self.tr('Quit the eric6 Web Browser'))
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
721 self.exitAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
722 """<b>Quit</b>"""
3670
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3656
diff changeset
723 """<p>Quit the eric6 Web Browser.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
724 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
725 if not self.__initShortcutsOnly:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
726 if self.__fromEric:
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3236
diff changeset
727 self.exitAct.triggered.connect(self.close)
638
265c31231d9d Did some refactoring of the web browser code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 637
diff changeset
728 else:
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3236
diff changeset
729 self.exitAct.triggered.connect(self.__closeAllWindows)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
730 self.__actions.append(self.exitAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
731
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
732 self.backAct = E5Action(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
733 self.tr('Backward'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
734 UI.PixmapCache.getIcon("back.png"),
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
735 self.tr('&Backward'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
736 QKeySequence(self.tr("Alt+Left", "Go|Backward")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
737 QKeySequence(self.tr("Backspace", "Go|Backward")),
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
738 self, 'webbrowser_go_backward')
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
739 self.backAct.setStatusTip(self.tr('Move one screen backward'))
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
740 self.backAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
741 """<b>Backward</b>"""
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
742 """<p>Moves one screen backward. If none is"""
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
743 """ available, this action is disabled.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
744 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
745 if not self.__initShortcutsOnly:
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3236
diff changeset
746 self.backAct.triggered.connect(self.__backward)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
747 self.__actions.append(self.backAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
748
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
749 self.forwardAct = E5Action(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
750 self.tr('Forward'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
751 UI.PixmapCache.getIcon("forward.png"),
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
752 self.tr('&Forward'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
753 QKeySequence(self.tr("Alt+Right", "Go|Forward")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
754 QKeySequence(self.tr("Shift+Backspace", "Go|Forward")),
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
755 self, 'webbrowser_go_foreward')
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
756 self.forwardAct.setStatusTip(self.tr(
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
757 'Move one screen forward'))
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
758 self.forwardAct.setWhatsThis(self.tr(
2999
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
759 """<b>Forward</b>"""
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
760 """<p>Moves one screen forward. If none is"""
2999
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
761 """ available, this action is disabled.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
762 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
763 if not self.__initShortcutsOnly:
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3236
diff changeset
764 self.forwardAct.triggered.connect(self.__forward)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
765 self.__actions.append(self.forwardAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
766
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
767 self.homeAct = E5Action(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
768 self.tr('Home'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
769 UI.PixmapCache.getIcon("home.png"),
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
770 self.tr('&Home'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
771 QKeySequence(self.tr("Ctrl+Home", "Go|Home")),
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
772 0, self, 'webbrowser_go_home')
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
773 self.homeAct.setStatusTip(self.tr(
2999
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
774 'Move to the initial help screen'))
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
775 self.homeAct.setWhatsThis(self.tr(
2999
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
776 """<b>Home</b>"""
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
777 """<p>Moves to the initial screen.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
778 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
779 if not self.__initShortcutsOnly:
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3236
diff changeset
780 self.homeAct.triggered.connect(self.__home)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
781 self.__actions.append(self.homeAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
782
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
783 self.reloadAct = E5Action(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
784 self.tr('Reload'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
785 UI.PixmapCache.getIcon("reload.png"),
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
786 self.tr('&Reload'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
787 QKeySequence(self.tr("Ctrl+R", "Go|Reload")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
788 QKeySequence(self.tr("F5", "Go|Reload")),
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
789 self, 'webbrowser_go_reload')
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
790 self.reloadAct.setStatusTip(self.tr(
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
791 'Reload the current screen'))
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
792 self.reloadAct.setWhatsThis(self.tr(
2999
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
793 """<b>Reload</b>"""
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
794 """<p>Reloads the current screen.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
795 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
796 if not self.__initShortcutsOnly:
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3236
diff changeset
797 self.reloadAct.triggered.connect(self.__reload)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
798 self.__actions.append(self.reloadAct)
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
799 # TODO: add 'Reload bypassing cache' or use that for above
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
800
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
801 self.stopAct = E5Action(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
802 self.tr('Stop'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
803 UI.PixmapCache.getIcon("stopLoading.png"),
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
804 self.tr('&Stop'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
805 QKeySequence(self.tr("Ctrl+.", "Go|Stop")),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
806 QKeySequence(self.tr("Esc", "Go|Stop")),
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
807 self, 'webbrowser_go_stop')
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
808 self.stopAct.setStatusTip(self.tr('Stop loading'))
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
809 self.stopAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
810 """<b>Stop</b>"""
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
811 """<p>Stops loading of the current tab.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
812 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
813 if not self.__initShortcutsOnly:
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3236
diff changeset
814 self.stopAct.triggered.connect(self.__stopLoading)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
815 self.__actions.append(self.stopAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
816
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
817 self.copyAct = E5Action(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
818 self.tr('Copy'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
819 UI.PixmapCache.getIcon("editCopy.png"),
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
820 self.tr('&Copy'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
821 QKeySequence(self.tr("Ctrl+C", "Edit|Copy")),
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
822 0, self, 'webbrowser_edit_copy')
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
823 self.copyAct.setStatusTip(self.tr('Copy the selected text'))
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
824 self.copyAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
825 """<b>Copy</b>"""
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
826 """<p>Copy the selected text to the clipboard.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
827 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
828 if not self.__initShortcutsOnly:
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3236
diff changeset
829 self.copyAct.triggered.connect(self.__copy)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
830 self.__actions.append(self.copyAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
831
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
832 # TODO: add more editing actions: Cut, Paste, Undo, Redo, Select All
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
833
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
834 self.findAct = E5Action(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
835 self.tr('Find...'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
836 UI.PixmapCache.getIcon("find.png"),
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
837 self.tr('&Find...'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
838 QKeySequence(self.tr("Ctrl+F", "Edit|Find")),
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
839 0, self, 'webbrowser_edit_find')
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
840 self.findAct.setStatusTip(self.tr('Find text in page'))
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
841 self.findAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
842 """<b>Find</b>"""
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
843 """<p>Find text in the current page.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
844 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
845 if not self.__initShortcutsOnly:
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3236
diff changeset
846 self.findAct.triggered.connect(self.__find)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
847 self.__actions.append(self.findAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
848
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
849 self.findNextAct = E5Action(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
850 self.tr('Find next'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
851 UI.PixmapCache.getIcon("findNext.png"),
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
852 self.tr('Find &next'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
853 QKeySequence(self.tr("F3", "Edit|Find next")),
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
854 0, self, 'webbrowser_edit_find_next')
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
855 self.findNextAct.setStatusTip(self.tr(
2999
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
856 'Find next occurrence of text in page'))
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
857 self.findNextAct.setWhatsThis(self.tr(
2999
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
858 """<b>Find next</b>"""
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
859 """<p>Find the next occurrence of text in the current page.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
860 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
861 if not self.__initShortcutsOnly:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
862 self.findNextAct.triggered.connect(self.__searchWidget.findNext)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
863 self.__actions.append(self.findNextAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
864
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
865 self.findPrevAct = E5Action(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
866 self.tr('Find previous'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
867 UI.PixmapCache.getIcon("findPrev.png"),
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
868 self.tr('Find &previous'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
869 QKeySequence(self.tr("Shift+F3", "Edit|Find previous")),
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
870 0, self, 'webbrowser_edit_find_previous')
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 545
diff changeset
871 self.findPrevAct.setStatusTip(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
872 self.tr('Find previous occurrence of text in page'))
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
873 self.findPrevAct.setWhatsThis(self.tr(
2999
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
874 """<b>Find previous</b>"""
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
875 """<p>Find the previous occurrence of text in the current"""
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
876 """ page.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
877 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
878 if not self.__initShortcutsOnly:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
879 self.findPrevAct.triggered.connect(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
880 self.__searchWidget.findPrevious)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
881 self.__actions.append(self.findPrevAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
882
4715
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
883 # TODO: Bookmarks
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
884 ## self.bookmarksManageAct = E5Action(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
885 ## self.tr('Manage Bookmarks'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
886 ## self.tr('&Manage Bookmarks...'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
887 ## QKeySequence(self.tr("Ctrl+Shift+B", "Help|Manage bookmarks")),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
888 ## 0, self, 'webbrowser_bookmarks_manage')
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
889 ## self.bookmarksManageAct.setStatusTip(self.tr(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
890 ## 'Open a dialog to manage the bookmarks.'))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
891 ## self.bookmarksManageAct.setWhatsThis(self.tr(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
892 ## """<b>Manage Bookmarks...</b>"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
893 ## """<p>Open a dialog to manage the bookmarks.</p>"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
894 ## ))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
895 ## if not self.__initShortcutsOnly:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
896 ## self.bookmarksManageAct.triggered.connect(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
897 ## self.__showBookmarksDialog)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
898 ## self.__actions.append(self.bookmarksManageAct)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
899 ##
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
900 ## self.bookmarksAddAct = E5Action(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
901 ## self.tr('Add Bookmark'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
902 ## UI.PixmapCache.getIcon("addBookmark.png"),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
903 ## self.tr('Add &Bookmark...'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
904 ## QKeySequence(self.tr("Ctrl+D", "Help|Add bookmark")),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
905 ## 0, self, 'webbrowser_bookmark_add')
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
906 ## self.bookmarksAddAct.setIconVisibleInMenu(False)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
907 ## self.bookmarksAddAct.setStatusTip(self.tr(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
908 ## 'Open a dialog to add a bookmark.'))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
909 ## self.bookmarksAddAct.setWhatsThis(self.tr(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
910 ## """<b>Add Bookmark</b>"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
911 ## """<p>Open a dialog to add the current URL as a bookmark.</p>"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
912 ## ))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
913 ## if not self.__initShortcutsOnly:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
914 ## self.bookmarksAddAct.triggered.connect(self.__addBookmark)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
915 ## self.__actions.append(self.bookmarksAddAct)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
916 ##
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
917 ## self.bookmarksAddFolderAct = E5Action(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
918 ## self.tr('Add Folder'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
919 ## self.tr('Add &Folder...'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
920 ## 0, 0, self, 'webbrowser_bookmark_show_all')
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
921 ## self.bookmarksAddFolderAct.setStatusTip(self.tr(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
922 ## 'Open a dialog to add a new bookmarks folder.'))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
923 ## self.bookmarksAddFolderAct.setWhatsThis(self.tr(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
924 ## """<b>Add Folder...</b>"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
925 ## """<p>Open a dialog to add a new bookmarks folder.</p>"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
926 ## ))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
927 ## if not self.__initShortcutsOnly:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
928 ## self.bookmarksAddFolderAct.triggered.connect(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
929 ## self.__addBookmarkFolder)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
930 ## self.__actions.append(self.bookmarksAddFolderAct)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
931 ##
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
932 ## self.bookmarksAllTabsAct = E5Action(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
933 ## self.tr('Bookmark All Tabs'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
934 ## self.tr('Bookmark All Tabs...'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
935 ## 0, 0, self, 'webbrowser_bookmark_all_tabs')
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
936 ## self.bookmarksAllTabsAct.setStatusTip(self.tr(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
937 ## 'Bookmark all open tabs.'))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
938 ## self.bookmarksAllTabsAct.setWhatsThis(self.tr(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
939 ## """<b>Bookmark All Tabs...</b>"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
940 ## """<p>Open a dialog to add a new bookmarks folder for"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
941 ## """ all open tabs.</p>"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
942 ## ))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
943 ## if not self.__initShortcutsOnly:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
944 ## self.bookmarksAllTabsAct.triggered.connect(self.bookmarkAll)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
945 ## self.__actions.append(self.bookmarksAllTabsAct)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
946
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
947 self.whatsThisAct = E5Action(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
948 self.tr('What\'s This?'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
949 UI.PixmapCache.getIcon("whatsThis.png"),
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
950 self.tr('&What\'s This?'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
951 QKeySequence(self.tr("Shift+F1", "Help|What's This?'")),
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
952 0, self, 'webbrowser_help_whats_this')
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
953 self.whatsThisAct.setStatusTip(self.tr('Context sensitive help'))
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
954 self.whatsThisAct.setWhatsThis(self.tr(
2999
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
955 """<b>Display context sensitive help</b>"""
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
956 """<p>In What's This? mode, the mouse cursor shows an arrow"""
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
957 """ with a question mark, and you can click on the interface"""
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
958 """ elements to get a short description of what they do and how"""
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
959 """ to use them. In dialogs, this feature can be accessed using"""
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
960 """ the context help button in the titlebar.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
961 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
962 if not self.__initShortcutsOnly:
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3236
diff changeset
963 self.whatsThisAct.triggered.connect(self.__whatsThis)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
964 self.__actions.append(self.whatsThisAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
965
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
966 self.aboutAct = E5Action(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
967 self.tr('About'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
968 self.tr('&About'),
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
969 0, 0, self, 'webbrowser_help_about')
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
970 self.aboutAct.setStatusTip(self.tr(
2999
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
971 'Display information about this software'))
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
972 self.aboutAct.setWhatsThis(self.tr(
2999
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
973 """<b>About</b>"""
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
974 """<p>Display some information about this software.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
975 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
976 if not self.__initShortcutsOnly:
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3236
diff changeset
977 self.aboutAct.triggered.connect(self.__about)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
978 self.__actions.append(self.aboutAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
979
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
980 self.aboutQtAct = E5Action(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
981 self.tr('About Qt'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
982 self.tr('About &Qt'),
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
983 0, 0, self, 'webbrowser_help_about_qt')
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 545
diff changeset
984 self.aboutQtAct.setStatusTip(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
985 self.tr('Display information about the Qt toolkit'))
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
986 self.aboutQtAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
987 """<b>About Qt</b>"""
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
988 """<p>Display some information about the Qt toolkit.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
989 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
990 if not self.__initShortcutsOnly:
3345
071afe8be2a1 Changed signal/slot usage to not use constructs like 'triggered[()].connect(...)' anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3236
diff changeset
991 self.aboutQtAct.triggered.connect(self.__aboutQt)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
992 self.__actions.append(self.aboutQtAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
993
4715
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
994 self.zoomInAct = E5Action(
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
995 self.tr('Zoom in'),
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
996 UI.PixmapCache.getIcon("zoomIn.png"),
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
997 self.tr('Zoom &in'),
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
998 QKeySequence(self.tr("Ctrl++", "View|Zoom in")),
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
999 QKeySequence(self.tr("Zoom In", "View|Zoom in")),
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1000 self, 'webbrowser_view_zoom_in')
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1001 self.zoomInAct.setStatusTip(self.tr('Zoom in on the web page'))
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1002 self.zoomInAct.setWhatsThis(self.tr(
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1003 """<b>Zoom in</b>"""
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1004 """<p>Zoom in on the web page."""
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1005 """ This makes the web page bigger.</p>"""
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1006 ))
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1007 if not self.__initShortcutsOnly:
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1008 self.zoomInAct.triggered.connect(self.__zoomIn)
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1009 self.__actions.append(self.zoomInAct)
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1010
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1011 self.zoomOutAct = E5Action(
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1012 self.tr('Zoom out'),
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1013 UI.PixmapCache.getIcon("zoomOut.png"),
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1014 self.tr('Zoom &out'),
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1015 QKeySequence(self.tr("Ctrl+-", "View|Zoom out")),
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1016 QKeySequence(self.tr("Zoom Out", "View|Zoom out")),
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1017 self, 'webbrowser_view_zoom_out')
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1018 self.zoomOutAct.setStatusTip(self.tr('Zoom out on the web page'))
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1019 self.zoomOutAct.setWhatsThis(self.tr(
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1020 """<b>Zoom out</b>"""
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1021 """<p>Zoom out on the web page."""
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1022 """ This makes the web page smaller.</p>"""
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1023 ))
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1024 if not self.__initShortcutsOnly:
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1025 self.zoomOutAct.triggered.connect(self.__zoomOut)
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1026 self.__actions.append(self.zoomOutAct)
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1027
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1028 self.zoomResetAct = E5Action(
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1029 self.tr('Zoom reset'),
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1030 UI.PixmapCache.getIcon("zoomReset.png"),
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1031 self.tr('Zoom &reset'),
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1032 QKeySequence(self.tr("Ctrl+0", "View|Zoom reset")),
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1033 0, self, 'webbrowser_view_zoom_reset')
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1034 self.zoomResetAct.setStatusTip(self.tr(
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1035 'Reset the zoom of the web page'))
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1036 self.zoomResetAct.setWhatsThis(self.tr(
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1037 """<b>Zoom reset</b>"""
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1038 """<p>Reset the zoom of the web page. """
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1039 """This sets the zoom factor to 100%.</p>"""
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1040 ))
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1041 if not self.__initShortcutsOnly:
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1042 self.zoomResetAct.triggered.connect(self.__zoomReset)
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1043 self.__actions.append(self.zoomResetAct)
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
1044
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
1045 ## if hasattr(QWebSettings, 'ZoomTextOnly'):
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
1046 ## self.zoomTextOnlyAct = E5Action(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
1047 ## self.tr('Zoom text only'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
1048 ## self.tr('Zoom &text only'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
1049 ## 0, 0, self, 'webbrowser_view_zoom_text_only')
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
1050 ## self.zoomTextOnlyAct.setCheckable(True)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
1051 ## self.zoomTextOnlyAct.setStatusTip(self.tr(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
1052 ## 'Zoom text only; pictures remain constant'))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
1053 ## self.zoomTextOnlyAct.setWhatsThis(self.tr(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
1054 ## """<b>Zoom text only</b>"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
1055 ## """<p>Zoom text only; pictures remain constant.</p>"""
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
1056 ## ))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
1057 ## if not self.__initShortcutsOnly:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
1058 ## self.zoomTextOnlyAct.triggered[bool].connect(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
1059 ## self.__zoomTextOnly)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
1060 ## self.__actions.append(self.zoomTextOnlyAct)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
1061 ## else:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
1062 ## self.zoomTextOnlyAct = None
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1063
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1064 self.pageSourceAct = E5Action(
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1065 self.tr('Show page source'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1066 self.tr('Show page source'),
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
1067 QKeySequence(self.tr('Ctrl+U')), 0,
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
1068 self, 'webbrowser_show_page_source')
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().