WebBrowser/WebBrowserWindow.py

Sun, 01 May 2016 16:58:52 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 01 May 2016 16:58:52 +0200
changeset 4960
fb24ccb25ff5
parent 4958
ef400197e7d5
child 4964
a894e8c92369
permissions
-rw-r--r--

Finished getting rid of QML in the new 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
4773
cad470dfd807 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4769
diff changeset
17 import shutil
4788
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
18 import sys
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
20 from PyQt5.QtCore import pyqtSlot, pyqtSignal, Qt, QByteArray, QSize, QTimer, \
4913
e16573640cb8 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4910
diff changeset
21 QUrl, QTextCodec, QProcess, QEvent
e16573640cb8 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4910
diff changeset
22 from PyQt5.QtGui import QDesktopServices, QKeySequence, QFont, QFontMetrics
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
23 from PyQt5.QtWidgets import QWidget, QVBoxLayout, QSizePolicy, QDockWidget, \
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
24 QComboBox, QLabel, QSplitter, QMenu, QToolButton, QLineEdit, \
4335
a25c157625c4 Started implementing the VirusTotal APIv2 interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4332
diff changeset
25 QApplication, QWhatsThis, QDialog, QHBoxLayout, QProgressBar, QAction, \
a25c157625c4 Started implementing the VirusTotal APIv2 interface.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4332
diff changeset
26 QInputDialog
4725
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
27 from PyQt5.QtWebEngineWidgets import QWebEngineSettings, QWebEnginePage, \
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
28 QWebEngineProfile, QWebEngineScript
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
29 try:
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
30 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
31 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
32 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
33 QTHELP_AVAILABLE = False
4725
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
34
55
b5c84934de9c Renamed E4Gui to E5Gui.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 54
diff changeset
35 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
36 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
37 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
38 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
39 from E5Gui.E5ZoomWidget import E5ZoomWidget
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
40
4753
8d2ea02ed785 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4752
diff changeset
41 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
42
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43 import Preferences
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 from Preferences import Shortcuts
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
46 import Utilities
4795
6e0a26c633b2 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4792
diff changeset
47 import Globals
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
48
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
49 import UI.PixmapCache
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
50 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
51 from UI.Info import Version
4859
36c4b21c9f7b Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4858
diff changeset
52
36c4b21c9f7b Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4858
diff changeset
53 from .data import icons_rc # __IGNORE_WARNING__
4858
19dff9c9cf26 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4847
diff changeset
54 from .data import html_rc # __IGNORE_WARNING__
4745
285bfd224a1b Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4744
diff changeset
55 from .data import javascript_rc # __IGNORE_WARNING__
285bfd224a1b Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4744
diff changeset
56
4725
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
57
4774
2c6ffa778c3b Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4773
diff changeset
58 from .Tools import Scripts, WebBrowserTools, WebIconProvider
4726
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
59
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
60 from .ZoomManager import ZoomManager
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61
4788
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
62 from eric6config import getConfig
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
63
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
64
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
65 class WebBrowserWindow(E5MainWindow):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67 Class implementing the web browser main window.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
69 @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
70 @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
71 was changed
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 """
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
73 webBrowserClosed = pyqtSignal()
487
4d41d03d3d00 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 464
diff changeset
74
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
75 BrowserWindows = []
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
76
2192
61b3849df76d Changed a few places to use the new notification system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2149
diff changeset
77 _fromEric = False
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
78 UseQtHelp = QTHELP_AVAILABLE
4788
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
79 _isPrivate = False
2192
61b3849df76d Changed a few places to use the new notification system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2149
diff changeset
80
4744
ad3f6c1caf8d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4743
diff changeset
81 _webProfile = None
4725
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
82 _networkManager = None
4845
2d22ff71c005 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4826
diff changeset
83 _cookieJar = None
4875
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
84 _helpEngine = None
4732
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
85 _bookmarksManager = None
4734
ce0b1f024da9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4733
diff changeset
86 _historyManager = None
4743
f9e2e536d130 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4742
diff changeset
87 _passwordManager = None
4858
19dff9c9cf26 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4847
diff changeset
88 _adblockManager = None
4769
2b6f7e026cdc Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4767
diff changeset
89 _downloadManager = None
4758
c973eef8fef1 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4754
diff changeset
90 _feedsManager = None
4906
939ff20f712d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4905
diff changeset
91 _userAgentsManager = None
4774
2c6ffa778c3b Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4773
diff changeset
92 _syncManager = None
4868
985d275502c8 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4859
diff changeset
93 _speedDial = None
4752
a3bcc42a82a9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4751
diff changeset
94 _personalInformationManager = None
4767
0bace7c5ebc9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4759
diff changeset
95 _greaseMonkeyManager = None
2192
61b3849df76d Changed a few places to use the new notification system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2149
diff changeset
96 _notification = None
4742
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4741
diff changeset
97 _featurePermissionManager = None
4751
f745a556fd6f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4745
diff changeset
98 _flashCookieManager = None
4956
1496516b0f2c Finished implementing the image search functionality for the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4917
diff changeset
99 _imageSearchEngine = None
4958
ef400197e7d5 Implemented the auto scroller for the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4956
diff changeset
100 _autoScroller = None
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
102 def __init__(self, home, path, parent, name, fromEric=False,
4725
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
103 initShortcutsOnly=False, searchWord=None,
4875
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
104 private=False, qthelp=False, settingsDir=""):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106 Constructor
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 @param home the URL to be shown (string)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 @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
110 @param parent parent widget of this window (QWidget)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111 @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
112 @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
113 eric6 (boolean)
2999
28c75409a78f Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2831
diff changeset
114 @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
115 keyboard shortcuts (boolean)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
116 @keyparam searchWord word to search for (string)
4725
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
117 @keyparam private flag indicating a private browsing window (bool)
4875
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
118 @keyparam qthelp flag indicating to enable the QtHelp support (bool)
4788
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
119 @keyparam settingsDir directory to be used for the settings files (str)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
120 """
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
121 super(WebBrowserWindow, self).__init__(parent)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122 self.setObjectName(name)
3670
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3656
diff changeset
123 self.setWindowTitle(self.tr("eric6 Web Browser"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124
4788
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
125 self.__settingsDir = settingsDir
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
126 self.__fromEric = fromEric
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
127 WebBrowserWindow._fromEric = fromEric
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
128 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
129 self.setWindowIcon(UI.PixmapCache.getIcon("ericWeb.png"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
130
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
131 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
132 self.__lastConfigurationPageName = ""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
133
4788
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
134 WebBrowserWindow._isPrivate = private
4725
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
135
4728
0367675d783d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4727
diff changeset
136 self.__eventMouseButtons = Qt.NoButton
0367675d783d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4727
diff changeset
137 self.__eventKeyboardModifiers = Qt.NoModifier
0367675d783d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4727
diff changeset
138
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
139 if self.__initShortcutsOnly:
4907
1e3d61349671 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4906
diff changeset
140 WebBrowserWindow.setUseQtHelp(
1e3d61349671 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4906
diff changeset
141 self.__fromEric or qthelp or bool(searchWord))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
142 self.__initActions()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
143 else:
4782
4ad656e4ebec Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4780
diff changeset
144 if Preferences.getWebBrowser("WebInspectorEnabled"):
4ad656e4ebec Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4780
diff changeset
145 os.putenv(
4ad656e4ebec Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4780
diff changeset
146 "QTWEBENGINE_REMOTE_DEBUGGING",
4ad656e4ebec Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4780
diff changeset
147 str(Preferences.getWebBrowser("WebInspectorPort")))
4ad656e4ebec Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4780
diff changeset
148
4875
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
149 WebBrowserWindow.setUseQtHelp(
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
150 self.__fromEric or qthelp or bool(searchWord))
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
151
4744
ad3f6c1caf8d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4743
diff changeset
152 self.webProfile(private)
4826
aa752e6e9eba Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4825
diff changeset
153 self.networkManager()
4725
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
154
4884
6983af705a7f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4880
diff changeset
155 self.__htmlFullScreen = False
6983af705a7f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4880
diff changeset
156 self.__windowStates = 0
6983af705a7f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4880
diff changeset
157
2400
c1726b754f96 Started with delaying the import upon the time it is needed.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2361
diff changeset
158 from .SearchWidget import SearchWidget
4875
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
159 from .QtHelp.HelpTocWidget import HelpTocWidget
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
160 from .QtHelp.HelpIndexWidget import HelpIndexWidget
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
161 from .QtHelp.HelpSearchWidget import HelpSearchWidget
4715
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
162 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
163 from .WebBrowserTabWidget import WebBrowserTabWidget
4858
19dff9c9cf26 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4847
diff changeset
164 from .AdBlock.AdBlockIcon import AdBlockIcon
4753
8d2ea02ed785 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4752
diff changeset
165 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
166
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
167 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
168 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
169 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
170
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
171 # initialize some SSL stuff
4907
1e3d61349671 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4906
diff changeset
172 from E5Network.E5SslUtilities import initSSL
1e3d61349671 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4906
diff changeset
173 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
174
4875
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
175 if WebBrowserWindow.useQtHelp:
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
176 self.__helpEngine = QHelpEngine(
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
177 os.path.join(Utilities.getConfigDir(),
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
178 "web_browser", "eric6help.qhc"),
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
179 self)
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
180 self.__removeOldDocumentation()
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
181 self.__helpEngine.warning.connect(self.__warning)
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
182 else:
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
183 self.__helpEngine = None
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
184 self.__helpInstaller = None
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
185
4715
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
186 self.__zoomWidget = E5ZoomWidget(
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
187 UI.PixmapCache.getPixmap("zoomOut.png"),
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
188 UI.PixmapCache.getPixmap("zoomIn.png"),
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
189 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
190 self.statusBar().addPermanentWidget(self.__zoomWidget)
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
191 self.__zoomWidget.setMapping(
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
192 WebBrowserView.ZoomLevels, WebBrowserView.ZoomLevelDefault)
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
193 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
194
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
195 self.__tabWidget = WebBrowserTabWidget(self)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
196 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
197 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
198 self.__tabWidget.showMessage.connect(self.statusBar().showMessage)
4715
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
199 self.__tabWidget.browserZoomValueChanged.connect(
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
200 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
201
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
202 self.__searchWidget = SearchWidget(self, self)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
203 centralWidget = QWidget()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
204 layout = QVBoxLayout()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
205 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
206 layout.addWidget(self.__tabWidget)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
207 layout.addWidget(self.__searchWidget)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
208 self.__tabWidget.setSizePolicy(
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
209 QSizePolicy.Preferred, QSizePolicy.Expanding)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
210 centralWidget.setLayout(layout)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
211 self.setCentralWidget(centralWidget)
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
212 self.__searchWidget.hide()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
213
4875
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
214 if WebBrowserWindow.useQtHelp:
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
215 # setup the TOC widget
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
216 self.__tocWindow = HelpTocWidget(self.__helpEngine, self)
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
217 self.__tocDock = QDockWidget(self.tr("Contents"), self)
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
218 self.__tocDock.setObjectName("TocWindow")
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
219 self.__tocDock.setWidget(self.__tocWindow)
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
220 self.addDockWidget(Qt.LeftDockWidgetArea, self.__tocDock)
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
221
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
222 # setup the index widget
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
223 self.__indexWindow = HelpIndexWidget(self.__helpEngine, self)
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
224 self.__indexDock = QDockWidget(self.tr("Index"), self)
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
225 self.__indexDock.setObjectName("IndexWindow")
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
226 self.__indexDock.setWidget(self.__indexWindow)
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
227 self.addDockWidget(Qt.LeftDockWidgetArea, self.__indexDock)
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
228
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
229 # setup the search widget
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
230 self.__searchWord = searchWord
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
231 self.__indexing = False
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
232 self.__indexingProgress = None
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
233 self.__searchEngine = self.__helpEngine.searchEngine()
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
234 self.__searchEngine.indexingStarted.connect(
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
235 self.__indexingStarted)
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
236 self.__searchEngine.indexingFinished.connect(
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
237 self.__indexingFinished)
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
238 self.__searchWindow = HelpSearchWidget(
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
239 self.__searchEngine, self)
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
240 self.__searchDock = QDockWidget(self.tr("Search"), self)
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
241 self.__searchDock.setObjectName("SearchWindow")
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
242 self.__searchDock.setWidget(self.__searchWindow)
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
243 self.addDockWidget(Qt.LeftDockWidgetArea, self.__searchDock)
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
244
4822
f1b9899847dc Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4820
diff changeset
245 # JavaScript Console window
f1b9899847dc Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4820
diff changeset
246 from .WebBrowserJavaScriptConsole import \
f1b9899847dc Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4820
diff changeset
247 WebBrowserJavaScriptConsole
f1b9899847dc Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4820
diff changeset
248 self.__javascriptConsole = WebBrowserJavaScriptConsole(self)
f1b9899847dc Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4820
diff changeset
249 self.__javascriptConsoleDock = QDockWidget(
f1b9899847dc Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4820
diff changeset
250 self.tr("JavaScript Console"))
f1b9899847dc Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4820
diff changeset
251 self.__javascriptConsoleDock.setObjectName("JavascriptConsole")
f1b9899847dc Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4820
diff changeset
252 self.__javascriptConsoleDock.setAllowedAreas(
f1b9899847dc Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4820
diff changeset
253 Qt.BottomDockWidgetArea | Qt.TopDockWidgetArea)
f1b9899847dc Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4820
diff changeset
254 self.__javascriptConsoleDock.setWidget(self.__javascriptConsole)
f1b9899847dc Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4820
diff changeset
255 self.addDockWidget(Qt.BottomDockWidgetArea,
f1b9899847dc Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4820
diff changeset
256 self.__javascriptConsoleDock)
f1b9899847dc Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4820
diff changeset
257
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
258 if Preferences.getWebBrowser("SaveGeometry"):
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
259 g = Preferences.getGeometry("WebBrowserGeometry")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
260 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
261 g = QByteArray()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
262 if g.isEmpty():
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
263 s = QSize(800, 800)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
264 self.resize(s)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
265 else:
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
266 self.restoreGeometry(g)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
267
4758
c973eef8fef1 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4754
diff changeset
268 WebBrowserWindow.BrowserWindows.append(self)
c973eef8fef1 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4754
diff changeset
269
4726
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
270 self.__setIconDatabasePath()
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
271 self.__initWebEngineSettings()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
272
4767
0bace7c5ebc9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4759
diff changeset
273 # initialize some of our class objects
4744
ad3f6c1caf8d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4743
diff changeset
274 self.passwordManager()
4767
0bace7c5ebc9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4759
diff changeset
275 self.historyManager()
0bace7c5ebc9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4759
diff changeset
276 self.greaseMonkeyManager()
4744
ad3f6c1caf8d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4743
diff changeset
277
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
278 self.__initActions()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
279 self.__initMenus()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
280 self.__initToolbars()
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
281
4782
4ad656e4ebec Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4780
diff changeset
282 syncMgr = self.syncManager()
4ad656e4ebec Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4780
diff changeset
283 syncMgr.syncMessage.connect(self.statusBar().showMessage)
4ad656e4ebec Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4780
diff changeset
284 syncMgr.syncError.connect(self.statusBar().showMessage)
4753
8d2ea02ed785 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4752
diff changeset
285
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
286 self.__tabWidget.newBrowser(home)
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
287 self.__tabWidget.currentBrowser().setFocus()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
288
4858
19dff9c9cf26 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4847
diff changeset
289 self.__adBlockIcon = AdBlockIcon(self)
19dff9c9cf26 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4847
diff changeset
290 self.statusBar().addPermanentWidget(self.__adBlockIcon)
19dff9c9cf26 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4847
diff changeset
291 self.__adBlockIcon.setEnabled(
19dff9c9cf26 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4847
diff changeset
292 Preferences.getWebBrowser("AdBlockEnabled"))
19dff9c9cf26 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4847
diff changeset
293 self.__tabWidget.currentChanged[int].connect(
19dff9c9cf26 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4847
diff changeset
294 self.__adBlockIcon.currentChanged)
19dff9c9cf26 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4847
diff changeset
295 self.__tabWidget.sourceChanged.connect(
19dff9c9cf26 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4847
diff changeset
296 self.__adBlockIcon.sourceChanged)
19dff9c9cf26 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4847
diff changeset
297
4753
8d2ea02ed785 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4752
diff changeset
298 self.networkIcon = E5NetworkIcon(self)
8d2ea02ed785 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4752
diff changeset
299 self.statusBar().addPermanentWidget(self.networkIcon)
8d2ea02ed785 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4752
diff changeset
300
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
301 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
302 QDesktopServices.setUrlHandler("https", self.__linkActivated)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
303
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
304 # setup connections
2099
afde0e9110f7 Implemented guards against double activation of list entries.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2071
diff changeset
305 self.__activating = False
4875
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
306 if WebBrowserWindow.useQtHelp:
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
307 # TOC window
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
308 self.__tocWindow.linkActivated.connect(self.__linkActivated)
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
309 self.__tocWindow.escapePressed.connect(
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
310 self.__activateCurrentBrowser)
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
311 # index window
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
312 self.__indexWindow.linkActivated.connect(self.__linkActivated)
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
313 self.__indexWindow.linksActivated.connect(
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
314 self.__linksActivated)
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
315 self.__indexWindow.escapePressed.connect(
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
316 self.__activateCurrentBrowser)
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
317 # search window
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
318 self.__searchWindow.linkActivated.connect(
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
319 self.__linkActivated)
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
320 self.__searchWindow.escapePressed.connect(
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
321 self.__activateCurrentBrowser)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
322
4713
8dca047daf4b Continued with the web view.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4709
diff changeset
323 state = Preferences.getWebBrowser("WebBrowserState")
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
324 self.restoreState(state)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
325
4875
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
326 self.__initHelpDb()
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
327
4753
8d2ea02ed785 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4752
diff changeset
328 self.__virusTotal = VirusTotalAPI(self)
8d2ea02ed785 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4752
diff changeset
329 self.__virusTotal.submitUrlError.connect(
8d2ea02ed785 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4752
diff changeset
330 self.__virusTotalSubmitUrlError)
8d2ea02ed785 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4752
diff changeset
331 self.__virusTotal.urlScanReport.connect(
8d2ea02ed785 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4752
diff changeset
332 self.__virusTotalUrlScanReport)
8d2ea02ed785 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4752
diff changeset
333 self.__virusTotal.fileScanReport.connect(
8d2ea02ed785 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4752
diff changeset
334 self.__virusTotalFileScanReport)
8d2ea02ed785 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4752
diff changeset
335
2149
bd0bbb3043df Fixed a shutdown issue.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2101
diff changeset
336 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
337
4753
8d2ea02ed785 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4752
diff changeset
338 self.flashCookieManager()
8d2ea02ed785 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4752
diff changeset
339
4875
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
340 if WebBrowserWindow.useQtHelp:
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
341 QTimer.singleShot(0, self.__lookForNewDocumentation)
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
342 if self.__searchWord is not None:
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
343 QTimer.singleShot(0, self.__searchForWord)
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
344
4359
ac1dda9f3f19 Started adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4355
diff changeset
345 self.__lastActiveWindow = None
ac1dda9f3f19 Started adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4355
diff changeset
346 e5App().focusChanged[QWidget, QWidget].connect(
ac1dda9f3f19 Started adding code for a Flash cookie manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4355
diff changeset
347 self.__appFocusChanged)
4785
61c9b8004864 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4783
diff changeset
348
61c9b8004864 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4783
diff changeset
349 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
350
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
351 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
352 """
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
353 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
354
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
355 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
356 '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
357 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
358 """
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
359 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
360
4715
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
361 def fromEric(self):
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
362 """
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
363 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
364 eric IDE.
4726
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
365
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
366 @return flag indicating that the browserw as opened from within eric
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
367 @rtype bool
4715
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
368 """
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
369 return self.__fromEric
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
370
4726
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
371 def __setIconDatabasePath(self, enable=True):
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
372 """
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
373 Private method to set the favicons path.
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
374
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
375 @param enable flag indicating to enabled icon storage (boolean)
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
376 """
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
377 if enable:
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
378 iconDatabasePath = os.path.join(Utilities.getConfigDir(),
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
379 "web_browser", "favicons")
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
380 if not os.path.exists(iconDatabasePath):
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
381 os.makedirs(iconDatabasePath)
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
382 else:
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
383 iconDatabasePath = "" # setting an empty path disables it
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
384
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
385 WebIconProvider.instance().setIconDatabasePath(iconDatabasePath)
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
386
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
387 def __initWebEngineSettings(self):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
388 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
389 Private method to set the global web settings.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
390 """
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
391 settings = QWebEngineSettings.globalSettings()
4805
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
392
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
393 settings.setFontFamily(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
394 QWebEngineSettings.StandardFont,
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
395 Preferences.getWebBrowser("StandardFontFamily"))
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
396 settings.setFontFamily(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
397 QWebEngineSettings.FixedFont,
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
398 Preferences.getWebBrowser("FixedFontFamily"))
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
399 settings.setFontFamily(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
400 QWebEngineSettings.SerifFont,
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
401 Preferences.getWebBrowser("SerifFontFamily"))
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
402 settings.setFontFamily(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
403 QWebEngineSettings.SansSerifFont,
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
404 Preferences.getWebBrowser("SansSerifFontFamily"))
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
405 settings.setFontFamily(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
406 QWebEngineSettings.CursiveFont,
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
407 Preferences.getWebBrowser("CursiveFontFamily"))
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
408 settings.setFontFamily(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
409 QWebEngineSettings.FantasyFont,
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
410 Preferences.getWebBrowser("FantasyFontFamily"))
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
411
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
412 settings.setFontSize(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
413 QWebEngineSettings.DefaultFontSize,
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
414 Preferences.getWebBrowser("DefaultFontSize"))
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
415 settings.setFontSize(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
416 QWebEngineSettings.DefaultFixedFontSize,
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
417 Preferences.getWebBrowser("DefaultFixedFontSize"))
4725
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
418 settings.setFontSize(
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
419 QWebEngineSettings.MinimumFontSize,
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
420 Preferences.getWebBrowser("MinimumFontSize"))
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
421 settings.setFontSize(
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
422 QWebEngineSettings.MinimumLogicalFontSize,
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
423 Preferences.getWebBrowser("MinimumLogicalFontSize"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
424
4726
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
425 styleSheet = Preferences.getWebBrowser("UserStyleSheet")
4725
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
426 self.__setUserStyleSheet(styleSheet)
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
427
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
428 settings.setAttribute(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
429 QWebEngineSettings.AutoLoadImages,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
430 Preferences.getWebBrowser("AutoLoadImages"))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
431 settings.setAttribute(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
432 QWebEngineSettings.JavascriptEnabled,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
433 Preferences.getWebBrowser("JavaScriptEnabled"))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
434 settings.setAttribute(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
435 QWebEngineSettings.JavascriptCanOpenWindows,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
436 Preferences.getWebBrowser("JavaScriptCanOpenWindows"))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
437 settings.setAttribute(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
438 QWebEngineSettings.JavascriptCanAccessClipboard,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
439 Preferences.getWebBrowser("JavaScriptCanAccessClipboard"))
4886
b56735d36159 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4884
diff changeset
440 settings.setAttribute(
b56735d36159 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4884
diff changeset
441 QWebEngineSettings.PluginsEnabled,
b56735d36159 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4884
diff changeset
442 Preferences.getWebBrowser("PluginsEnabled"))
b56735d36159 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4884
diff changeset
443
4725
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
444 if self.isPrivate():
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
445 settings.setAttribute(
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
446 QWebEngineSettings.LocalStorageEnabled, False)
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
447 else:
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
448 settings.setAttribute(
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
449 QWebEngineSettings.LocalStorageEnabled,
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
450 Preferences.getWebBrowser("LocalStorageEnabled"))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
451 settings.setDefaultTextEncoding(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
452 Preferences.getWebBrowser("DefaultTextEncoding"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
453
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
454 settings.setAttribute(
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
455 QWebEngineSettings.SpatialNavigationEnabled,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
456 Preferences.getWebBrowser("SpatialNavigationEnabled"))
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
457 settings.setAttribute(
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
458 QWebEngineSettings.LinksIncludedInFocusChain,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
459 Preferences.getWebBrowser("LinksIncludedInFocusChain"))
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
460 settings.setAttribute(
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
461 QWebEngineSettings.LocalContentCanAccessRemoteUrls,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
462 Preferences.getWebBrowser("LocalContentCanAccessRemoteUrls"))
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
463 settings.setAttribute(
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
464 QWebEngineSettings.LocalContentCanAccessFileUrls,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
465 Preferences.getWebBrowser("LocalContentCanAccessFileUrls"))
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
466 settings.setAttribute(
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
467 QWebEngineSettings.XSSAuditingEnabled,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
468 Preferences.getWebBrowser("XSSAuditingEnabled"))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
469 settings.setAttribute(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
470 QWebEngineSettings.ScrollAnimatorEnabled,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
471 Preferences.getWebBrowser("ScrollAnimatorEnabled"))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
472 settings.setAttribute(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
473 QWebEngineSettings.ErrorPageEnabled,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
474 Preferences.getWebBrowser("ErrorPageEnabled"))
4884
6983af705a7f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4880
diff changeset
475 settings.setAttribute(
6983af705a7f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4880
diff changeset
476 QWebEngineSettings.FullScreenSupportEnabled,
6983af705a7f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4880
diff changeset
477 Preferences.getWebBrowser("FullScreenSupportEnabled"))
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
478
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
479 def __initActions(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
480 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
481 Private method to define the user interface actions.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
482 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
483 # list of all actions
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
484 self.__actions = []
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
485
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
486 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
487 self.tr('New Tab'),
638
265c31231d9d Did some refactoring of the web browser code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 637
diff changeset
488 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
489 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
490 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
491 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
492 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
493 self.newTabAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
494 """<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
495 """<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
496 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
497 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
498 self.newTabAct.triggered.connect(self.newTab)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
499 self.__actions.append(self.newTabAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
500
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
501 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
502 self.tr('New Window'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
503 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
504 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
505 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
506 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
507 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
508 self.newAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
509 """<b>New Window</b>"""
4788
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
510 """<p>This opens a new web browser window in the current"""
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
511 """ privacy mode.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
512 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
513 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
514 self.newAct.triggered.connect(self.newWindow)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
515 self.__actions.append(self.newAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
516
4788
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
517 self.newPrivateAct = E5Action(
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
518 self.tr('New Private Window'),
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
519 UI.PixmapCache.getIcon("privateMode.png"),
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
520 self.tr('New &Private Window'),
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
521 QKeySequence(self.tr("Ctrl+Shift+P", "File|New Private Window")),
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
522 0, self, 'webbrowser_file_new_private_window')
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
523 self.newPrivateAct.setStatusTip(self.tr(
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
524 'Open a new private web browser window'))
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
525 self.newPrivateAct.setWhatsThis(self.tr(
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
526 """<b>New Private Window</b>"""
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
527 """<p>This opens a new private web browser window by starting"""
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
528 """ a new web browser instance in private mode.</p>"""
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
529 ))
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
530 if not self.__initShortcutsOnly:
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
531 self.newPrivateAct.triggered.connect(self.newPrivateWindow)
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
532 self.__actions.append(self.newPrivateAct)
4731
67d861d9e492 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4728
diff changeset
533
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
534 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
535 self.tr('Open File'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
536 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
537 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
538 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
539 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
540 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
541 self.openAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
542 """<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
543 """<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
544 """ It pops up a file selection dialog.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
545 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
546 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
547 self.openAct.triggered.connect(self.__openFile)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
548 self.__actions.append(self.openAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
549
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
550 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
551 self.tr('Open File in New Tab'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
552 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
553 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
554 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
555 0, self, 'webbrowser_file_open_tab')
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 545
diff changeset
556 self.openTabAct.setStatusTip(
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
557 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
558 self.openTabAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
559 """<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
560 """<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
561 """ It pops up a file selection dialog.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
562 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
563 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
564 self.openTabAct.triggered.connect(self.__openFileNewTab)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
565 self.__actions.append(self.openTabAct)
4910
e97af1181efd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4908
diff changeset
566 # TODO: Qt 5.7: Save
4709
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.saveAsAct = 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 As'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
570 ## 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
571 ## self.tr('&Save As...'),
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
572 ## 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
573 ## 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
574 ## self.saveAsAct.setStatusTip(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
575 ## 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
576 ## 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
577 ## """<b>Save As...</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 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
579 ## ))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
580 ## if not self.__initShortcutsOnly:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
581 ## 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
582 ## 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
583 ##
4780
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
584 self.savePageScreenAct = E5Action(
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
585 self.tr('Save Page Screen'),
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
586 UI.PixmapCache.getIcon("fileSavePixmap.png"),
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
587 self.tr('Save Page Screen...'),
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
588 0, 0, self, 'webbrowser_file_save_page_screen')
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
589 self.savePageScreenAct.setStatusTip(
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
590 self.tr('Save the current page as a screen shot'))
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
591 self.savePageScreenAct.setWhatsThis(self.tr(
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
592 """<b>Save Page Screen...</b>"""
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
593 """<p>Saves the current page as a screen shot.</p>"""
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
594 ))
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
595 if not self.__initShortcutsOnly:
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
596 self.savePageScreenAct.triggered.connect(self.__savePageScreen)
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
597 self.__actions.append(self.savePageScreenAct)
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
598
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
599 self.saveVisiblePageScreenAct = E5Action(
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
600 self.tr('Save Visible Page Screen'),
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
601 UI.PixmapCache.getIcon("fileSaveVisiblePixmap.png"),
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
602 self.tr('Save Visible Page Screen...'),
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
603 0, 0, self, 'webbrowser_file_save_visible_page_screen')
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
604 self.saveVisiblePageScreenAct.setStatusTip(
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
605 self.tr('Save the visible part of the current page as a'
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
606 ' screen shot'))
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
607 self.saveVisiblePageScreenAct.setWhatsThis(self.tr(
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
608 """<b>Save Visible Page Screen...</b>"""
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
609 """<p>Saves the visible part of the current page as a"""
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
610 """ screen shot.</p>"""
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
611 ))
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
612 if not self.__initShortcutsOnly:
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
613 self.saveVisiblePageScreenAct.triggered.connect(
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
614 self.__saveVisiblePageScreen)
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
615 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
616
4732
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
617 bookmarksManager = self.bookmarksManager()
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
618 self.importBookmarksAct = E5Action(
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
619 self.tr('Import Bookmarks'),
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
620 self.tr('&Import Bookmarks...'),
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
621 0, 0, self, 'webbrowser_file_import_bookmarks')
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
622 self.importBookmarksAct.setStatusTip(
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
623 self.tr('Import bookmarks from other browsers'))
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
624 self.importBookmarksAct.setWhatsThis(self.tr(
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
625 """<b>Import Bookmarks</b>"""
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
626 """<p>Import bookmarks from other browsers.</p>"""
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
627 ))
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
628 if not self.__initShortcutsOnly:
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
629 self.importBookmarksAct.triggered.connect(
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
630 bookmarksManager.importBookmarks)
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
631 self.__actions.append(self.importBookmarksAct)
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
632
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
633 self.exportBookmarksAct = E5Action(
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
634 self.tr('Export Bookmarks'),
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
635 self.tr('&Export Bookmarks...'),
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
636 0, 0, self, 'webbrowser_file_export_bookmarks')
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
637 self.exportBookmarksAct.setStatusTip(
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
638 self.tr('Export the bookmarks into a file'))
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
639 self.exportBookmarksAct.setWhatsThis(self.tr(
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
640 """<b>Export Bookmarks</b>"""
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
641 """<p>Export the bookmarks into a file.</p>"""
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
642 ))
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
643 if not self.__initShortcutsOnly:
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
644 self.exportBookmarksAct.triggered.connect(
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
645 bookmarksManager.exportBookmarks)
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
646 self.__actions.append(self.exportBookmarksAct)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
647
4792
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
648 self.printAct = E5Action(
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
649 self.tr('Print'),
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
650 UI.PixmapCache.getIcon("print.png"),
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
651 self.tr('&Print'),
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
652 QKeySequence(self.tr("Ctrl+P", "File|Print")),
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
653 0, self, 'webbrowser_file_print')
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
654 self.printAct.setStatusTip(self.tr('Print the displayed help'))
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
655 self.printAct.setWhatsThis(self.tr(
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
656 """<b>Print</b>"""
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
657 """<p>Print the displayed help text.</p>"""
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
658 ))
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
659 if not self.__initShortcutsOnly:
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
660 self.printAct.triggered.connect(self.__tabWidget.printBrowser)
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
661 self.__actions.append(self.printAct)
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
662
4795
6e0a26c633b2 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4792
diff changeset
663 if Globals.isLinuxPlatform():
6e0a26c633b2 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4792
diff changeset
664 self.printPdfAct = E5Action(
6e0a26c633b2 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4792
diff changeset
665 self.tr('Print as PDF'),
6e0a26c633b2 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4792
diff changeset
666 UI.PixmapCache.getIcon("printPdf.png"),
6e0a26c633b2 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4792
diff changeset
667 self.tr('Print as PDF'),
6e0a26c633b2 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4792
diff changeset
668 0, 0, self, 'webbrowser_file_print_pdf')
6e0a26c633b2 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4792
diff changeset
669 self.printPdfAct.setStatusTip(self.tr(
6e0a26c633b2 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4792
diff changeset
670 'Print the displayed help as PDF'))
6e0a26c633b2 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4792
diff changeset
671 self.printPdfAct.setWhatsThis(self.tr(
6e0a26c633b2 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4792
diff changeset
672 """<b>Print as PDF</b>"""
6e0a26c633b2 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4792
diff changeset
673 """<p>Print the displayed help text as a PDF file.</p>"""
6e0a26c633b2 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4792
diff changeset
674 ))
6e0a26c633b2 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4792
diff changeset
675 if not self.__initShortcutsOnly:
6e0a26c633b2 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4792
diff changeset
676 self.printPdfAct.triggered.connect(
6e0a26c633b2 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4792
diff changeset
677 self.__tabWidget.printBrowserPdf)
6e0a26c633b2 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4792
diff changeset
678 self.__actions.append(self.printPdfAct)
6e0a26c633b2 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4792
diff changeset
679 else:
6e0a26c633b2 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4792
diff changeset
680 self.printPdfAct = None
4792
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
681
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
682 self.printPreviewAct = E5Action(
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
683 self.tr('Print Preview'),
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
684 UI.PixmapCache.getIcon("printPreview.png"),
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
685 self.tr('Print Preview'),
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
686 0, 0, self, 'webbrowser_file_print_preview')
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
687 self.printPreviewAct.setStatusTip(self.tr(
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
688 'Print preview of the displayed help'))
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
689 self.printPreviewAct.setWhatsThis(self.tr(
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
690 """<b>Print Preview</b>"""
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
691 """<p>Print preview of the displayed help text.</p>"""
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
692 ))
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
693 if not self.__initShortcutsOnly:
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
694 self.printPreviewAct.triggered.connect(
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
695 self.__tabWidget.printPreviewBrowser)
f55fa7eb3cf3 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4791
diff changeset
696 self.__actions.append(self.printPreviewAct)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
697
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
698 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
699 self.tr('Close'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
700 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
701 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
702 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
703 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
704 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
705 '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
706 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
707 """<b>Close</b>"""
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
708 """<p>Closes the current web browser window.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
709 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
710 if not self.__initShortcutsOnly:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
711 self.closeAct.triggered.connect(self.__tabWidget.closeBrowser)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
712 self.__actions.append(self.closeAct)
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.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
715 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
716 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
717 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
718 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
719 self.closeAllAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
720 """<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
721 """<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
722 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
723 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
724 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
725 self.__tabWidget.closeAllBrowsers)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
726 self.__actions.append(self.closeAllAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
727
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
728 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
729 self.tr('Quit'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
730 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
731 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
732 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
733 0, self, 'webbrowser_file_quit')
3670
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3656
diff changeset
734 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
735 self.exitAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
736 """<b>Quit</b>"""
3670
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3656
diff changeset
737 """<p>Quit the eric6 Web Browser.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
738 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
739 if not self.__initShortcutsOnly:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
740 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
741 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
742 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
743 self.exitAct.triggered.connect(self.__closeAllWindows)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
744 self.__actions.append(self.exitAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
745
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
746 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
747 self.tr('Backward'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
748 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
749 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
750 QKeySequence(self.tr("Alt+Left", "Go|Backward")),
4884
6983af705a7f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4880
diff changeset
751 0, self, 'webbrowser_go_backward')
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
752 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
753 self.backAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
754 """<b>Backward</b>"""
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
755 """<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
756 """ available, this action is disabled.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
757 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
758 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
759 self.backAct.triggered.connect(self.__backward)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
760 self.__actions.append(self.backAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
761
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
762 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
763 self.tr('Forward'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
764 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
765 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
766 QKeySequence(self.tr("Alt+Right", "Go|Forward")),
4884
6983af705a7f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4880
diff changeset
767 0, 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
768 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
769 '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
770 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
771 """<b>Forward</b>"""
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
772 """<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
773 """ available, this action is disabled.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
774 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
775 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
776 self.forwardAct.triggered.connect(self.__forward)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
777 self.__actions.append(self.forwardAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
778
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
779 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
780 self.tr('Home'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
781 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
782 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
783 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
784 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
785 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
786 '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
787 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
788 """<b>Home</b>"""
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
789 """<p>Moves to the initial screen.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
790 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
791 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
792 self.homeAct.triggered.connect(self.__home)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
793 self.__actions.append(self.homeAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
794
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
795 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
796 self.tr('Reload'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
797 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
798 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
799 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
800 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
801 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
802 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
803 '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
804 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
805 """<b>Reload</b>"""
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
806 """<p>Reloads the current screen.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
807 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
808 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
809 self.reloadAct.triggered.connect(self.__reload)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
810 self.__actions.append(self.reloadAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
811
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
812 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
813 self.tr('Stop'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
814 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
815 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
816 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
817 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
818 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
819 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
820 self.stopAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
821 """<b>Stop</b>"""
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
822 """<p>Stops loading of the current tab.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
823 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
824 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
825 self.stopAct.triggered.connect(self.__stopLoading)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
826 self.__actions.append(self.stopAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
827
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
828 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
829 self.tr('Copy'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
830 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
831 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
832 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
833 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
834 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
835 self.copyAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
836 """<b>Copy</b>"""
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
837 """<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
838 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
839 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
840 self.copyAct.triggered.connect(self.__copy)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
841 self.__actions.append(self.copyAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
842
4727
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
843 self.cutAct = E5Action(
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
844 self.tr('Cut'),
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
845 UI.PixmapCache.getIcon("editCut.png"),
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
846 self.tr('Cu&t'),
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
847 QKeySequence(self.tr("Ctrl+X", "Edit|Cut")),
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
848 0, self, 'webbrowser_edit_cut')
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
849 self.cutAct.setStatusTip(self.tr('Cut the selected text'))
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
850 self.cutAct.setWhatsThis(self.tr(
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
851 """<b>Cut</b>"""
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
852 """<p>Cut the selected text to the clipboard.</p>"""
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
853 ))
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
854 if not self.__initShortcutsOnly:
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
855 self.cutAct.triggered.connect(self.__cut)
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
856 self.__actions.append(self.cutAct)
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
857
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
858 self.pasteAct = E5Action(
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
859 self.tr('Paste'),
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
860 UI.PixmapCache.getIcon("editPaste.png"),
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
861 self.tr('&Paste'),
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
862 QKeySequence(self.tr("Ctrl+V", "Edit|Paste")),
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
863 0, self, 'webbrowser_edit_paste')
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
864 self.pasteAct.setStatusTip(self.tr('Paste text from the clipboard'))
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
865 self.pasteAct.setWhatsThis(self.tr(
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
866 """<b>Paste</b>"""
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
867 """<p>Paste some text from the clipboard.</p>"""
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
868 ))
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
869 if not self.__initShortcutsOnly:
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
870 self.pasteAct.triggered.connect(self.__paste)
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
871 self.__actions.append(self.pasteAct)
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
872
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
873 self.undoAct = E5Action(
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
874 self.tr('Undo'),
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
875 UI.PixmapCache.getIcon("editUndo.png"),
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
876 self.tr('&Undo'),
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
877 QKeySequence(self.tr("Ctrl+Z", "Edit|Undo")),
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
878 0, self, 'webbrowser_edit_undo')
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
879 self.undoAct.setStatusTip(self.tr('Undo the last edit action'))
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
880 self.undoAct.setWhatsThis(self.tr(
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
881 """<b>Undo</b>"""
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
882 """<p>Undo the last edit action.</p>"""
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
883 ))
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
884 if not self.__initShortcutsOnly:
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
885 self.undoAct.triggered.connect(self.__undo)
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
886 self.__actions.append(self.undoAct)
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
887
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
888 self.redoAct = E5Action(
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
889 self.tr('Redo'),
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
890 UI.PixmapCache.getIcon("editRedo.png"),
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
891 self.tr('&Redo'),
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
892 QKeySequence(self.tr("Ctrl+Shift+Z", "Edit|Redo")),
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
893 0, self, 'webbrowser_edit_redo')
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
894 self.redoAct.setStatusTip(self.tr('Redo the last edit action'))
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
895 self.redoAct.setWhatsThis(self.tr(
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
896 """<b>Redo</b>"""
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
897 """<p>Redo the last edit action.</p>"""
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
898 ))
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
899 if not self.__initShortcutsOnly:
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
900 self.redoAct.triggered.connect(self.__redo)
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
901 self.__actions.append(self.redoAct)
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
902
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
903 self.selectAllAct = E5Action(
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
904 self.tr('Select All'),
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
905 UI.PixmapCache.getIcon("editSelectAll.png"),
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
906 self.tr('&Select All'),
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
907 QKeySequence(self.tr("Ctrl+A", "Edit|Select All")),
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
908 0, self, 'webbrowser_edit_select_all')
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
909 self.selectAllAct.setStatusTip(self.tr('Select all text'))
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
910 self.selectAllAct.setWhatsThis(self.tr(
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
911 """<b>Select All</b>"""
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
912 """<p>Select all text of the current browser.</p>"""
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
913 ))
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
914 if not self.__initShortcutsOnly:
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
915 self.selectAllAct.triggered.connect(self.__selectAll)
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
916 self.__actions.append(self.selectAllAct)
62b50a24fb59 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4726
diff changeset
917
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
918 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
919 self.tr('Find...'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
920 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
921 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
922 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
923 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
924 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
925 self.findAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
926 """<b>Find</b>"""
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
927 """<p>Find text in the current page.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
928 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
929 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
930 self.findAct.triggered.connect(self.__find)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
931 self.__actions.append(self.findAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
932
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
933 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
934 self.tr('Find next'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
935 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
936 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
937 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
938 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
939 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
940 '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
941 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
942 """<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
943 """<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
944 ))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
945 if not self.__initShortcutsOnly:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
946 self.findNextAct.triggered.connect(self.__searchWidget.findNext)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
947 self.__actions.append(self.findNextAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
948
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
949 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
950 self.tr('Find previous'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
951 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
952 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
953 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
954 0, self, 'webbrowser_edit_find_previous')
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 545
diff changeset
955 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
956 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
957 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
958 """<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
959 """<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
960 """ page.</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:
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
963 self.findPrevAct.triggered.connect(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
964 self.__searchWidget.findPrevious)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
965 self.__actions.append(self.findPrevAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
966
4732
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
967 self.bookmarksManageAct = E5Action(
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
968 self.tr('Manage Bookmarks'),
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
969 self.tr('&Manage Bookmarks...'),
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
970 QKeySequence(self.tr("Ctrl+Shift+B", "Help|Manage bookmarks")),
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
971 0, self, 'webbrowser_bookmarks_manage')
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
972 self.bookmarksManageAct.setStatusTip(self.tr(
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
973 'Open a dialog to manage the bookmarks.'))
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
974 self.bookmarksManageAct.setWhatsThis(self.tr(
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
975 """<b>Manage Bookmarks...</b>"""
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
976 """<p>Open a dialog to manage the bookmarks.</p>"""
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
977 ))
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
978 if not self.__initShortcutsOnly:
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
979 self.bookmarksManageAct.triggered.connect(
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
980 self.__showBookmarksDialog)
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
981 self.__actions.append(self.bookmarksManageAct)
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
982
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
983 self.bookmarksAddAct = E5Action(
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
984 self.tr('Add Bookmark'),
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
985 UI.PixmapCache.getIcon("addBookmark.png"),
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
986 self.tr('Add &Bookmark...'),
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
987 QKeySequence(self.tr("Ctrl+D", "Help|Add bookmark")),
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
988 0, self, 'webbrowser_bookmark_add')
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
989 self.bookmarksAddAct.setIconVisibleInMenu(False)
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
990 self.bookmarksAddAct.setStatusTip(self.tr(
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
991 'Open a dialog to add a bookmark.'))
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
992 self.bookmarksAddAct.setWhatsThis(self.tr(
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
993 """<b>Add Bookmark</b>"""
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
994 """<p>Open a dialog to add the current URL as a bookmark.</p>"""
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
995 ))
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
996 if not self.__initShortcutsOnly:
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
997 self.bookmarksAddAct.triggered.connect(self.__addBookmark)
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
998 self.__actions.append(self.bookmarksAddAct)
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
999
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
1000 self.bookmarksAddFolderAct = E5Action(
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
1001 self.tr('Add Folder'),
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
1002 self.tr('Add &Folder...'),
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
1003 0, 0, self, 'webbrowser_bookmark_show_all')
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
1004 self.bookmarksAddFolderAct.setStatusTip(self.tr(
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
1005 'Open a dialog to add a new bookmarks folder.'))
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
1006 self.bookmarksAddFolderAct.setWhatsThis(self.tr(
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
1007 """<b>Add Folder...</b>"""
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
1008 """<p>Open a dialog to add a new bookmarks folder.</p>"""
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
1009 ))
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
1010 if not self.__initShortcutsOnly:
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
1011 self.bookmarksAddFolderAct.triggered.connect(
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
1012 self.__addBookmarkFolder)
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
1013 self.__actions.append(self.bookmarksAddFolderAct)
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
1014
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
1015 self.bookmarksAllTabsAct = E5Action(
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
1016 self.tr('Bookmark All Tabs'),
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
1017 self.tr('Bookmark All Tabs...'),
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
1018 0, 0, self, 'webbrowser_bookmark_all_tabs')
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
1019 self.bookmarksAllTabsAct.setStatusTip(self.tr(
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
1020 'Bookmark all open tabs.'))
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
1021 self.bookmarksAllTabsAct.setWhatsThis(self.tr(
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
1022 """<b>Bookmark All Tabs...</b>"""
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
1023 """<p>Open a dialog to add a new bookmarks folder for"""
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
1024 """ all open tabs.</p>"""
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
1025 ))
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
1026 if not self.__initShortcutsOnly:
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
1027 self.bookmarksAllTabsAct.triggered.connect(self.bookmarkAll)
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
1028 self.__actions.append(self.bookmarksAllTabsAct)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1029
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1030 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
1031 self.tr('What\'s This?'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1032 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
1033 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
1034 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
1035 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
1036 self.whatsThisAct.setStatusTip(self.tr('Context sensitive help'))
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbac