Sat, 13 May 2017 12:09:45 +0200
United the stop and reload buttons of the navigation bar.
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 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
3 | # Copyright (c) 2017 Detlev Offenbach <detlev@die-offenbachs.de> |
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 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
10 | from __future__ import unicode_literals |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
11 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
12 | from PyQt5.QtCore import Qt |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
13 | from PyQt5.QtWidgets import QWidget, QHBoxLayout, QStyle, QToolButton, \ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
14 | QSplitter, QSizePolicy, QMenu, QAction |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
15 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
16 | from WebBrowser.WebBrowserWindow import WebBrowserWindow |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
17 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
18 | import UI.PixmapCache |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
19 | |
5734
d8b99b5fa673
United the stop and reload buttons of the navigation bar.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5722
diff
changeset
|
20 | 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
|
21 | |
5722
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
22 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
23 | 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
|
24 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
25 | 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
|
26 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
27 | 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
|
28 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
29 | Constructor |
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 | @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
|
32 | @type WebBrowserWindow |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
33 | @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
|
34 | @type QWidget |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
35 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
36 | super(NavigationBar, self).__init__(parent) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
37 | self.setObjectName("navigationbar") |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
38 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
39 | self.__mw = mainWindow |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
40 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
41 | self.__layout = QHBoxLayout(self) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
42 | margin = self.style().pixelMetric(QStyle.PM_ToolBarItemMargin, None, |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
43 | self) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
44 | 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
|
45 | self.__layout.setSpacing( |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
46 | self.style().pixelMetric(QStyle.PM_ToolBarItemSpacing, None, self)) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
47 | self.setLayout(self.__layout) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
48 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
49 | self.__backButton = QToolButton(self) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
50 | 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
|
51 | self.__backButton.setToolTip(self.tr("Move one screen backward")) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
52 | self.__backButton.setToolButtonStyle(Qt.ToolButtonIconOnly) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
53 | self.__backButton.setFocusPolicy(Qt.NoFocus) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
54 | self.__backButton.setAutoRaise(True) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
55 | self.__backButton.setIcon( |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
56 | UI.PixmapCache.getIcon("back.png")) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
57 | self.__backButton.setEnabled(False) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
58 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
59 | self.__forwardButton = QToolButton(self) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
60 | 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
|
61 | self.__forwardButton.setToolTip(self.tr("Move one screen forward")) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
62 | self.__forwardButton.setToolButtonStyle(Qt.ToolButtonIconOnly) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
63 | self.__forwardButton.setFocusPolicy(Qt.NoFocus) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
64 | self.__forwardButton.setAutoRaise(True) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
65 | self.__forwardButton.setIcon( |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
66 | UI.PixmapCache.getIcon("forward.png")) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
67 | self.__forwardButton.setEnabled(False) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
68 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
69 | 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
|
70 | 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
|
71 | 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
|
72 | 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
|
73 | self.__backNextLayout.addWidget(self.__forwardButton) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
74 | |
5734
d8b99b5fa673
United the stop and reload buttons of the navigation bar.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5722
diff
changeset
|
75 | self.__reloadStopButton = 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
|
76 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
77 | self.__homeButton = QToolButton(self) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
78 | 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
|
79 | self.__homeButton.setToolTip(self.tr("Move to the initial screen")) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
80 | self.__homeButton.setToolButtonStyle(Qt.ToolButtonIconOnly) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
81 | self.__homeButton.setFocusPolicy(Qt.NoFocus) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
82 | self.__homeButton.setAutoRaise(True) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
83 | self.__homeButton.setIcon( |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
84 | UI.PixmapCache.getIcon("home.png")) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
85 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
86 | self.__exitFullScreenButton = QToolButton(self) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
87 | self.__exitFullScreenButton.setObjectName( |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
88 | "navigation_exitfullscreen_button") |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
89 | self.__exitFullScreenButton.setToolTip(self.tr("Exit Fullscreen")) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
90 | self.__exitFullScreenButton.setToolButtonStyle(Qt.ToolButtonIconOnly) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
91 | self.__exitFullScreenButton.setFocusPolicy(Qt.NoFocus) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
92 | 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
|
93 | self.__exitFullScreenButton.setIcon( |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
94 | UI.PixmapCache.getIcon("windowRestore.png")) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
95 | 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
|
96 | self.__exitFullScreenButton.setVisible(False) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
97 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
98 | 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
|
99 | 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
|
100 | self.__navigationSplitter.addWidget(urlBar) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
101 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
102 | from WebBrowser.WebBrowserWebSearchWidget import \ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
103 | WebBrowserWebSearchWidget |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
104 | self.__searchEdit = WebBrowserWebSearchWidget(self.__mw, self) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
105 | sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Preferred) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
106 | 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
|
107 | 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
|
108 | 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
|
109 | 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
|
110 | self.__navigationSplitter.addWidget(self.__searchEdit) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
111 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
112 | self.__navigationSplitter.setSizePolicy( |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
113 | QSizePolicy.Expanding, QSizePolicy.Maximum) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
114 | self.__navigationSplitter.setCollapsible(0, False) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
115 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
116 | 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
|
117 | 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
|
118 | 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
|
119 | self.__layout.addWidget(self.__navigationSplitter) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
120 | self.__layout.addWidget(self.__exitFullScreenButton) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
121 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
122 | 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
|
123 | self.__backMenu.aboutToShow.connect(self.__showBackMenu) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
124 | 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
|
125 | self.__backButton.setMenu(self.__backMenu) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
126 | self.__backButton.setPopupMode(QToolButton.MenuButtonPopup) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
127 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
128 | self.__forwardMenu = QMenu(self) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
129 | self.__forwardMenu.aboutToShow.connect(self.__showForwardMenu) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
130 | self.__forwardMenu.triggered.connect( |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
131 | self.__navigationMenuActionTriggered) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
132 | self.__forwardButton.setMenu(self.__forwardMenu) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
133 | self.__forwardButton.setPopupMode(QToolButton.MenuButtonPopup) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
134 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
135 | self.__backButton.clicked.connect(self.__goBack) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
136 | self.__forwardButton.clicked.connect(self.__goForward) |
5734
d8b99b5fa673
United the stop and reload buttons of the navigation bar.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5722
diff
changeset
|
137 | 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
|
138 | 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
|
139 | self.__homeButton.clicked.connect(self.__goHome) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
140 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
141 | 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
|
142 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
143 | Public method to get a 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
|
144 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
145 | @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
|
146 | @rtype QToolButton |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
147 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
148 | return self.__backButton |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
149 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
150 | 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
|
151 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
152 | Public method to get a 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
|
153 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
154 | @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
|
155 | @rtype QToolButton |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
156 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
157 | return self.__forwardButton |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
158 | |
5734
d8b99b5fa673
United the stop and reload buttons of the navigation bar.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5722
diff
changeset
|
159 | 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
|
160 | """ |
5734
d8b99b5fa673
United the stop and reload buttons of the navigation bar.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5722
diff
changeset
|
161 | Public method to get a 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
|
162 | |
5734
d8b99b5fa673
United the stop and reload buttons of the navigation bar.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5722
diff
changeset
|
163 | @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
|
164 | @rtype QToolButton |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
165 | """ |
5734
d8b99b5fa673
United the stop and reload buttons of the navigation bar.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
5722
diff
changeset
|
166 | return 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
|
167 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
168 | 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
|
169 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
170 | Public method to get a 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
|
171 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
172 | @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
|
173 | @rtype QToolButton |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
174 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
175 | return self.__exitFullScreenButton |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
176 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
177 | 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
|
178 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
179 | Public method to get a 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
|
180 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
181 | @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
|
182 | @rtype WebBrowserWebSearchWidget |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
183 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
184 | return self.__searchEdit |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
185 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
186 | 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
|
187 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
188 | 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
|
189 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
190 | 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
|
191 | history = self.__mw.currentBrowser().history() |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
192 | historyCount = history.count() |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
193 | backItems = history.backItems(historyCount) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
194 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
195 | count = 0 |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
196 | for index in range(len(backItems) - 1, -1, -1): |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
197 | item = backItems[index] |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
198 | act = QAction(self) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
199 | act.setData(-1 * (index + 1)) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
200 | 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
|
201 | 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
|
202 | 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
|
203 | self.__backMenu.addAction(act) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
204 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
205 | count += 1 |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
206 | if count == 20: |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
207 | break |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
208 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
209 | self.__backMenu.addSeparator() |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
210 | self.__backMenu.addAction(self.tr("Clear History"), |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
211 | self.__clearHistory) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
212 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
213 | 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
|
214 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
215 | 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
|
216 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
217 | 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
|
218 | history = self.__mw.currentBrowser().history() |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
219 | historyCount = history.count() |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
220 | forwardItems = history.forwardItems(historyCount) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
221 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
222 | count = 0 |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
223 | for index in range(len(forwardItems)): |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
224 | item = forwardItems[index] |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
225 | act = QAction(self) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
226 | act.setData(index + 1) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
227 | 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
|
228 | 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
|
229 | 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
|
230 | self.__forwardMenu.addAction(act) |
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 | count += 1 |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
233 | if count == 20: |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
234 | break |
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.__forwardMenu.addSeparator() |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
237 | self.__forwardMenu.addAction(self.tr("Clear History"), |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
238 | self.__clearHistory) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
239 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
240 | 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
|
241 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
242 | Private slot to go to the selected page. |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
243 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
244 | @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
|
245 | (QAction) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
246 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
247 | offset = act.data() |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
248 | if offset 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
|
249 | history = self.__mw.currentBrowser().history() |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
250 | historyCount = history.count() |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
251 | if offset < 0: |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
252 | # go back |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
253 | history.goToItem( |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
254 | history.backItems(historyCount)[-1 * offset - 1]) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
255 | else: |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
256 | # go forward |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
257 | history.goToItem( |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
258 | history.forwardItems(historyCount)[offset - 1]) |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
259 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
260 | 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
|
261 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
262 | 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
|
263 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
264 | self.__mw.currentBrowser().backward() |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
265 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
266 | 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
|
267 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
268 | 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
|
269 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
270 | self.__mw.currentBrowser().forward() |
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 | 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
|
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 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
|
275 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
276 | self.__mw.currentBrowser().home() |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
277 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
278 | 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
|
279 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
280 | 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
|
281 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
282 | self.__mw.currentBrowser().reloadBypassingCache() |
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 | 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
|
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 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
|
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().stop() |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
289 | |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
290 | 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
|
291 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
292 | 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
|
293 | """ |
433187e73c0f
Further improvements to the full screen handling of the web browser NG.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
294 | 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
|
295 | 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
|
296 | 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
|
297 | 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
|
298 | self.__mw.setBackwardAvailable(cb.isBackwardAvailable()) |