Fri, 04 Nov 2022 13:52:26 +0100
Resorted the import statements using isort.
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 | |
8881
54e42bc2437a
Updated copyright for 2022.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
3 | # Copyright (c) 2017 - 2022 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 |
9473
3f23dbf37dbe
Resorted the import statements using isort.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9413
diff
changeset
|
26 | 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
|
27 | |
5734
d8b99b5fa673
United the stop and reload buttons of the navigation bar.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5722
diff
changeset
|
28 | 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
|
29 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
30 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
31 | 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
|
32 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
33 | 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
|
34 | """ |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
35 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
36 | 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
|
37 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
38 | Constructor |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
39 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
40 | @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
|
41 | @type WebBrowserWindow |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
42 | @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
|
43 | @type QWidget |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
44 | """ |
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
|
45 | 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
|
46 | self.setObjectName("navigationbar") |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
47 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
48 | self.__mw = mainWindow |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
49 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
50 | 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
|
51 | margin = self.style().pixelMetric( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
52 | 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
|
53 | ) |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
54 | 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
|
55 | 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
|
56 | self.style().pixelMetric( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
57 | 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
|
58 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
59 | ) |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
60 | self.setLayout(self.__layout) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
61 | |
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
|
62 | 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
|
63 | 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
|
64 | 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
|
65 | 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
|
66 | 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
|
67 | 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
|
68 | 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
|
69 | self.__backButton.setEnabled(False) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
70 | |
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
|
71 | 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
|
72 | 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
|
73 | 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
|
74 | 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
|
75 | 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
|
76 | 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
|
77 | 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
|
78 | self.__forwardButton.setEnabled(False) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
79 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
80 | 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
|
81 | 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
|
82 | 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
|
83 | 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
|
84 | 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
|
85 | |
5734
d8b99b5fa673
United the stop and reload buttons of the navigation bar.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5722
diff
changeset
|
86 | self.__reloadStopButton = ReloadStopButton(self) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
87 | |
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
|
88 | 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
|
89 | 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
|
90 | 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
|
91 | 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
|
92 | 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
|
93 | 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
|
94 | 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
|
95 | |
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
|
96 | self.__exitFullScreenButton = EricToolButton(self) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
97 | 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
|
98 | 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
|
99 | 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
|
100 | self.__exitFullScreenButton.setToolButtonStyle( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
101 | Qt.ToolButtonStyle.ToolButtonIconOnly |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
102 | ) |
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
|
103 | 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
|
104 | 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
|
105 | 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
|
106 | self.__exitFullScreenButton.setVisible(False) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
107 | |
6134
cb0985e8da91
Introduced a navigation bar button to open the downloads manager window.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
6048
diff
changeset
|
108 | self.__downloadManagerButton = DownloadManagerButton(self) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
109 | |
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
|
110 | self.__superMenuButton = EricToolButton(self) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
111 | 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
|
112 | 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
|
113 | 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
|
114 | self.__superMenuButton.setPopupMode( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
115 | QToolButton.ToolButtonPopupMode.InstantPopup |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
116 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
117 | 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
|
118 | 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
|
119 | self.__superMenuButton.setAutoRaise(True) |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
120 | self.__superMenuButton.setShowMenuInside(True) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
121 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
122 | 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
|
123 | 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
|
124 | self.__navigationSplitter.addWidget(urlBar) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
125 | |
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
|
126 | from eric7.WebBrowser.WebBrowserWebSearchWidget import WebBrowserWebSearchWidget |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
127 | |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
128 | 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
|
129 | sizePolicy = QSizePolicy( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
130 | 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
|
131 | ) |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
132 | 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
|
133 | 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
|
134 | 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
|
135 | 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
|
136 | 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
|
137 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
138 | self.__navigationSplitter.setSizePolicy( |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
139 | 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
|
140 | ) |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
141 | 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
|
142 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
143 | 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
|
144 | 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
|
145 | 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
|
146 | 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
|
147 | 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
|
148 | 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
|
149 | 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
|
150 | |
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
|
151 | 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
|
152 | 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
|
153 | |
5722
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 = QMenu(self) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
155 | 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
|
156 | 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
|
157 | 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
|
158 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
159 | self.__forwardMenu = QMenu(self) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
160 | 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
|
161 | 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
|
162 | 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
|
163 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
164 | 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
|
165 | 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
|
166 | 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
|
167 | 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
|
168 | 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
|
169 | 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
|
170 | 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
|
171 | 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
|
172 | 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
|
173 | 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
|
174 | 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
|
175 | |
5745
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
176 | def superMenuButton(self): |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
177 | """ |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
178 | 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
|
179 | |
5745
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
180 | @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
|
181 | @rtype QToolButton |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
182 | """ |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
183 | return self.__superMenuButton |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
184 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
185 | 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
|
186 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
187 | 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
|
188 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
189 | @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
|
190 | @rtype QToolButton |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
191 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
192 | return self.__backButton |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
193 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
194 | 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
|
195 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
196 | 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
|
197 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
198 | @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
|
199 | @rtype QToolButton |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
200 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
201 | return self.__forwardButton |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
202 | |
5734
d8b99b5fa673
United the stop and reload buttons of the navigation bar.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5722
diff
changeset
|
203 | 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
|
204 | """ |
5734
d8b99b5fa673
United the stop and reload buttons of the navigation bar.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5722
diff
changeset
|
205 | 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
|
206 | |
5734
d8b99b5fa673
United the stop and reload buttons of the navigation bar.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5722
diff
changeset
|
207 | @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
|
208 | @rtype QToolButton |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
209 | """ |
5734
d8b99b5fa673
United the stop and reload buttons of the navigation bar.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5722
diff
changeset
|
210 | return self.__reloadStopButton |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
211 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
212 | 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
|
213 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
214 | 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
|
215 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
216 | @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
|
217 | @rtype QToolButton |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
218 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
219 | return self.__exitFullScreenButton |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
220 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
221 | 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
|
222 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
223 | 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
|
224 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
225 | @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
|
226 | @rtype WebBrowserWebSearchWidget |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
227 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
228 | return self.__searchEdit |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
229 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
230 | 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
|
231 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
232 | 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
|
233 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
234 | 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
|
235 | 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
|
236 | 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
|
237 | # show max. 20 items |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
238 | |
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
|
239 | 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
|
240 | 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
|
241 | 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
|
242 | 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
|
243 | 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
|
244 | 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
|
245 | self.__backMenu.addAction(act) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
246 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
247 | self.__backMenu.addSeparator() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
248 | 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
|
249 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
250 | 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
|
251 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
252 | 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
|
253 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
254 | 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
|
255 | 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
|
256 | 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
|
257 | # show max. 20 items |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
258 | |
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
|
259 | 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
|
260 | 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
|
261 | 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
|
262 | 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
|
263 | 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
|
264 | 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
|
265 | self.__forwardMenu.addAction(act) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
266 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
267 | self.__forwardMenu.addSeparator() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
268 | 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
|
269 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
270 | 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
|
271 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
272 | 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
|
273 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
274 | @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
|
275 | (QAction) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
276 | """ |
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
|
277 | 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
|
278 | 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
|
279 | 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
|
280 | history.goToItem(historyItem) |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
281 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
282 | 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
|
283 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
284 | 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
|
285 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
286 | self.__mw.currentBrowser().backward() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
287 | |
5745
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
288 | def __goBackInNewTab(self): |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
289 | """ |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
290 | 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
|
291 | backward button. |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
292 | """ |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
293 | 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
|
294 | if history.canGoBack(): |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
295 | backItem = history.backItem() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
296 | self.__mw.newTab( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
297 | link=backItem.url(), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
298 | addNextTo=self.__mw.currentBrowser(), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
299 | background=True, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
300 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
301 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
302 | 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
|
303 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
304 | 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
|
305 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
306 | self.__mw.currentBrowser().forward() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
307 | |
5745
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
308 | def __goForwardInNewTab(self): |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
309 | """ |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
310 | 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
|
311 | forward button. |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
312 | """ |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
313 | 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
|
314 | if history.canGoForward(): |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
315 | forwardItem = history.forwardItem() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
316 | self.__mw.newTab( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
317 | link=forwardItem.url(), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
318 | addNextTo=self.__mw.currentBrowser(), |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
319 | background=True, |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
320 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
321 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
322 | 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
|
323 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
324 | 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
|
325 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
326 | self.__mw.currentBrowser().home() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
327 | |
5745
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
328 | def __goHomeInNewTab(self): |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
329 | """ |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
330 | 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
|
331 | home button. |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
332 | """ |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
333 | 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
|
334 | self.__mw.newTab( |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
335 | 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
|
336 | ) |
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
337 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
338 | 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
|
339 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
340 | 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
|
341 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
342 | self.__mw.currentBrowser().reloadBypassingCache() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
343 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
344 | 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
|
345 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
346 | 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
|
347 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
348 | self.__mw.currentBrowser().stop() |
9221
bf71ee032bb4
Reformatted the source code using the 'Black' utility.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
9209
diff
changeset
|
349 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
350 | 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
|
351 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
352 | 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
|
353 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
354 | 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
|
355 | 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
|
356 | 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
|
357 | 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
|
358 | 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
|
359 | |
5745
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
360 | def __contextMenuRequested(self, pos): |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
361 | """ |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
362 | 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
|
363 | |
5745
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
364 | @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
|
365 | @type QPoint |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
366 | """ |
4f4316e83318
-- added a super menu to modernize the look & feel
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5734
diff
changeset
|
367 | 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
|
368 | menu.exec(self.mapToGlobal(pos)) |