src/eric7/WebBrowser/Navigation/NavigationBar.py

Tue, 18 Oct 2022 16:06:21 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Tue, 18 Oct 2022 16:06:21 +0200
branch
eric7
changeset 9413
80c06d472826
parent 9221
bf71ee032bb4
child 9473
3f23dbf37dbe
permissions
-rw-r--r--

Changed the eric7 import statements to include the package name (i.e. eric7) in order to not fiddle with sys.path.

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

eric ide

mercurial