Sat, 31 Dec 2022 16:23:21 +0100
Updated copyright for 2023.
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1 | # -*- coding: utf-8 -*- |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2 | |
9653
e67609152c5e
Updated copyright for 2023.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9482
diff
changeset
|
3 | # Copyright (c) 2017 - 2023 Detlev Offenbach <detlev@die-offenbachs.de> |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
4 | # |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
5 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
6 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
7 | Module implementing the navigation bar widget. |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
8 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
9 | |
8318
962bce857696
Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8312
diff
changeset
|
10 | from PyQt6.QtCore import Qt, QUrl |
962bce857696
Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8312
diff
changeset
|
11 | from PyQt6.QtGui import QAction |
962bce857696
Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8312
diff
changeset
|
12 | from PyQt6.QtWidgets import ( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
13 | QHBoxLayout, |
9473
3f23dbf37dbe
Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
14 | QMenu, |
3f23dbf37dbe
Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
15 | QSizePolicy, |
3f23dbf37dbe
Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
16 | QSplitter, |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
17 | QStyle, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
18 | QToolButton, |
9473
3f23dbf37dbe
Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
19 | QWidget, |
7268
a28338eaf694
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
20 | ) |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
21 | |
9473
3f23dbf37dbe
Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
22 | from eric7 import Preferences |
3f23dbf37dbe
Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
23 | from eric7.EricGui import EricPixmapCache |
9413
80c06d472826
Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
24 | from eric7.EricWidgets.EricToolButton import EricToolButton |
80c06d472826
Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
25 | from eric7.WebBrowser.Download.DownloadManagerButton import DownloadManagerButton |
9482
a2bc06a54d9d
Corrected/acknowledged some bad import style and removed some obsolete code.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9473
diff
changeset
|
26 | from eric7.WebBrowser.WebBrowserWebSearchWidget import WebBrowserWebSearchWidget |
9473
3f23dbf37dbe
Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
27 | from eric7.WebBrowser.WebBrowserWindow import WebBrowserWindow |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
28 | |
5734
d8b99b5fa673
United the stop and reload buttons of the navigation bar.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5722
diff
changeset
|
29 | from .ReloadStopButton import ReloadStopButton |
d8b99b5fa673
United the stop and reload buttons of the navigation bar.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5722
diff
changeset
|
30 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
31 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
32 | class NavigationBar(QWidget): |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
33 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
34 | Class implementing the navigation bar. |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
35 | """ |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
36 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
37 | def __init__(self, mainWindow, parent=None): |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
38 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
39 | Constructor |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
40 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
41 | @param mainWindow reference to the browser main window |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
42 | @type WebBrowserWindow |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
43 | @param parent reference to the parent widget |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
44 | @type QWidget |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
45 | """ |
8218
7c09585bd960
Applied some more code simplifications suggested by the new Simplify checker (super(Foo, self) => super()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8143
diff
changeset
|
46 | super().__init__(parent) |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
47 | self.setObjectName("navigationbar") |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
48 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
49 | self.__mw = mainWindow |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
50 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
51 | self.__layout = QHBoxLayout(self) |
8143
2c730d5fd177
Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
52 | margin = self.style().pixelMetric( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
53 | QStyle.PixelMetric.PM_ToolBarItemMargin, None, self |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
54 | ) |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
55 | self.__layout.setContentsMargins(margin, margin, margin, margin) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
56 | self.__layout.setSpacing( |
8143
2c730d5fd177
Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
57 | self.style().pixelMetric( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
58 | QStyle.PixelMetric.PM_ToolBarItemSpacing, None, self |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
59 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
60 | ) |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
61 | self.setLayout(self.__layout) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
62 | |
8356
68ec9c3d4de5
Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
63 | self.__backButton = EricToolButton(self) |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
64 | self.__backButton.setObjectName("navigation_back_button") |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
65 | self.__backButton.setToolTip(self.tr("Move one screen backward")) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
66 | self.__backButton.setToolButtonStyle(Qt.ToolButtonStyle.ToolButtonIconOnly) |
8143
2c730d5fd177
Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
67 | self.__backButton.setFocusPolicy(Qt.FocusPolicy.NoFocus) |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
68 | self.__backButton.setAutoRaise(True) |
9413
80c06d472826
Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
69 | self.__backButton.setIcon(EricPixmapCache.getIcon("back")) |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
70 | self.__backButton.setEnabled(False) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
71 | |
8356
68ec9c3d4de5
Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
72 | self.__forwardButton = EricToolButton(self) |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
73 | self.__forwardButton.setObjectName("navigation_forward_button") |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
74 | self.__forwardButton.setToolTip(self.tr("Move one screen forward")) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
75 | self.__forwardButton.setToolButtonStyle(Qt.ToolButtonStyle.ToolButtonIconOnly) |
8143
2c730d5fd177
Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
76 | self.__forwardButton.setFocusPolicy(Qt.FocusPolicy.NoFocus) |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
77 | self.__forwardButton.setAutoRaise(True) |
9413
80c06d472826
Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
78 | self.__forwardButton.setIcon(EricPixmapCache.getIcon("forward")) |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
79 | self.__forwardButton.setEnabled(False) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
80 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
81 | self.__backNextLayout = QHBoxLayout() |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
82 | self.__backNextLayout.setContentsMargins(0, 0, 0, 0) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
83 | self.__backNextLayout.setSpacing(0) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
84 | self.__backNextLayout.addWidget(self.__backButton) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
85 | self.__backNextLayout.addWidget(self.__forwardButton) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
86 | |
5734
d8b99b5fa673
United the stop and reload buttons of the navigation bar.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5722
diff
changeset
|
87 | self.__reloadStopButton = ReloadStopButton(self) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
88 | |
8356
68ec9c3d4de5
Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
89 | self.__homeButton = EricToolButton(self) |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
90 | self.__homeButton.setObjectName("navigation_home_button") |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
91 | self.__homeButton.setToolTip(self.tr("Move to the initial screen")) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
92 | self.__homeButton.setToolButtonStyle(Qt.ToolButtonStyle.ToolButtonIconOnly) |
8143
2c730d5fd177
Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
93 | self.__homeButton.setFocusPolicy(Qt.FocusPolicy.NoFocus) |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
94 | self.__homeButton.setAutoRaise(True) |
9413
80c06d472826
Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
95 | self.__homeButton.setIcon(EricPixmapCache.getIcon("home")) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
96 | |
8356
68ec9c3d4de5
Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
97 | self.__exitFullScreenButton = EricToolButton(self) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
98 | self.__exitFullScreenButton.setObjectName("navigation_exitfullscreen_button") |
9413
80c06d472826
Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
99 | self.__exitFullScreenButton.setIcon(EricPixmapCache.getIcon("windowRestore")) |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
100 | self.__exitFullScreenButton.setToolTip(self.tr("Exit Fullscreen")) |
8143
2c730d5fd177
Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
101 | self.__exitFullScreenButton.setToolButtonStyle( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
102 | Qt.ToolButtonStyle.ToolButtonIconOnly |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
103 | ) |
8143
2c730d5fd177
Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
104 | self.__exitFullScreenButton.setFocusPolicy(Qt.FocusPolicy.NoFocus) |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
105 | self.__exitFullScreenButton.setAutoRaise(True) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
106 | self.__exitFullScreenButton.clicked.connect(self.__mw.toggleFullScreen) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
107 | self.__exitFullScreenButton.setVisible(False) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
108 | |
6134
cb0985e8da91
Introduced a navigation bar button to open the downloads manager window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
109 | self.__downloadManagerButton = DownloadManagerButton(self) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
110 | |
8356
68ec9c3d4de5
Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
111 | self.__superMenuButton = EricToolButton(self) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
112 | self.__superMenuButton.setObjectName("navigation_supermenu_button") |
9413
80c06d472826
Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9221
diff
changeset
|
113 | self.__superMenuButton.setIcon(EricPixmapCache.getIcon("superMenu")) |
5745
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
114 | self.__superMenuButton.setToolTip(self.tr("Main Menu")) |
8143
2c730d5fd177
Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
115 | self.__superMenuButton.setPopupMode( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
116 | QToolButton.ToolButtonPopupMode.InstantPopup |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
117 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
118 | self.__superMenuButton.setToolButtonStyle(Qt.ToolButtonStyle.ToolButtonIconOnly) |
8143
2c730d5fd177
Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
119 | self.__superMenuButton.setFocusPolicy(Qt.FocusPolicy.NoFocus) |
5745
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
120 | self.__superMenuButton.setAutoRaise(True) |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
121 | self.__superMenuButton.setShowMenuInside(True) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
122 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
123 | self.__navigationSplitter = QSplitter(self) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
124 | urlBar = self.__mw.tabWidget().stackedUrlBar() |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
125 | self.__navigationSplitter.addWidget(urlBar) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
126 | |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
127 | self.__searchEdit = WebBrowserWebSearchWidget(self.__mw, self) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
128 | sizePolicy = QSizePolicy( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
129 | QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Preferred |
7268
a28338eaf694
Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
130 | ) |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
131 | sizePolicy.setHorizontalStretch(2) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
132 | sizePolicy.setVerticalStretch(0) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
133 | self.__searchEdit.setSizePolicy(sizePolicy) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
134 | self.__searchEdit.search.connect(self.__mw.openUrl) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
135 | self.__navigationSplitter.addWidget(self.__searchEdit) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
136 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
137 | self.__navigationSplitter.setSizePolicy( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
138 | QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Maximum |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
139 | ) |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
140 | self.__navigationSplitter.setCollapsible(0, False) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
141 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
142 | self.__layout.addLayout(self.__backNextLayout) |
5734
d8b99b5fa673
United the stop and reload buttons of the navigation bar.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5722
diff
changeset
|
143 | self.__layout.addWidget(self.__reloadStopButton) |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
144 | self.__layout.addWidget(self.__homeButton) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
145 | self.__layout.addWidget(self.__navigationSplitter) |
6134
cb0985e8da91
Introduced a navigation bar button to open the downloads manager window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
146 | self.__layout.addWidget(self.__downloadManagerButton) |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
147 | self.__layout.addWidget(self.__exitFullScreenButton) |
5745
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
148 | self.__layout.addWidget(self.__superMenuButton) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
149 | |
8143
2c730d5fd177
Changed the use of PyQt enums because the way they were used previously is deprecated since two years and replaced some deprecated Qt stuff.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
150 | self.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu) |
5745
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
151 | self.customContextMenuRequested.connect(self.__contextMenuRequested) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
152 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
153 | self.__backMenu = QMenu(self) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
154 | self.__backMenu.triggered.connect(self.__navigationMenuActionTriggered) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
155 | self.__backButton.setMenu(self.__backMenu) |
5745
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
156 | self.__backButton.aboutToShowMenu.connect(self.__showBackMenu) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
157 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
158 | self.__forwardMenu = QMenu(self) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
159 | self.__forwardMenu.triggered.connect(self.__navigationMenuActionTriggered) |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
160 | self.__forwardButton.setMenu(self.__forwardMenu) |
5745
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
161 | self.__forwardButton.aboutToShowMenu.connect(self.__showForwardMenu) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
162 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
163 | self.__backButton.clicked.connect(self.__goBack) |
5745
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
164 | self.__backButton.middleClicked.connect(self.__goBackInNewTab) |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
165 | self.__backButton.controlClicked.connect(self.__goBackInNewTab) |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
166 | self.__forwardButton.clicked.connect(self.__goForward) |
5745
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
167 | self.__forwardButton.middleClicked.connect(self.__goForwardInNewTab) |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
168 | self.__forwardButton.controlClicked.connect(self.__goForwardInNewTab) |
5734
d8b99b5fa673
United the stop and reload buttons of the navigation bar.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5722
diff
changeset
|
169 | self.__reloadStopButton.reloadClicked.connect(self.__reload) |
d8b99b5fa673
United the stop and reload buttons of the navigation bar.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5722
diff
changeset
|
170 | self.__reloadStopButton.stopClicked.connect(self.__stopLoad) |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
171 | self.__homeButton.clicked.connect(self.__goHome) |
5745
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
172 | self.__homeButton.middleClicked.connect(self.__goHomeInNewTab) |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
173 | self.__homeButton.controlClicked.connect(self.__goHomeInNewTab) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
174 | |
5745
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
175 | def superMenuButton(self): |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
176 | """ |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
177 | Public method to get a reference to the super menu button. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
178 | |
5745
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
179 | @return reference to the super menu button |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
180 | @rtype QToolButton |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
181 | """ |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
182 | return self.__superMenuButton |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
183 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
184 | def backButton(self): |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
185 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
186 | Public method to get a reference to the back button. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
187 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
188 | @return reference to the back button |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
189 | @rtype QToolButton |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
190 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
191 | return self.__backButton |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
192 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
193 | def forwardButton(self): |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
194 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
195 | Public method to get a reference to the forward button. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
196 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
197 | @return reference to the forward button |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
198 | @rtype QToolButton |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
199 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
200 | return self.__forwardButton |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
201 | |
5734
d8b99b5fa673
United the stop and reload buttons of the navigation bar.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5722
diff
changeset
|
202 | def reloadStopButton(self): |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
203 | """ |
5734
d8b99b5fa673
United the stop and reload buttons of the navigation bar.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5722
diff
changeset
|
204 | Public method to get a reference to the reload/stop button. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
205 | |
5734
d8b99b5fa673
United the stop and reload buttons of the navigation bar.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5722
diff
changeset
|
206 | @return reference to the reload/stop button |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
207 | @rtype QToolButton |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
208 | """ |
5734
d8b99b5fa673
United the stop and reload buttons of the navigation bar.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5722
diff
changeset
|
209 | return self.__reloadStopButton |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
210 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
211 | def exitFullScreenButton(self): |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
212 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
213 | Public method to get a reference to the exit full screen button. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
214 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
215 | @return reference to the exit full screen button |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
216 | @rtype QToolButton |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
217 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
218 | return self.__exitFullScreenButton |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
219 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
220 | def searchEdit(self): |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
221 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
222 | Public method to get a reference to the web search edit. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
223 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
224 | @return reference to the web search edit |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
225 | @rtype WebBrowserWebSearchWidget |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
226 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
227 | return self.__searchEdit |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
228 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
229 | def __showBackMenu(self): |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
230 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
231 | Private slot showing the backwards navigation menu. |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
232 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
233 | self.__backMenu.clear() |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
234 | history = self.__mw.currentBrowser().history() |
8220
006ee31b4835
Applied some more code simplifications suggested by the new Simplify checker (Y113: use enumerate()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8218
diff
changeset
|
235 | backItems = history.backItems(20) |
006ee31b4835
Applied some more code simplifications suggested by the new Simplify checker (Y113: use enumerate()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8218
diff
changeset
|
236 | # show max. 20 items |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
237 | |
8220
006ee31b4835
Applied some more code simplifications suggested by the new Simplify checker (Y113: use enumerate()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8218
diff
changeset
|
238 | for item in reversed(backItems): |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
239 | act = QAction(self) |
7578
13b2c2167c93
Web Browser: implemented a fix for QtWebEngine not sending the loadFinished signal when navigating on the same page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
240 | act.setData(item) |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
241 | icon = WebBrowserWindow.icon(item.url()) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
242 | act.setIcon(icon) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
243 | act.setText(item.title()) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
244 | self.__backMenu.addAction(act) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
245 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
246 | self.__backMenu.addSeparator() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
247 | self.__backMenu.addAction(self.tr("Clear History"), self.__clearHistory) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
248 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
249 | def __showForwardMenu(self): |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
250 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
251 | Private slot showing the forwards navigation menu. |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
252 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
253 | self.__forwardMenu.clear() |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
254 | history = self.__mw.currentBrowser().history() |
8220
006ee31b4835
Applied some more code simplifications suggested by the new Simplify checker (Y113: use enumerate()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8218
diff
changeset
|
255 | forwardItems = history.forwardItems(20) |
006ee31b4835
Applied some more code simplifications suggested by the new Simplify checker (Y113: use enumerate()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8218
diff
changeset
|
256 | # show max. 20 items |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
257 | |
8220
006ee31b4835
Applied some more code simplifications suggested by the new Simplify checker (Y113: use enumerate()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8218
diff
changeset
|
258 | for item in forwardItems: |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
259 | act = QAction(self) |
7578
13b2c2167c93
Web Browser: implemented a fix for QtWebEngine not sending the loadFinished signal when navigating on the same page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
260 | act.setData(item) |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
261 | icon = WebBrowserWindow.icon(item.url()) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
262 | act.setIcon(icon) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
263 | act.setText(item.title()) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
264 | self.__forwardMenu.addAction(act) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
265 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
266 | self.__forwardMenu.addSeparator() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
267 | self.__forwardMenu.addAction(self.tr("Clear History"), self.__clearHistory) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
268 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
269 | def __navigationMenuActionTriggered(self, act): |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
270 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
271 | Private slot to go to the selected page. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
272 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
273 | @param act reference to the action selected in the navigation menu |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
274 | (QAction) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
275 | """ |
7578
13b2c2167c93
Web Browser: implemented a fix for QtWebEngine not sending the loadFinished signal when navigating on the same page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
276 | historyItem = act.data() |
13b2c2167c93
Web Browser: implemented a fix for QtWebEngine not sending the loadFinished signal when navigating on the same page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
277 | if historyItem is not None: |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
278 | history = self.__mw.currentBrowser().history() |
7578
13b2c2167c93
Web Browser: implemented a fix for QtWebEngine not sending the loadFinished signal when navigating on the same page.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7533
diff
changeset
|
279 | history.goToItem(historyItem) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
280 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
281 | def __goBack(self): |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
282 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
283 | Private slot called to handle the backward button. |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
284 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
285 | self.__mw.currentBrowser().backward() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
286 | |
5745
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
287 | def __goBackInNewTab(self): |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
288 | """ |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
289 | Private slot handling a middle click or Ctrl left click of the |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
290 | backward button. |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
291 | """ |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
292 | history = self.__mw.currentBrowser().history() |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
293 | if history.canGoBack(): |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
294 | backItem = history.backItem() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
295 | self.__mw.newTab( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
296 | link=backItem.url(), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
297 | addNextTo=self.__mw.currentBrowser(), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
298 | background=True, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
299 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
300 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
301 | def __goForward(self): |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
302 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
303 | Private slot called to handle the forward button. |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
304 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
305 | self.__mw.currentBrowser().forward() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
306 | |
5745
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
307 | def __goForwardInNewTab(self): |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
308 | """ |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
309 | Private slot handling a middle click or Ctrl left click of the |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
310 | forward button. |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
311 | """ |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
312 | history = self.__mw.currentBrowser().history() |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
313 | if history.canGoForward(): |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
314 | forwardItem = history.forwardItem() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
315 | self.__mw.newTab( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
316 | link=forwardItem.url(), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
317 | addNextTo=self.__mw.currentBrowser(), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
318 | background=True, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
319 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
320 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
321 | def __goHome(self): |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
322 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
323 | Private slot called to handle the home button. |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
324 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
325 | self.__mw.currentBrowser().home() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
326 | |
5745
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
327 | def __goHomeInNewTab(self): |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
328 | """ |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
329 | Private slot handling a middle click or Ctrl left click of the |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
330 | home button. |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
331 | """ |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
332 | homeUrl = QUrl(Preferences.getWebBrowser("HomePage")) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
333 | self.__mw.newTab( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
334 | link=homeUrl, addNextTo=self.__mw.currentBrowser(), background=True |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
335 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
336 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
337 | def __reload(self): |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
338 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
339 | Private slot called to handle the reload button. |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
340 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
341 | self.__mw.currentBrowser().reloadBypassingCache() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
342 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
343 | def __stopLoad(self): |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
344 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
345 | Private slot called to handle loading of the current page. |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
346 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
347 | self.__mw.currentBrowser().stop() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
348 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
349 | def __clearHistory(self): |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
350 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
351 | Private slot to clear the history of the current web browser tab. |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
352 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
353 | cb = self.__mw.currentBrowser() |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
354 | if cb is not None: |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
355 | cb.history().clear() |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
356 | self.__mw.setForwardAvailable(cb.isForwardAvailable()) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
357 | self.__mw.setBackwardAvailable(cb.isBackwardAvailable()) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
358 | |
5745
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
359 | def __contextMenuRequested(self, pos): |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
360 | """ |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
361 | Private method to handle a context menu request. |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
362 | |
5745
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
363 | @param pos position of the request |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
364 | @type QPoint |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
365 | """ |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
366 | menu = self.__mw.createPopupMenu() |
7759
51aa6c6b66f7
Changed calls to exec_() into exec() (remainder of Python2 elimination).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7578
diff
changeset
|
367 | menu.exec(self.mapToGlobal(pos)) |