eric6/WebBrowser/WebBrowserWindow.py

Tue, 10 Sep 2019 19:30:07 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 10 Sep 2019 19:30:07 +0200
changeset 7229
53054eb5b15a
parent 7201
6b42677d7043
child 7231
0dcb92a9687d
permissions
-rw-r--r--

Removed obsolete "from __future__ import ..." statements.

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
6645
ad476851d7e0 Updated copyright for 2019.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6634
diff changeset
3 # Copyright (c) 2002 - 2019 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
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
10
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11 import os
4773
cad470dfd807 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4769
diff changeset
12 import shutil
4788
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
13 import sys
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
15 from PyQt5.QtCore import pyqtSlot, pyqtSignal, Qt, QByteArray, QSize, QTimer, \
6627
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
16 QUrl, QTextCodec, QProcess, QEvent, QFileInfo
5001
08eaee907686 Prepared the QWebEingine based web browser for the new runJavaScript() method as of Qt 5.7.0.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4993
diff changeset
17 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
18 from PyQt5.QtWidgets import QWidget, QVBoxLayout, QSizePolicy, QDockWidget, \
6155
ae44225e7e7c PageScreen: Removed the action to save the whole web page as a screenshot because it is not supported by QWebEngine (and probably will not in the foreseeable future).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6151
diff changeset
19 QComboBox, QLabel, QMenu, QLineEdit, QApplication, \
5745
4f4316e83318 -- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5740
diff changeset
20 QWhatsThis, QDialog, QHBoxLayout, QProgressBar, QInputDialog, QAction
4725
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
21 from PyQt5.QtWebEngineWidgets import QWebEngineSettings, QWebEnginePage, \
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
22 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
23 try:
3656
441956d8fce5 Started porting eric5 to PyQt5.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3591
diff changeset
24 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
25 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
26 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
27 QTHELP_AVAILABLE = False
4725
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
28
55
b5c84934de9c Renamed E4Gui to E5Gui.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 54
diff changeset
29 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
30 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
31 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
32 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
33 from E5Gui.E5ZoomWidget import E5ZoomWidget
79009bc4acd5 Continued getting the basic web browser functions going.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4713
diff changeset
34
4753
8d2ea02ed785 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4752
diff changeset
35 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
36
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 import Preferences
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 from Preferences import Shortcuts
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
40 import Utilities
4795
6e0a26c633b2 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4792
diff changeset
41 import Globals
5736
000ea446ff4b Prepared the code for Qt > 5.9.99.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5734
diff changeset
42 from Globals import qVersionTuple
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
43
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 import UI.PixmapCache
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
45 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
46 from UI.Info import Version
4859
36c4b21c9f7b Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4858
diff changeset
47
36c4b21c9f7b Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4858
diff changeset
48 from .data import icons_rc # __IGNORE_WARNING__
4858
19dff9c9cf26 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4847
diff changeset
49 from .data import html_rc # __IGNORE_WARNING__
4745
285bfd224a1b Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4744
diff changeset
50 from .data import javascript_rc # __IGNORE_WARNING__
285bfd224a1b Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4744
diff changeset
51
4725
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
52
4774
2c6ffa778c3b Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4773
diff changeset
53 from .Tools import Scripts, WebBrowserTools, WebIconProvider
4726
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
54
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
55 from .ZoomManager import ZoomManager
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56
6623
c0882a599e18 WebBrowser: added single application mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6413
diff changeset
57 from .WebBrowserSingleApplication import WebBrowserSingleApplicationServer
c0882a599e18 WebBrowser: added single application mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6413
diff changeset
58
4788
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
59 from eric6config import getConfig
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
60
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 934
diff changeset
61
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
62 class WebBrowserWindow(E5MainWindow):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 Class implementing the web browser main window.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65
4979
7ac0959842f9 Added a tab manager window to the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4967
diff changeset
66 @signal webBrowserWindowOpened(window) emitted after a new web browser
7ac0959842f9 Added a tab manager window to the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4967
diff changeset
67 window was opened
7ac0959842f9 Added a tab manager window to the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4967
diff changeset
68 @signal webBrowserWindowClosed(window) emitted after the window was
7ac0959842f9 Added a tab manager window to the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4967
diff changeset
69 requested to close
7ac0959842f9 Added a tab manager window to the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4967
diff changeset
70 @signal webBrowserOpened(browser) emitted after a new web browser tab was
7ac0959842f9 Added a tab manager window to the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4967
diff changeset
71 created
7ac0959842f9 Added a tab manager window to the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4967
diff changeset
72 @signal webBrowserClosed(browser) emitted after a web browser tab was
7ac0959842f9 Added a tab manager window to the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4967
diff changeset
73 closed
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
74 """
4979
7ac0959842f9 Added a tab manager window to the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4967
diff changeset
75 webBrowserWindowClosed = pyqtSignal(E5MainWindow)
7ac0959842f9 Added a tab manager window to the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4967
diff changeset
76 webBrowserWindowOpened = pyqtSignal(E5MainWindow)
7ac0959842f9 Added a tab manager window to the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4967
diff changeset
77 webBrowserOpened = pyqtSignal(QWidget)
7ac0959842f9 Added a tab manager window to the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4967
diff changeset
78 webBrowserClosed = pyqtSignal(QWidget)
487
4d41d03d3d00 Continued porting signal/slot usage to the new API.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 464
diff changeset
79
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
80 BrowserWindows = []
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81
5224
7454861e4106 Corrected a bug using a class variable, harmonized the code and moved the QtHelp stuff to a separate directory so the files can be used from both variants.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5200
diff changeset
82 _useQtHelp = QTHELP_AVAILABLE
4788
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
83 _isPrivate = False
2192
61b3849df76d Changed a few places to use the new notification system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2149
diff changeset
84
4744
ad3f6c1caf8d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4743
diff changeset
85 _webProfile = None
4725
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
86 _networkManager = None
4845
2d22ff71c005 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4826
diff changeset
87 _cookieJar = None
4875
4ee26909ac0d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4868
diff changeset
88 _helpEngine = None
4732
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
89 _bookmarksManager = None
4734
ce0b1f024da9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4733
diff changeset
90 _historyManager = None
4743
f9e2e536d130 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4742
diff changeset
91 _passwordManager = None
4858
19dff9c9cf26 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4847
diff changeset
92 _adblockManager = None
4769
2b6f7e026cdc Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4767
diff changeset
93 _downloadManager = None
4758
c973eef8fef1 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4754
diff changeset
94 _feedsManager = None
4906
939ff20f712d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4905
diff changeset
95 _userAgentsManager = None
4774
2c6ffa778c3b Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4773
diff changeset
96 _syncManager = None
4868
985d275502c8 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4859
diff changeset
97 _speedDial = None
4752
a3bcc42a82a9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4751
diff changeset
98 _personalInformationManager = None
4767
0bace7c5ebc9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4759
diff changeset
99 _greaseMonkeyManager = None
2192
61b3849df76d Changed a few places to use the new notification system.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2149
diff changeset
100 _notification = None
4742
f9d1090f6ab9 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4741
diff changeset
101 _featurePermissionManager = None
4751
f745a556fd6f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4745
diff changeset
102 _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
103 _imageSearchEngine = None
4958
ef400197e7d5 Implemented the auto scroller for the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4956
diff changeset
104 _autoScroller = None
4979
7ac0959842f9 Added a tab manager window to the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4967
diff changeset
105 _tabManager = None
5777
2c4441d65ee3 Continued implementing session support for the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5768
diff changeset
106 _sessionManager = None
5820
b610cb5b501a Started implementing the safe browsing manager and management dialog.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5793
diff changeset
107 _safeBrowsingManager = None
6695
0a51887c13cd Web Browser (NG):
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6657
diff changeset
108 _protocolHandlerManager = None
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109
5783
44a9f08de394 Continued implementing session support for the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5782
diff changeset
110 _performingStartup = True
5779
b53fabc86f3c Continued implementing session support for the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5777
diff changeset
111 _performingShutdown = False
5782
60874802161b Continued implementing session support for the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5780
diff changeset
112 _lastActiveWindow = None
5779
b53fabc86f3c Continued implementing session support for the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5777
diff changeset
113
6625
a67fee7bc09c Web Browser: changed the web browser logic inside eric to use a remote controlled web browser process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6623
diff changeset
114 def __init__(self, home, path, parent, name,
6627
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
115 searchWord=None, private=False, qthelp=False, settingsDir="",
6625
a67fee7bc09c Web Browser: changed the web browser logic inside eric to use a remote controlled web browser process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6623
diff changeset
116 restoreSession=False, single=False, saname=""):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118 Constructor
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119
5780
79d06c98c5c9 Continued implementing session support for the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5779
diff changeset
120 @param home the URL to be shown
79d06c98c5c9 Continued implementing session support for the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5779
diff changeset
121 @type str
79d06c98c5c9 Continued implementing session support for the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5779
diff changeset
122 @param path the path of the working dir (usually '.')
79d06c98c5c9 Continued implementing session support for the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5779
diff changeset
123 @type str
79d06c98c5c9 Continued implementing session support for the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5779
diff changeset
124 @param parent parent widget of this window
79d06c98c5c9 Continued implementing session support for the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5779
diff changeset
125 @type QWidget
79d06c98c5c9 Continued implementing session support for the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5779
diff changeset
126 @param name name of this window
79d06c98c5c9 Continued implementing session support for the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5779
diff changeset
127 @type str
6630
bddd12f27a4c Web Browser (QtWebKit): applied the changes of the new Web Brwoser to the QtWebKit based variant.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6627
diff changeset
128 @param searchWord word to search for
5780
79d06c98c5c9 Continued implementing session support for the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5779
diff changeset
129 @type str
6630
bddd12f27a4c Web Browser (QtWebKit): applied the changes of the new Web Brwoser to the QtWebKit based variant.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6627
diff changeset
130 @param private flag indicating a private browsing window
5780
79d06c98c5c9 Continued implementing session support for the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5779
diff changeset
131 @type bool
6630
bddd12f27a4c Web Browser (QtWebKit): applied the changes of the new Web Brwoser to the QtWebKit based variant.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6627
diff changeset
132 @param qthelp flag indicating to enable the QtHelp support
5780
79d06c98c5c9 Continued implementing session support for the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5779
diff changeset
133 @type bool
6630
bddd12f27a4c Web Browser (QtWebKit): applied the changes of the new Web Brwoser to the QtWebKit based variant.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6627
diff changeset
134 @param settingsDir directory to be used for the settings files
5780
79d06c98c5c9 Continued implementing session support for the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5779
diff changeset
135 @type str
6630
bddd12f27a4c Web Browser (QtWebKit): applied the changes of the new Web Brwoser to the QtWebKit based variant.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6627
diff changeset
136 @param restoreSession flag indicating a restore session action
5780
79d06c98c5c9 Continued implementing session support for the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5779
diff changeset
137 @type bool
6623
c0882a599e18 WebBrowser: added single application mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6413
diff changeset
138 @param single flag indicating to start in single application mode
c0882a599e18 WebBrowser: added single application mode.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6413
diff changeset
139 @type bool
6625
a67fee7bc09c Web Browser: changed the web browser logic inside eric to use a remote controlled web browser process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6623
diff changeset
140 @param saname name to be used for the single application server
a67fee7bc09c Web Browser: changed the web browser logic inside eric to use a remote controlled web browser process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6623
diff changeset
141 @type str
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
142 """
5721
b4d0cddecd64 Improved the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5627
diff changeset
143 self.__hideNavigationTimer = None
b4d0cddecd64 Improved the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5627
diff changeset
144
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
145 super(WebBrowserWindow, self).__init__(parent)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
146 self.setObjectName(name)
5015
ca1d44f0f6b2 Enhanced the new web browser by adding a visit count to the bookmarks.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5001
diff changeset
147 if private:
ca1d44f0f6b2 Enhanced the new web browser by adding a visit count to the bookmarks.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5001
diff changeset
148 self.setWindowTitle(self.tr("eric6 Web Browser (Private Mode)"))
ca1d44f0f6b2 Enhanced the new web browser by adding a visit count to the bookmarks.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5001
diff changeset
149 else:
ca1d44f0f6b2 Enhanced the new web browser by adding a visit count to the bookmarks.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5001
diff changeset
150 self.setWindowTitle(self.tr("eric6 Web Browser"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
151
4788
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
152 self.__settingsDir = settingsDir
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
153 self.setWindowIcon(UI.PixmapCache.getIcon("ericWeb.png"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
154
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
155 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
156 self.__lastConfigurationPageName = ""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
157
4788
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
158 WebBrowserWindow._isPrivate = private
4725
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
159
6625
a67fee7bc09c Web Browser: changed the web browser logic inside eric to use a remote controlled web browser process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6623
diff changeset
160 self.__shortcutsDialog = None
a67fee7bc09c Web Browser: changed the web browser logic inside eric to use a remote controlled web browser process.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6623
diff changeset
161
4728
0367675d783d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4727
diff changeset
162 self.__eventMouseButtons = Qt.NoButton
0367675d783d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4727
diff changeset
163 self.__eventKeyboardModifiers = Qt.NoModifier
0367675d783d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4727
diff changeset
164
6627
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
165 if qVersionTuple() < (5, 11, 0) and \
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
166 Preferences.getWebBrowser("WebInspectorEnabled"):
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
167 os.environ["QTWEBENGINE_REMOTE_DEBUGGING"] = \
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
168 str(Preferences.getWebBrowser("WebInspectorPort"))
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
169
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
170 WebBrowserWindow.setUseQtHelp(qthelp or bool(searchWord))
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
171
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
172 self.webProfile(private)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
173 self.networkManager()
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
174
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
175 self.__htmlFullScreen = False
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
176 self.__windowStates = Qt.WindowNoState
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
177 self.__isClosing = False
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
178
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
179 from .SearchWidget import SearchWidget
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
180 from .QtHelp.HelpTocWidget import HelpTocWidget
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
181 from .QtHelp.HelpIndexWidget import HelpIndexWidget
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
182 from .QtHelp.HelpSearchWidget import HelpSearchWidget
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
183 from .WebBrowserView import WebBrowserView
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
184 from .WebBrowserTabWidget import WebBrowserTabWidget
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
185 from .AdBlock.AdBlockIcon import AdBlockIcon
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
186 from .StatusBar.JavaScriptIcon import JavaScriptIcon
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
187 from .StatusBar.ImagesIcon import ImagesIcon
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
188 from .VirusTotal.VirusTotalApi import VirusTotalAPI
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
189 from .Navigation.NavigationBar import NavigationBar
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
190 from .Navigation.NavigationContainer import NavigationContainer
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
191 from .Bookmarks.BookmarksToolBar import BookmarksToolBar
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
192
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
193 self.setStyle(Preferences.getUI("Style"),
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
194 Preferences.getUI("StyleSheet"))
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
195
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
196 # initialize some SSL stuff
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
197 from E5Network.E5SslUtilities import initSSL
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
198 initSSL()
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
199
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
200 if WebBrowserWindow._useQtHelp:
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
201 self.__helpEngine = QHelpEngine(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
202 WebBrowserWindow.getQtHelpCollectionFileName(),
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
203 self)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
204 self.__removeOldDocumentation()
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
205 self.__helpEngine.warning.connect(self.__warning)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
206 else:
6627
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
207 self.__helpEngine = None
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
208 self.__helpInstaller = None
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
209
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
210 self.__zoomWidget = E5ZoomWidget(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
211 UI.PixmapCache.getPixmap("zoomOut.png"),
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
212 UI.PixmapCache.getPixmap("zoomIn.png"),
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
213 UI.PixmapCache.getPixmap("zoomReset.png"), self)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
214 self.statusBar().addPermanentWidget(self.__zoomWidget)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
215 self.__zoomWidget.setMapping(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
216 WebBrowserView.ZoomLevels, WebBrowserView.ZoomLevelDefault)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
217 self.__zoomWidget.valueChanged.connect(self.__zoomValueChanged)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
218
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
219 self.__tabWidget = WebBrowserTabWidget(self)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
220 self.__tabWidget.currentChanged[int].connect(self.__currentChanged)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
221 self.__tabWidget.titleChanged.connect(self.__titleChanged)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
222 self.__tabWidget.showMessage.connect(self.statusBar().showMessage)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
223 self.__tabWidget.browserZoomValueChanged.connect(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
224 self.__zoomWidget.setValue)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
225 self.__tabWidget.browserClosed.connect(self.webBrowserClosed)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
226 self.__tabWidget.browserOpened.connect(self.webBrowserOpened)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
227
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
228 self.__searchWidget = SearchWidget(self, self)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
229
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
230 self.__setIconDatabasePath()
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
231
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
232 bookmarksModel = self.bookmarksManager().bookmarksModel()
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
233 self.__bookmarksToolBar = BookmarksToolBar(self, bookmarksModel,
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
234 self)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
235 self.__bookmarksToolBar.setIconSize(UI.Config.ToolBarIconSize)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
236 self.__bookmarksToolBar.openUrl.connect(self.openUrl)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
237 self.__bookmarksToolBar.newTab.connect(self.openUrlNewTab)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
238 self.__bookmarksToolBar.newWindow.connect(self.openUrlNewWindow)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
239
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
240 self.__navigationBar = NavigationBar(self)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
241
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
242 self.__navigationContainer = NavigationContainer(self)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
243 self.__navigationContainer.addWidget(self.__navigationBar)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
244 self.__navigationContainer.addWidget(self.__bookmarksToolBar)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
245
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
246 centralWidget = QWidget()
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
247 layout = QVBoxLayout()
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
248 layout.setContentsMargins(1, 1, 1, 1)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
249 layout.setSpacing(0)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
250 layout.addWidget(self.__navigationContainer)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
251 layout.addWidget(self.__tabWidget)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
252 layout.addWidget(self.__searchWidget)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
253 self.__tabWidget.setSizePolicy(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
254 QSizePolicy.Preferred, QSizePolicy.Expanding)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
255 centralWidget.setLayout(layout)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
256 self.setCentralWidget(centralWidget)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
257 self.__searchWidget.hide()
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
258
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
259 if WebBrowserWindow._useQtHelp:
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
260 # setup the TOC widget
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
261 self.__tocWindow = HelpTocWidget(self.__helpEngine)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
262 self.__tocDock = QDockWidget(self.tr("Contents"), self)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
263 self.__tocDock.setObjectName("TocWindow")
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
264 self.__tocDock.setWidget(self.__tocWindow)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
265 self.addDockWidget(Qt.LeftDockWidgetArea, self.__tocDock)
5722
433187e73c0f Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5721
diff changeset
266
6627
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
267 # setup the index widget
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
268 self.__indexWindow = HelpIndexWidget(self.__helpEngine)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
269 self.__indexDock = QDockWidget(self.tr("Index"), self)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
270 self.__indexDock.setObjectName("IndexWindow")
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
271 self.__indexDock.setWidget(self.__indexWindow)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
272 self.addDockWidget(Qt.LeftDockWidgetArea, self.__indexDock)
4744
ad3f6c1caf8d Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4743
diff changeset
273
6627
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
274 # setup the search widget
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
275 self.__searchWord = searchWord
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
276 self.__indexing = False
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
277 self.__indexingProgress = None
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
278 self.__searchEngine = self.__helpEngine.searchEngine()
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
279 self.__searchEngine.indexingStarted.connect(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
280 self.__indexingStarted)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
281 self.__searchEngine.indexingFinished.connect(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
282 self.__indexingFinished)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
283 self.__searchWindow = HelpSearchWidget(self.__searchEngine)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
284 self.__searchDock = QDockWidget(self.tr("Search"), self)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
285 self.__searchDock.setObjectName("SearchWindow")
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
286 self.__searchDock.setWidget(self.__searchWindow)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
287 self.addDockWidget(Qt.LeftDockWidgetArea, self.__searchDock)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
288
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
289 # JavaScript Console window
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
290 from .WebBrowserJavaScriptConsole import \
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
291 WebBrowserJavaScriptConsole
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
292 self.__javascriptConsole = WebBrowserJavaScriptConsole(self)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
293 self.__javascriptConsoleDock = QDockWidget(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
294 self.tr("JavaScript Console"))
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
295 self.__javascriptConsoleDock.setObjectName("JavascriptConsole")
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
296 self.__javascriptConsoleDock.setAllowedAreas(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
297 Qt.BottomDockWidgetArea | Qt.TopDockWidgetArea)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
298 self.__javascriptConsoleDock.setWidget(self.__javascriptConsole)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
299 self.addDockWidget(Qt.BottomDockWidgetArea,
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
300 self.__javascriptConsoleDock)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
301
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
302 if Preferences.getWebBrowser("SaveGeometry"):
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
303 g = Preferences.getGeometry("WebBrowserGeometry")
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
304 else:
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
305 g = QByteArray()
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
306 if g.isEmpty():
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
307 s = QSize(800, 800)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
308 self.resize(s)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
309 else:
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
310 self.restoreGeometry(g)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
311
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
312 WebBrowserWindow.BrowserWindows.append(self)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
313
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
314 self.__initWebEngineSettings()
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
315
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
316 # initialize some of our class objects
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
317 self.passwordManager()
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
318 self.historyManager()
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
319 self.greaseMonkeyManager()
6695
0a51887c13cd Web Browser (NG):
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6657
diff changeset
320 self.protocolHandlerManager()
6627
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
321
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
322 # initialize the actions
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
323 self.__initActions()
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
324
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
325 # initialize the menus
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
326 self.__initMenus()
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
327 self.__initSuperMenu()
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
328 if Preferences.getWebBrowser("MenuBarVisible"):
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
329 self.__navigationBar.superMenuButton().hide()
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
330 else:
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
331 self.menuBar().hide()
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
332
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
333 # save references to toolbars in order to hide them
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
334 # when going full screen
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
335 self.__toolbars = {}
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
336 # initialize toolbars
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
337 if Preferences.getWebBrowser("ShowToolbars"):
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
338 self.__initToolbars()
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
339 self.__bookmarksToolBar.setVisible(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
340 Preferences.getWebBrowser("BookmarksToolBarVisible"))
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
341
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
342 syncMgr = self.syncManager()
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
343 syncMgr.syncMessage.connect(self.statusBar().showMessage)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
344 syncMgr.syncError.connect(self.statusBar().showMessage)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
345
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
346 restoreSessionData = {}
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
347 if WebBrowserWindow._performingStartup and not home and \
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
348 not WebBrowserWindow.isPrivate():
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
349 startupBehavior = Preferences.getWebBrowser("StartupBehavior")
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
350 if not private and startupBehavior in [3, 4]:
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
351 if startupBehavior == 3:
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
352 # restore last session
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
353 restoreSessionFile = \
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
354 self.sessionManager().lastActiveSessionFile()
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
355 elif startupBehavior == 4:
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
356 # select session
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
357 restoreSessionFile = \
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
358 self.sessionManager().selectSession()
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
359 sessionData = \
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
360 self.sessionManager().readSessionFromFile(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
361 restoreSessionFile)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
362 if self.sessionManager().isValidSession(sessionData):
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
363 restoreSessionData = sessionData
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
364 restoreSession = True
5745
4f4316e83318 -- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5740
diff changeset
365 else:
6627
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
366 if Preferences.getWebBrowser("StartupBehavior") == 0:
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
367 home = "about:blank"
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
368 elif Preferences.getWebBrowser("StartupBehavior") == 1:
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
369 home = Preferences.getWebBrowser("HomePage")
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
370 elif Preferences.getWebBrowser("StartupBehavior") == 2:
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
371 home = "eric:speeddial"
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
372
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
373 if not restoreSession:
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
374 self.__tabWidget.newBrowser(QUrl.fromUserInput(home))
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
375 self.__tabWidget.currentBrowser().setFocus()
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
376 WebBrowserWindow._performingStartup = False
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
377
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
378 self.__imagesIcon = ImagesIcon(self)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
379 self.statusBar().addPermanentWidget(self.__imagesIcon)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
380 self.__javaScriptIcon = JavaScriptIcon(self)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
381 self.statusBar().addPermanentWidget(self.__javaScriptIcon)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
382
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
383 self.__adBlockIcon = AdBlockIcon(self)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
384 self.statusBar().addPermanentWidget(self.__adBlockIcon)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
385 self.__adBlockIcon.setEnabled(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
386 Preferences.getWebBrowser("AdBlockEnabled"))
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
387 self.__tabWidget.currentChanged[int].connect(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
388 self.__adBlockIcon.currentChanged)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
389 self.__tabWidget.sourceChanged.connect(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
390 self.__adBlockIcon.sourceChanged)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
391
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
392 self.__tabManagerIcon = self.tabManager().createStatusBarIcon()
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
393 self.statusBar().addPermanentWidget(self.__tabManagerIcon)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
394
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
395 self.networkIcon = E5NetworkIcon(self)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
396 self.statusBar().addPermanentWidget(self.networkIcon)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
397
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
398 if not Preferences.getWebBrowser("StatusBarVisible"):
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
399 self.statusBar().hide()
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
400
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
401 if len(WebBrowserWindow.BrowserWindows):
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
402 QDesktopServices.setUrlHandler(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
403 "http", WebBrowserWindow.BrowserWindows[0].urlHandler)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
404 QDesktopServices.setUrlHandler(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
405 "https", WebBrowserWindow.BrowserWindows[0].urlHandler)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
406
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
407 # setup connections
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
408 self.__activating = False
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
409 if WebBrowserWindow._useQtHelp:
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
410 # TOC window
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
411 self.__tocWindow.escapePressed.connect(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
412 self.__activateCurrentBrowser)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
413 self.__tocWindow.openUrl.connect(self.openUrl)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
414 self.__tocWindow.newTab.connect(self.openUrlNewTab)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
415 self.__tocWindow.newBackgroundTab.connect(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
416 self.openUrlNewBackgroundTab)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
417 self.__tocWindow.newWindow.connect(self.openUrlNewWindow)
5745
4f4316e83318 -- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5740
diff changeset
418
6627
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
419 # index window
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
420 self.__indexWindow.escapePressed.connect(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
421 self.__activateCurrentBrowser)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
422 self.__indexWindow.openUrl.connect(self.openUrl)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
423 self.__indexWindow.newTab.connect(self.openUrlNewTab)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
424 self.__indexWindow.newBackgroundTab.connect(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
425 self.openUrlNewBackgroundTab)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
426 self.__indexWindow.newWindow.connect(self.openUrlNewWindow)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
427
6627
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
428 # search window
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
429 self.__searchWindow.escapePressed.connect(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
430 self.__activateCurrentBrowser)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
431 self.__searchWindow.openUrl.connect(self.openUrl)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
432 self.__searchWindow.newTab.connect(self.openUrlNewTab)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
433 self.__searchWindow.newBackgroundTab.connect(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
434 self.openUrlNewBackgroundTab)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
435 self.__searchWindow.newWindow.connect(self.openUrlNewWindow)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
436
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
437 state = Preferences.getWebBrowser("WebBrowserState")
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
438 self.restoreState(state)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
439
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
440 self.__initHelpDb()
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
441
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
442 self.__virusTotal = VirusTotalAPI(self)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
443 self.__virusTotal.submitUrlError.connect(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
444 self.__virusTotalSubmitUrlError)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
445 self.__virusTotal.urlScanReport.connect(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
446 self.__virusTotalUrlScanReport)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
447 self.__virusTotal.fileScanReport.connect(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
448 self.__virusTotalFileScanReport)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
449
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
450 self.flashCookieManager()
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
451
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
452 e5App().focusChanged.connect(self.__appFocusChanged)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
453
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
454 self.__toolbarStates = self.saveState()
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
455
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
456 if single:
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
457 self.SAServer = WebBrowserSingleApplicationServer(saname)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
458 self.SAServer.loadUrl.connect(self.__saLoadUrl)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
459 self.SAServer.newTab.connect(self.__saNewTab)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
460 self.SAServer.search.connect(self.__saSearchWord)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
461 self.SAServer.shutdown.connect(self.shutdown)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
462 else:
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
463 self.SAServer = None
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
464
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
465 self.__hideNavigationTimer = QTimer(self)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
466 self.__hideNavigationTimer.setInterval(1000)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
467 self.__hideNavigationTimer.setSingleShot(True)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
468 self.__hideNavigationTimer.timeout.connect(self.__hideNavigation)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
469
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
470 self.__forcedClose = False
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
471
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
472 if restoreSessionData and not WebBrowserWindow.isPrivate():
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
473 self.sessionManager().restoreSessionFromData(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
474 self, restoreSessionData)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
475
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
476 if not WebBrowserWindow.isPrivate():
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
477 self.sessionManager().activateTimer()
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
478
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
479 QTimer.singleShot(0, syncMgr.loadSettings)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
480
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
481 if WebBrowserWindow._useQtHelp:
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
482 QTimer.singleShot(50, self.__lookForNewDocumentation)
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
483 if self.__searchWord is not None:
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
484 QTimer.singleShot(0, self.__searchForWord)
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
485
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
486 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
487 """
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
488 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
489
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
490 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
491 '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
492 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
493 """
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
494 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
495
4964
a894e8c92369 Implemented the JavaScript status bar icon.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4960
diff changeset
496 def tabWidget(self):
a894e8c92369 Implemented the JavaScript status bar icon.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4960
diff changeset
497 """
a894e8c92369 Implemented the JavaScript status bar icon.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4960
diff changeset
498 Public method to get a reference to the tab widget.
a894e8c92369 Implemented the JavaScript status bar icon.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4960
diff changeset
499
a894e8c92369 Implemented the JavaScript status bar icon.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4960
diff changeset
500 @return reference to the tab widget
a894e8c92369 Implemented the JavaScript status bar icon.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4960
diff changeset
501 @rtype WebBrowserTabWidget
a894e8c92369 Implemented the JavaScript status bar icon.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4960
diff changeset
502 """
a894e8c92369 Implemented the JavaScript status bar icon.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4960
diff changeset
503 return self.__tabWidget
a894e8c92369 Implemented the JavaScript status bar icon.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4960
diff changeset
504
4726
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
505 def __setIconDatabasePath(self, enable=True):
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
506 """
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
507 Private method to set the favicons path.
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
508
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
509 @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
510 """
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
511 if enable:
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
512 iconDatabasePath = os.path.join(Utilities.getConfigDir(),
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
513 "web_browser", "favicons")
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
514 if not os.path.exists(iconDatabasePath):
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
515 os.makedirs(iconDatabasePath)
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
516 else:
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
517 iconDatabasePath = "" # setting an empty path disables it
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
518
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
519 WebIconProvider.instance().setIconDatabasePath(iconDatabasePath)
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
520
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
521 def __initWebEngineSettings(self):
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
522 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
523 Private method to set the global web settings.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
524 """
6127
128d9567a533 Some improvements of the Web Browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6126
diff changeset
525 settings = self.webSettings()
4805
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
526
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
527 settings.setFontFamily(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
528 QWebEngineSettings.StandardFont,
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
529 Preferences.getWebBrowser("StandardFontFamily"))
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
530 settings.setFontFamily(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
531 QWebEngineSettings.FixedFont,
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
532 Preferences.getWebBrowser("FixedFontFamily"))
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
533 settings.setFontFamily(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
534 QWebEngineSettings.SerifFont,
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
535 Preferences.getWebBrowser("SerifFontFamily"))
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
536 settings.setFontFamily(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
537 QWebEngineSettings.SansSerifFont,
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
538 Preferences.getWebBrowser("SansSerifFontFamily"))
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
539 settings.setFontFamily(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
540 QWebEngineSettings.CursiveFont,
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
541 Preferences.getWebBrowser("CursiveFontFamily"))
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
542 settings.setFontFamily(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
543 QWebEngineSettings.FantasyFont,
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
544 Preferences.getWebBrowser("FantasyFontFamily"))
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
545
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
546 settings.setFontSize(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
547 QWebEngineSettings.DefaultFontSize,
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
548 Preferences.getWebBrowser("DefaultFontSize"))
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
549 settings.setFontSize(
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
550 QWebEngineSettings.DefaultFixedFontSize,
8ef007140046 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4801
diff changeset
551 Preferences.getWebBrowser("DefaultFixedFontSize"))
4725
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
552 settings.setFontSize(
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
553 QWebEngineSettings.MinimumFontSize,
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
554 Preferences.getWebBrowser("MinimumFontSize"))
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
555 settings.setFontSize(
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
556 QWebEngineSettings.MinimumLogicalFontSize,
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
557 Preferences.getWebBrowser("MinimumLogicalFontSize"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
558
4726
c26e2a2dc0cb Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4725
diff changeset
559 styleSheet = Preferences.getWebBrowser("UserStyleSheet")
4725
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
560 self.__setUserStyleSheet(styleSheet)
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
561
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
562 settings.setAttribute(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
563 QWebEngineSettings.AutoLoadImages,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
564 Preferences.getWebBrowser("AutoLoadImages"))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
565 settings.setAttribute(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
566 QWebEngineSettings.JavascriptEnabled,
6151
29564aad2f97 JavaScriptEnabled: Added a configuration option to globally disable/enable JavaScript support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6148
diff changeset
567 Preferences.getWebBrowser("JavaScriptEnabled"))
4965
a9a4b632fe48 Some enhancements for the new web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4964
diff changeset
568 # JavaScript is needed for the web browser functionality
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
569 settings.setAttribute(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
570 QWebEngineSettings.JavascriptCanOpenWindows,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
571 Preferences.getWebBrowser("JavaScriptCanOpenWindows"))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
572 settings.setAttribute(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
573 QWebEngineSettings.JavascriptCanAccessClipboard,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
574 Preferences.getWebBrowser("JavaScriptCanAccessClipboard"))
4886
b56735d36159 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4884
diff changeset
575 settings.setAttribute(
b56735d36159 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4884
diff changeset
576 QWebEngineSettings.PluginsEnabled,
b56735d36159 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4884
diff changeset
577 Preferences.getWebBrowser("PluginsEnabled"))
b56735d36159 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4884
diff changeset
578
4725
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
579 if self.isPrivate():
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
580 settings.setAttribute(
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
581 QWebEngineSettings.LocalStorageEnabled, False)
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
582 else:
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
583 settings.setAttribute(
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
584 QWebEngineSettings.LocalStorageEnabled,
b19ff70ba509 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4717
diff changeset
585 Preferences.getWebBrowser("LocalStorageEnabled"))
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
586 settings.setDefaultTextEncoding(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
587 Preferences.getWebBrowser("DefaultTextEncoding"))
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
588
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
589 settings.setAttribute(
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
590 QWebEngineSettings.SpatialNavigationEnabled,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
591 Preferences.getWebBrowser("SpatialNavigationEnabled"))
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
592 settings.setAttribute(
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
593 QWebEngineSettings.LinksIncludedInFocusChain,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
594 Preferences.getWebBrowser("LinksIncludedInFocusChain"))
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
595 settings.setAttribute(
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
596 QWebEngineSettings.LocalContentCanAccessRemoteUrls,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
597 Preferences.getWebBrowser("LocalContentCanAccessRemoteUrls"))
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
598 settings.setAttribute(
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
599 QWebEngineSettings.LocalContentCanAccessFileUrls,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
600 Preferences.getWebBrowser("LocalContentCanAccessFileUrls"))
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
601 settings.setAttribute(
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
602 QWebEngineSettings.XSSAuditingEnabled,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
603 Preferences.getWebBrowser("XSSAuditingEnabled"))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
604 settings.setAttribute(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
605 QWebEngineSettings.ScrollAnimatorEnabled,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
606 Preferences.getWebBrowser("ScrollAnimatorEnabled"))
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
607 settings.setAttribute(
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
608 QWebEngineSettings.ErrorPageEnabled,
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
609 Preferences.getWebBrowser("ErrorPageEnabled"))
4884
6983af705a7f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4880
diff changeset
610 settings.setAttribute(
6983af705a7f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4880
diff changeset
611 QWebEngineSettings.FullScreenSupportEnabled,
6983af705a7f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4880
diff changeset
612 Preferences.getWebBrowser("FullScreenSupportEnabled"))
5031
e4dbcb22d912 Started adjusting the new web browser to the extended functionality of Qt 5.7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5015
diff changeset
613
e4dbcb22d912 Started adjusting the new web browser to the extended functionality of Qt 5.7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5015
diff changeset
614 try:
e4dbcb22d912 Started adjusting the new web browser to the extended functionality of Qt 5.7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5015
diff changeset
615 # Qt 5.7
e4dbcb22d912 Started adjusting the new web browser to the extended functionality of Qt 5.7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5015
diff changeset
616 settings.setAttribute(
e4dbcb22d912 Started adjusting the new web browser to the extended functionality of Qt 5.7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5015
diff changeset
617 QWebEngineSettings.ScreenCaptureEnabled,
e4dbcb22d912 Started adjusting the new web browser to the extended functionality of Qt 5.7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5015
diff changeset
618 Preferences.getWebBrowser("ScreenCaptureEnabled"))
e4dbcb22d912 Started adjusting the new web browser to the extended functionality of Qt 5.7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5015
diff changeset
619 settings.setAttribute(
e4dbcb22d912 Started adjusting the new web browser to the extended functionality of Qt 5.7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5015
diff changeset
620 QWebEngineSettings.WebGLEnabled,
e4dbcb22d912 Started adjusting the new web browser to the extended functionality of Qt 5.7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5015
diff changeset
621 Preferences.getWebBrowser("WebGLEnabled"))
e4dbcb22d912 Started adjusting the new web browser to the extended functionality of Qt 5.7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5015
diff changeset
622 except (AttributeError, KeyError):
e4dbcb22d912 Started adjusting the new web browser to the extended functionality of Qt 5.7.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5015
diff changeset
623 pass
5530
93f95c4b3153 Started upgrading the new web browser to the Qt 5.8 offerings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5526
diff changeset
624
93f95c4b3153 Started upgrading the new web browser to the Qt 5.8 offerings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5526
diff changeset
625 try:
93f95c4b3153 Started upgrading the new web browser to the Qt 5.8 offerings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5526
diff changeset
626 # Qt 5.8
93f95c4b3153 Started upgrading the new web browser to the Qt 5.8 offerings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5526
diff changeset
627 settings.setAttribute(
93f95c4b3153 Started upgrading the new web browser to the Qt 5.8 offerings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5526
diff changeset
628 QWebEngineSettings.FocusOnNavigationEnabled,
93f95c4b3153 Started upgrading the new web browser to the Qt 5.8 offerings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5526
diff changeset
629 Preferences.getWebBrowser("FocusOnNavigationEnabled"))
93f95c4b3153 Started upgrading the new web browser to the Qt 5.8 offerings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5526
diff changeset
630 settings.setAttribute(
93f95c4b3153 Started upgrading the new web browser to the Qt 5.8 offerings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5526
diff changeset
631 QWebEngineSettings.PrintElementBackgrounds,
93f95c4b3153 Started upgrading the new web browser to the Qt 5.8 offerings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5526
diff changeset
632 Preferences.getWebBrowser("PrintElementBackgrounds"))
93f95c4b3153 Started upgrading the new web browser to the Qt 5.8 offerings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5526
diff changeset
633 settings.setAttribute(
93f95c4b3153 Started upgrading the new web browser to the Qt 5.8 offerings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5526
diff changeset
634 QWebEngineSettings.AllowRunningInsecureContent,
93f95c4b3153 Started upgrading the new web browser to the Qt 5.8 offerings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5526
diff changeset
635 Preferences.getWebBrowser("AllowRunningInsecureContent"))
93f95c4b3153 Started upgrading the new web browser to the Qt 5.8 offerings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5526
diff changeset
636 except (AttributeError, KeyError):
93f95c4b3153 Started upgrading the new web browser to the Qt 5.8 offerings.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5526
diff changeset
637 pass
6089
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6085
diff changeset
638
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6085
diff changeset
639 try:
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6085
diff changeset
640 # Qt 5.9
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6085
diff changeset
641 settings.setAttribute(
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6085
diff changeset
642 QWebEngineSettings.AllowGeolocationOnInsecureOrigins,
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6085
diff changeset
643 Preferences.getWebBrowser("AllowGeolocationOnInsecureOrigins"))
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6085
diff changeset
644 except (AttributeError, KeyError):
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6085
diff changeset
645 pass
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6085
diff changeset
646
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6085
diff changeset
647 try:
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6085
diff changeset
648 # Qt 5.10
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6085
diff changeset
649 settings.setAttribute(
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6085
diff changeset
650 QWebEngineSettings.AllowWindowActivationFromJavaScript,
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6085
diff changeset
651 Preferences.getWebBrowser(
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6085
diff changeset
652 "AllowWindowActivationFromJavaScript"))
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6085
diff changeset
653 settings.setAttribute(
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6085
diff changeset
654 QWebEngineSettings.ShowScrollBars,
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6085
diff changeset
655 Preferences.getWebBrowser("ShowScrollBars"))
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6085
diff changeset
656 except (AttributeError, KeyError):
ca484325f02a Added support for attributes introduced by Qt 5.9 and Qt 5.10.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6085
diff changeset
657 pass
6397
473d410076e9 Webbrowser: started upgrading to Qt 5.11.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6296
diff changeset
658
473d410076e9 Webbrowser: started upgrading to Qt 5.11.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6296
diff changeset
659 try:
473d410076e9 Webbrowser: started upgrading to Qt 5.11.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6296
diff changeset
660 # Qt 5.11
473d410076e9 Webbrowser: started upgrading to Qt 5.11.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6296
diff changeset
661 settings.setAttribute(
473d410076e9 Webbrowser: started upgrading to Qt 5.11.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6296
diff changeset
662 QWebEngineSettings.PlaybackRequiresUserGesture,
473d410076e9 Webbrowser: started upgrading to Qt 5.11.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6296
diff changeset
663 Preferences.getWebBrowser(
473d410076e9 Webbrowser: started upgrading to Qt 5.11.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6296
diff changeset
664 "PlaybackRequiresUserGesture"))
473d410076e9 Webbrowser: started upgrading to Qt 5.11.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6296
diff changeset
665 settings.setAttribute(
473d410076e9 Webbrowser: started upgrading to Qt 5.11.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6296
diff changeset
666 QWebEngineSettings.JavascriptCanPaste,
473d410076e9 Webbrowser: started upgrading to Qt 5.11.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6296
diff changeset
667 Preferences.getWebBrowser(
6413
fbb7671f4564 Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6402
diff changeset
668 "JavaScriptCanPaste"))
6397
473d410076e9 Webbrowser: started upgrading to Qt 5.11.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6296
diff changeset
669 settings.setAttribute(
473d410076e9 Webbrowser: started upgrading to Qt 5.11.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6296
diff changeset
670 QWebEngineSettings.WebRTCPublicInterfacesOnly,
473d410076e9 Webbrowser: started upgrading to Qt 5.11.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6296
diff changeset
671 Preferences.getWebBrowser(
6413
fbb7671f4564 Fixed some code style issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6402
diff changeset
672 "WebRTCPublicInterfacesOnly"))
6397
473d410076e9 Webbrowser: started upgrading to Qt 5.11.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6296
diff changeset
673 except (AttributeError, KeyError):
473d410076e9 Webbrowser: started upgrading to Qt 5.11.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6296
diff changeset
674 pass
6657
c6a93bbd66a5 WebBrowser: added support for the QWebEngineSettings.DnsPrefetchEnabled attribute as of Qt 5.12.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
675
c6a93bbd66a5 WebBrowser: added support for the QWebEngineSettings.DnsPrefetchEnabled attribute as of Qt 5.12.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
676 try:
c6a93bbd66a5 WebBrowser: added support for the QWebEngineSettings.DnsPrefetchEnabled attribute as of Qt 5.12.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
677 # Qt 5.12
c6a93bbd66a5 WebBrowser: added support for the QWebEngineSettings.DnsPrefetchEnabled attribute as of Qt 5.12.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
678 settings.setAttribute(
c6a93bbd66a5 WebBrowser: added support for the QWebEngineSettings.DnsPrefetchEnabled attribute as of Qt 5.12.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
679 QWebEngineSettings.DnsPrefetchEnabled,
c6a93bbd66a5 WebBrowser: added support for the QWebEngineSettings.DnsPrefetchEnabled attribute as of Qt 5.12.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
680 Preferences.getWebBrowser(
c6a93bbd66a5 WebBrowser: added support for the QWebEngineSettings.DnsPrefetchEnabled attribute as of Qt 5.12.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
681 "DnsPrefetchEnabled"))
c6a93bbd66a5 WebBrowser: added support for the QWebEngineSettings.DnsPrefetchEnabled attribute as of Qt 5.12.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
682 except (AttributeError, KeyError):
c6a93bbd66a5 WebBrowser: added support for the QWebEngineSettings.DnsPrefetchEnabled attribute as of Qt 5.12.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6645
diff changeset
683 pass
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
684
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
685 def __initActions(self):
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
686 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
687 Private method to define the user interface actions.
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
688 """
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
689 # list of all actions
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
690 self.__actions = []
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
691
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
692 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
693 self.tr('New Tab'),
638
265c31231d9d Did some refactoring of the web browser code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 637
diff changeset
694 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
695 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
696 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
697 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
698 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
699 self.newTabAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
700 """<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
701 """<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
702 ))
6627
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
703 self.newTabAct.triggered.connect(self.newTab)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
704 self.__actions.append(self.newTabAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
705
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
706 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
707 self.tr('New Window'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
708 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
709 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
710 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
711 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
712 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
713 self.newAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
714 """<b>New Window</b>"""
4788
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
715 """<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
716 """ privacy mode.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
717 ))
6627
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
718 self.newAct.triggered.connect(self.newWindow)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
719 self.__actions.append(self.newAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
720
4788
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
721 self.newPrivateAct = E5Action(
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
722 self.tr('New Private Window'),
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
723 UI.PixmapCache.getIcon("privateMode.png"),
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
724 self.tr('New &Private Window'),
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
725 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
726 0, self, 'webbrowser_file_new_private_window')
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
727 self.newPrivateAct.setStatusTip(self.tr(
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
728 'Open a new private web browser window'))
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
729 self.newPrivateAct.setWhatsThis(self.tr(
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
730 """<b>New Private Window</b>"""
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
731 """<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
732 """ 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
733 ))
6627
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
734 self.newPrivateAct.triggered.connect(self.newPrivateWindow)
4788
7076adec8ddd Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4787
diff changeset
735 self.__actions.append(self.newPrivateAct)
4731
67d861d9e492 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4728
diff changeset
736
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
737 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
738 self.tr('Open File'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
739 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
740 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
741 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
742 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
743 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
744 self.openAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
745 """<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
746 """<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
747 """ It pops up a file selection dialog.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
748 ))
6627
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
749 self.openAct.triggered.connect(self.__openFile)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
750 self.__actions.append(self.openAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
751
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
752 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
753 self.tr('Open File in New Tab'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
754 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
755 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
756 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
757 0, self, 'webbrowser_file_open_tab')
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 545
diff changeset
758 self.openTabAct.setStatusTip(
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
759 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
760 self.openTabAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
761 """<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
762 """<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
763 """ It pops up a file selection dialog.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
764 ))
6627
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
765 self.openTabAct.triggered.connect(self.__openFileNewTab)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
766 self.__actions.append(self.openTabAct)
5033
d1c2651060ec Added the 'Save as' functionality to the new web browser (for Qt 5.7+)
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5031
diff changeset
767
d1c2651060ec Added the 'Save as' functionality to the new web browser (for Qt 5.7+)
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5031
diff changeset
768 if hasattr(QWebEnginePage, "SavePage"):
d1c2651060ec Added the 'Save as' functionality to the new web browser (for Qt 5.7+)
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5031
diff changeset
769 self.saveAsAct = E5Action(
d1c2651060ec Added the 'Save as' functionality to the new web browser (for Qt 5.7+)
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5031
diff changeset
770 self.tr('Save As'),
d1c2651060ec Added the 'Save as' functionality to the new web browser (for Qt 5.7+)
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5031
diff changeset
771 UI.PixmapCache.getIcon("fileSaveAs.png"),
d1c2651060ec Added the 'Save as' functionality to the new web browser (for Qt 5.7+)
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5031
diff changeset
772 self.tr('&Save As...'),
d1c2651060ec Added the 'Save as' functionality to the new web browser (for Qt 5.7+)
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5031
diff changeset
773 QKeySequence(self.tr("Shift+Ctrl+S", "File|Save As")),
d1c2651060ec Added the 'Save as' functionality to the new web browser (for Qt 5.7+)
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5031
diff changeset
774 0, self, 'webbrowser_file_save_as')
d1c2651060ec Added the 'Save as' functionality to the new web browser (for Qt 5.7+)
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5031
diff changeset
775 self.saveAsAct.setStatusTip(
d1c2651060ec Added the 'Save as' functionality to the new web browser (for Qt 5.7+)
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5031
diff changeset
776 self.tr('Save the current page to disk'))
d1c2651060ec Added the 'Save as' functionality to the new web browser (for Qt 5.7+)
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5031
diff changeset
777 self.saveAsAct.setWhatsThis(self.tr(
d1c2651060ec Added the 'Save as' functionality to the new web browser (for Qt 5.7+)
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5031
diff changeset
778 """<b>Save As...</b>"""
d1c2651060ec Added the 'Save as' functionality to the new web browser (for Qt 5.7+)
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5031
diff changeset
779 """<p>Saves the current page to disk.</p>"""
d1c2651060ec Added the 'Save as' functionality to the new web browser (for Qt 5.7+)
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5031
diff changeset
780 ))
6627
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
781 self.saveAsAct.triggered.connect(self.__savePageAs)
5033
d1c2651060ec Added the 'Save as' functionality to the new web browser (for Qt 5.7+)
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5031
diff changeset
782 self.__actions.append(self.saveAsAct)
d1c2651060ec Added the 'Save as' functionality to the new web browser (for Qt 5.7+)
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5031
diff changeset
783 else:
d1c2651060ec Added the 'Save as' functionality to the new web browser (for Qt 5.7+)
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5031
diff changeset
784 self.saveAsAct = None
d1c2651060ec Added the 'Save as' functionality to the new web browser (for Qt 5.7+)
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5031
diff changeset
785
6155
ae44225e7e7c PageScreen: Removed the action to save the whole web page as a screenshot because it is not supported by QWebEngine (and probably will not in the foreseeable future).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6151
diff changeset
786 self.saveVisiblePageScreenAct = E5Action(
4780
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
787 self.tr('Save Page Screen'),
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
788 UI.PixmapCache.getIcon("fileSavePixmap.png"),
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
789 self.tr('Save Page Screen...'),
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
790 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
791 self.saveVisiblePageScreenAct.setStatusTip(
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
792 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
793 ' screen shot'))
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
794 self.saveVisiblePageScreenAct.setWhatsThis(self.tr(
6155
ae44225e7e7c PageScreen: Removed the action to save the whole web page as a screenshot because it is not supported by QWebEngine (and probably will not in the foreseeable future).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6151
diff changeset
795 """<b>Save Page Screen...</b>"""
4780
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
796 """<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
797 """ screen shot.</p>"""
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
798 ))
6627
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
799 self.saveVisiblePageScreenAct.triggered.connect(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
800 self.__saveVisiblePageScreen)
4780
1d203a177b16 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4774
diff changeset
801 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
802
4732
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
803 bookmarksManager = self.bookmarksManager()
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
804 self.importBookmarksAct = E5Action(
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
805 self.tr('Import Bookmarks'),
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
806 self.tr('&Import Bookmarks...'),
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
807 0, 0, self, 'webbrowser_file_import_bookmarks')
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
808 self.importBookmarksAct.setStatusTip(
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
809 self.tr('Import bookmarks from other browsers'))
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
810 self.importBookmarksAct.setWhatsThis(self.tr(
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
811 """<b>Import Bookmarks</b>"""
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
812 """<p>Import bookmarks from other browsers.</p>"""
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
813 ))
6627
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
814 self.importBookmarksAct.triggered.connect(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
815 bookmarksManager.importBookmarks)
4732
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
816 self.__actions.append(self.importBookmarksAct)
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
817
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
818 self.exportBookmarksAct = E5Action(
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
819 self.tr('Export Bookmarks'),
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
820 self.tr('&Export Bookmarks...'),
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
821 0, 0, self, 'webbrowser_file_export_bookmarks')
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
822 self.exportBookmarksAct.setStatusTip(
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
823 self.tr('Export the bookmarks into a file'))
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
824 self.exportBookmarksAct.setWhatsThis(self.tr(
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
825 """<b>Export Bookmarks</b>"""
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
826 """<p>Export the bookmarks into a file.</p>"""
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
827 ))
6627
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
828 self.exportBookmarksAct.triggered.connect(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
829 bookmarksManager.exportBookmarks)
4732
5ac4fc1dfc20 Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4731
diff changeset
830 self.__actions.append(self.exportBookmarksAct)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
831
7201
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
832 self.printAct = E5Action(
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
833 self.tr('Print'),
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
834 UI.PixmapCache.getIcon("print.png"),
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
835 self.tr('&Print'),
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
836 QKeySequence(self.tr("Ctrl+P", "File|Print")),
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
837 0, self, 'webbrowser_file_print')
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
838 self.printAct.setStatusTip(self.tr('Print the displayed help'))
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
839 self.printAct.setWhatsThis(self.tr(
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
840 """<b>Print</b>"""
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
841 """<p>Print the displayed help text.</p>"""
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
842 ))
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
843 self.printAct.triggered.connect(self.__tabWidget.printBrowser)
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
844 self.__actions.append(self.printAct)
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
845
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
846 self.printPdfAct = E5Action(
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
847 self.tr('Print as PDF'),
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
848 UI.PixmapCache.getIcon("printPdf.png"),
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
849 self.tr('Print as PDF'),
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
850 0, 0, self, 'webbrowser_file_print_pdf')
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
851 self.printPdfAct.setStatusTip(self.tr(
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
852 'Print the displayed help as PDF'))
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
853 self.printPdfAct.setWhatsThis(self.tr(
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
854 """<b>Print as PDF</b>"""
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
855 """<p>Print the displayed help text as a PDF file.</p>"""
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
856 ))
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
857 self.printPdfAct.triggered.connect(
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
858 self.__tabWidget.printBrowserPdf)
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
859 self.__actions.append(self.printPdfAct)
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
860
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
861 self.printPreviewAct = E5Action(
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
862 self.tr('Print Preview'),
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
863 UI.PixmapCache.getIcon("printPreview.png"),
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
864 self.tr('Print Preview'),
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
865 0, 0, self, 'webbrowser_file_print_preview')
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
866 self.printPreviewAct.setStatusTip(self.tr(
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
867 'Print preview of the displayed help'))
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
868 self.printPreviewAct.setWhatsThis(self.tr(
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
869 """<b>Print Preview</b>"""
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
870 """<p>Print preview of the displayed help text.</p>"""
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
871 ))
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
872 self.printPreviewAct.triggered.connect(
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
873 self.__tabWidget.printPreviewBrowser)
6b42677d7043 Modified sources to be in line with the minimum Qt/PyQt requirement (v 5.9.0).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7192
diff changeset
874 self.__actions.append(self.printPreviewAct)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
875
5746
6ccc43d9faf0 Added a "Send Page Link" action to the File menu and the super menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5745
diff changeset
876 self.sendPageLinkAct = E5Action(
6ccc43d9faf0 Added a "Send Page Link" action to the File menu and the super menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5745
diff changeset
877 self.tr('Send Page Link'),
6ccc43d9faf0 Added a "Send Page Link" action to the File menu and the super menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5745
diff changeset
878 UI.PixmapCache.getIcon("mailSend.png"),
6ccc43d9faf0 Added a "Send Page Link" action to the File menu and the super menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5745
diff changeset
879 self.tr('Send Page Link'),
6ccc43d9faf0 Added a "Send Page Link" action to the File menu and the super menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5745
diff changeset
880 0, 0, self, 'webbrowser_send_page_link')
6ccc43d9faf0 Added a "Send Page Link" action to the File menu and the super menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5745
diff changeset
881 self.sendPageLinkAct.setStatusTip(self.tr(
6ccc43d9faf0 Added a "Send Page Link" action to the File menu and the super menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5745
diff changeset
882 'Send the link of the current page via email'))
6ccc43d9faf0 Added a "Send Page Link" action to the File menu and the super menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5745
diff changeset
883 self.sendPageLinkAct.setWhatsThis(self.tr(
6ccc43d9faf0 Added a "Send Page Link" action to the File menu and the super menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5745
diff changeset
884 """<b>Send Page Link</b>"""
6ccc43d9faf0 Added a "Send Page Link" action to the File menu and the super menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5745
diff changeset
885 """<p>Send the link of the current page via email.</p>"""
6ccc43d9faf0 Added a "Send Page Link" action to the File menu and the super menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5745
diff changeset
886 ))
6627
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
887 self.sendPageLinkAct.triggered.connect(self.__sendPageLink)
5746
6ccc43d9faf0 Added a "Send Page Link" action to the File menu and the super menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5745
diff changeset
888 self.__actions.append(self.sendPageLinkAct)
6ccc43d9faf0 Added a "Send Page Link" action to the File menu and the super menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5745
diff changeset
889
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
890 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
891 self.tr('Close'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
892 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
893 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
894 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
895 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
896 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
897 '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
898 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
899 """<b>Close</b>"""
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
900 """<p>Closes the current web browser window.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
901 ))
6627
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
902 self.closeAct.triggered.connect(self.__tabWidget.closeBrowser)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
903 self.__actions.append(self.closeAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
904
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
905 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
906 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
907 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
908 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
909 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
910 self.closeAllAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
911 """<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
912 """<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
913 ))
6627
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
914 self.closeAllAct.triggered.connect(
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
915 self.__tabWidget.closeAllBrowsers)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
916 self.__actions.append(self.closeAllAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
917
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
918 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
919 self.tr('Quit'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
920 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
921 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
922 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
923 0, self, 'webbrowser_file_quit')
3670
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3656
diff changeset
924 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
925 self.exitAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
926 """<b>Quit</b>"""
3670
f0cb7579c0b4 Finished renaming eric5 for PyQt5 to eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3656
diff changeset
927 """<p>Quit the eric6 Web Browser.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
928 ))
6627
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
929 self.exitAct.triggered.connect(self.shutdown)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
930 self.__actions.append(self.exitAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
931
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
932 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
933 self.tr('Backward'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
934 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
935 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
936 QKeySequence(self.tr("Alt+Left", "Go|Backward")),
4884
6983af705a7f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4880
diff changeset
937 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
938 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
939 self.backAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
940 """<b>Backward</b>"""
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
941 """<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
942 """ available, this action is disabled.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
943 ))
6627
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
944 self.backAct.triggered.connect(self.__backward)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
945 self.__actions.append(self.backAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
946
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
947 self.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
948 self.tr('Forward'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
949 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
950 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
951 QKeySequence(self.tr("Alt+Right", "Go|Forward")),
4884
6983af705a7f Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4880
diff changeset
952 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
953 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
954 '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
955 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
956 """<b>Forward</b>"""
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
957 """<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
958 """ available, this action is disabled.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
959 ))
6627
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
960 self.forwardAct.triggered.connect(self.__forward)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
961 self.__actions.append(self.forwardAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
962
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
963 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
964 self.tr('Home'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
965 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
966 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
967 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
968 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
969 self.homeAct.setStatusTip(self.tr(
5722
433187e73c0f Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 5721
diff changeset
970 'Move to the initial screen'))
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
971 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
972 """<b>Home</b>"""
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
973 """<p>Moves to the initial screen.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
974 ))
6627
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
975 self.homeAct.triggered.connect(self.__home)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
976 self.__actions.append(self.homeAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
977
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
978 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
979 self.tr('Reload'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
980 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
981 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
982 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
983 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
984 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
985 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
986 '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
987 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
988 """<b>Reload</b>"""
4709
8612533a223f Started porting the eric web browser to use QtWebEngine.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
989 """<p>Reloads the current screen.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
990 ))
6627
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
991 self.reloadAct.triggered.connect(self.__reload)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
992 self.__actions.append(self.reloadAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
993
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
994 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
995 self.tr('Stop'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
996 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
997 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
998 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
999 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
1000 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
1001 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
1002 self.stopAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
1003 """<b>Stop</b>"""
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
1004 """<p>Stops loading of the current tab.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1005 ))
6627
acd62f281a99 WebBrowserWindow: removed the 'initShortcutsOnly' functionality because it is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 6625
diff changeset
1006 self.stopAct.triggered.connect(self.__stopLoading)
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1007 self.__actions.append(self.stopAct)
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1008
3022
57179e4cdadd Fixed a bunch of visible indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3020
diff changeset
1009 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
1010 self.tr('Copy'),
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1011 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
1012 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
1013 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
1014 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
1015 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
1016 self.copyAct.setWhatsThis(self.tr(
3035
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
1017 """<b>Copy</b>"""
36e9f388958b Fixed a bunch of indentation issues.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3034
diff changeset
1018 """<p>Copy the selected text to the clipboard.</p>"""
0
de9c2efb9d02 Started porting eric4 to Python3
Detlev Offenbach <detlev@die-offenbach