6629:643ec3a53d17 | 6630:bddd12f27a4c |
---|---|
14 pass | 14 pass |
15 | 15 |
16 import os | 16 import os |
17 | 17 |
18 from PyQt5.QtCore import pyqtSlot, pyqtSignal, Qt, QByteArray, QSize, QTimer, \ | 18 from PyQt5.QtCore import pyqtSlot, pyqtSignal, Qt, QByteArray, QSize, QTimer, \ |
19 QUrl, QThread, QTextCodec | 19 QUrl, QThread, QTextCodec, QFileInfo |
20 from PyQt5.QtGui import QDesktopServices, QKeySequence, QFont, QFontMetrics, \ | 20 from PyQt5.QtGui import QDesktopServices, QKeySequence, QFont, QFontMetrics, \ |
21 QIcon | 21 QIcon |
22 from PyQt5.QtWidgets import QWidget, QVBoxLayout, QSizePolicy, QDockWidget, \ | 22 from PyQt5.QtWidgets import QWidget, QVBoxLayout, QSizePolicy, QDockWidget, \ |
23 QComboBox, QLabel, QSplitter, QMenu, QToolButton, QLineEdit, \ | 23 QComboBox, QLabel, QSplitter, QMenu, QToolButton, QLineEdit, \ |
24 QApplication, QWhatsThis, QDialog, QHBoxLayout, QProgressBar, QAction, \ | 24 QApplication, QWhatsThis, QDialog, QHBoxLayout, QProgressBar, QAction, \ |
54 | 54 |
55 import UI.PixmapCache | 55 import UI.PixmapCache |
56 import UI.Config | 56 import UI.Config |
57 from UI.Info import Version | 57 from UI.Info import Version |
58 | 58 |
59 from .HelpSingleApplication import HelpSingleApplicationServer | |
60 | |
59 | 61 |
60 class HelpWindow(E5MainWindow): | 62 class HelpWindow(E5MainWindow): |
61 """ | 63 """ |
62 Class implementing the web browser main window. | 64 Class implementing the web browser main window. |
63 | 65 |
70 helpClosed = pyqtSignal() | 72 helpClosed = pyqtSignal() |
71 privacyChanged = pyqtSignal(bool) | 73 privacyChanged = pyqtSignal(bool) |
72 | 74 |
73 helpwindows = [] | 75 helpwindows = [] |
74 | 76 |
75 _fromEric = False | |
76 _useQtHelp = QTHELP_AVAILABLE | 77 _useQtHelp = QTHELP_AVAILABLE |
77 | 78 |
78 _networkAccessManager = None | 79 _networkAccessManager = None |
79 _cookieJar = None | 80 _cookieJar = None |
80 _helpEngine = None | 81 _helpEngine = None |
92 _notification = None | 93 _notification = None |
93 _featurePermissionManager = None | 94 _featurePermissionManager = None |
94 _flashCookieManager = None | 95 _flashCookieManager = None |
95 _zoomManager = None | 96 _zoomManager = None |
96 | 97 |
97 def __init__(self, home, path, parent, name, fromEric=False, | 98 def __init__(self, home, path, parent, name, |
98 initShortcutsOnly=False, searchWord=None): | 99 searchWord=None, qthelp=False, single=False, saname=""): |
99 """ | 100 """ |
100 Constructor | 101 Constructor |
101 | 102 |
102 @param home the URL to be shown (string) | 103 @param home the URL to be shown |
103 @param path the path of the working dir (usually '.') (string) | 104 @type str |
104 @param parent parent widget of this window (QWidget) | 105 @param path the path of the working dir (usually '.') |
105 @param name name of this window (string) | 106 @type str |
106 @param fromEric flag indicating whether it was called from within | 107 @param parent parent widget of this window |
107 eric6 (boolean) | 108 @type QWidget |
108 @keyparam initShortcutsOnly flag indicating to just initialize the | 109 @param name name of this window |
109 keyboard shortcuts (boolean) | 110 @type str |
110 @keyparam searchWord word to search for (string) | 111 @param searchWord word to search for |
112 @type str | |
113 @param qthelp flag indicating to enable the QtHelp support | |
114 @type bool | |
115 @param single flag indicating to start in single application mode | |
116 @type bool | |
117 @param saname name to be used for the single application server | |
118 @type str | |
111 """ | 119 """ |
112 super(HelpWindow, self).__init__(parent) | 120 super(HelpWindow, self).__init__(parent) |
113 self.setObjectName(name) | 121 self.setObjectName(name) |
114 self.setWindowTitle(self.tr("eric6 Web Browser")) | 122 self.setWindowTitle(self.tr("eric6 Web Browser")) |
115 | 123 |
116 self.fromEric = fromEric | |
117 self.__class__._fromEric = fromEric | |
118 self.initShortcutsOnly = initShortcutsOnly | |
119 self.setWindowIcon(UI.PixmapCache.getIcon("ericWeb.png")) | 124 self.setWindowIcon(UI.PixmapCache.getIcon("ericWeb.png")) |
120 | 125 |
121 self.mHistory = [] | 126 self.mHistory = [] |
122 self.__lastConfigurationPageName = "" | 127 self.__lastConfigurationPageName = "" |
123 self.__lastActiveWindow = None | 128 self.__lastActiveWindow = None |
124 | 129 |
130 self.__shortcutsDialog = None | |
131 | |
125 self.__eventMouseButtons = Qt.NoButton | 132 self.__eventMouseButtons = Qt.NoButton |
126 self.__eventKeyboardModifiers = Qt.NoModifier | 133 self.__eventKeyboardModifiers = Qt.NoModifier |
127 | 134 |
128 if self.initShortcutsOnly: | 135 HelpWindow.setUseQtHelp(qthelp or bool(searchWord)) |
129 self.__initActions() | 136 |
137 from .SearchWidget import SearchWidget | |
138 from .HelpTocWidget import HelpTocWidget | |
139 from .HelpIndexWidget import HelpIndexWidget | |
140 from .HelpSearchWidget import HelpSearchWidget | |
141 from .HelpBrowserWV import HelpBrowser | |
142 from .HelpTabWidget import HelpTabWidget | |
143 from .AdBlock.AdBlockIcon import AdBlockIcon | |
144 from .VirusTotal.VirusTotalApi import VirusTotalAPI | |
145 | |
146 self.setStyle(Preferences.getUI("Style"), | |
147 Preferences.getUI("StyleSheet")) | |
148 | |
149 # initialize some SSL stuff | |
150 from E5Network.E5SslUtilities import initSSL | |
151 initSSL() | |
152 | |
153 if HelpWindow._useQtHelp: | |
154 self.__helpEngine = QHelpEngine( | |
155 HelpWindow.getQtHelpCollectionFileName(), | |
156 self) | |
157 self.__removeOldDocumentation() | |
158 self.__helpEngine.warning.connect(self.__warning) | |
130 else: | 159 else: |
131 from .SearchWidget import SearchWidget | 160 self.__helpEngine = None |
132 from .HelpTocWidget import HelpTocWidget | 161 self.__helpInstaller = None |
133 from .HelpIndexWidget import HelpIndexWidget | 162 |
134 from .HelpSearchWidget import HelpSearchWidget | 163 self.__zoomWidget = E5ZoomWidget( |
135 from .HelpBrowserWV import HelpBrowser | 164 UI.PixmapCache.getPixmap("zoomOut.png"), |
136 from .HelpTabWidget import HelpTabWidget | 165 UI.PixmapCache.getPixmap("zoomIn.png"), |
137 from .AdBlock.AdBlockIcon import AdBlockIcon | 166 UI.PixmapCache.getPixmap("zoomReset.png"), self) |
138 from .VirusTotal.VirusTotalApi import VirusTotalAPI | 167 self.statusBar().addPermanentWidget(self.__zoomWidget) |
168 self.__zoomWidget.setMapping( | |
169 HelpBrowser.ZoomLevels, HelpBrowser.ZoomLevelDefault) | |
170 self.__zoomWidget.valueChanged.connect(self.__zoomValueChanged) | |
171 | |
172 self.tabWidget = HelpTabWidget(self) | |
173 self.tabWidget.currentChanged[int].connect(self.__currentChanged) | |
174 self.tabWidget.titleChanged.connect(self.__titleChanged) | |
175 self.tabWidget.showMessage.connect(self.statusBar().showMessage) | |
176 self.tabWidget.browserZoomValueChanged.connect( | |
177 self.__zoomWidget.setValue) | |
178 | |
179 self.findDlg = SearchWidget(self, self) | |
180 centralWidget = QWidget() | |
181 layout = QVBoxLayout() | |
182 layout.setContentsMargins(1, 1, 1, 1) | |
183 layout.addWidget(self.tabWidget) | |
184 layout.addWidget(self.findDlg) | |
185 self.tabWidget.setSizePolicy( | |
186 QSizePolicy.Preferred, QSizePolicy.Expanding) | |
187 centralWidget.setLayout(layout) | |
188 self.setCentralWidget(centralWidget) | |
189 self.findDlg.hide() | |
190 | |
191 if HelpWindow._useQtHelp: | |
192 # setup the TOC widget | |
193 self.__tocWindow = HelpTocWidget(self.__helpEngine, self) | |
194 self.__tocDock = QDockWidget(self.tr("Contents"), self) | |
195 self.__tocDock.setObjectName("TocWindow") | |
196 self.__tocDock.setWidget(self.__tocWindow) | |
197 self.addDockWidget(Qt.LeftDockWidgetArea, self.__tocDock) | |
139 | 198 |
140 HelpWindow.setUseQtHelp(self.fromEric) | 199 # setup the index widget |
200 self.__indexWindow = HelpIndexWidget(self.__helpEngine, self) | |
201 self.__indexDock = QDockWidget(self.tr("Index"), self) | |
202 self.__indexDock.setObjectName("IndexWindow") | |
203 self.__indexDock.setWidget(self.__indexWindow) | |
204 self.addDockWidget(Qt.LeftDockWidgetArea, self.__indexDock) | |
141 | 205 |
142 if not self.fromEric: | 206 # setup the search widget |
143 self.setStyle(Preferences.getUI("Style"), | 207 self.__searchWord = searchWord |
144 Preferences.getUI("StyleSheet")) | 208 self.__indexing = False |
145 | 209 self.__indexingProgress = None |
146 # initialize some SSL stuff | 210 self.__searchEngine = self.__helpEngine.searchEngine() |
147 from E5Network.E5SslUtilities import initSSL | 211 self.__searchEngine.indexingStarted.connect( |
148 initSSL() | 212 self.__indexingStarted) |
213 self.__searchEngine.indexingFinished.connect( | |
214 self.__indexingFinished) | |
215 self.__searchWindow = HelpSearchWidget( | |
216 self.__searchEngine, self) | |
217 self.__searchDock = QDockWidget(self.tr("Search"), self) | |
218 self.__searchDock.setObjectName("SearchWindow") | |
219 self.__searchDock.setWidget(self.__searchWindow) | |
220 self.addDockWidget(Qt.LeftDockWidgetArea, self.__searchDock) | |
221 | |
222 if Preferences.getHelp("SaveGeometry"): | |
223 g = Preferences.getGeometry("HelpViewerGeometry") | |
224 else: | |
225 g = QByteArray() | |
226 if g.isEmpty(): | |
227 s = QSize(800, 800) | |
228 self.resize(s) | |
229 else: | |
230 self.restoreGeometry(g) | |
231 | |
232 self.__setIconDatabasePath() | |
233 self.__initWebSettings() | |
234 | |
235 self.__initActions() | |
236 self.__initMenus() | |
237 self.__initToolbars() | |
238 | |
239 self.historyManager() | |
240 | |
241 syncMgr = self.syncManager() | |
242 syncMgr.syncMessage.connect(self.statusBar().showMessage) | |
243 syncMgr.syncError.connect(self.statusBar().showMessage) | |
244 | |
245 self.tabWidget.newBrowser(home) | |
246 self.tabWidget.currentBrowser().setFocus() | |
247 | |
248 self.__class__.helpwindows.append(self) | |
249 | |
250 self.__adBlockIcon = AdBlockIcon(self) | |
251 self.statusBar().addPermanentWidget(self.__adBlockIcon) | |
252 self.__adBlockIcon.setEnabled( | |
253 Preferences.getHelp("AdBlockEnabled")) | |
254 self.tabWidget.currentChanged[int].connect( | |
255 self.__adBlockIcon.currentChanged) | |
256 self.tabWidget.sourceChanged.connect( | |
257 self.__adBlockIcon.sourceChanged) | |
258 | |
259 self.networkIcon = E5NetworkIcon(self) | |
260 self.statusBar().addPermanentWidget(self.networkIcon) | |
261 | |
262 if len(HelpWindow.helpwindows): | |
263 QDesktopServices.setUrlHandler( | |
264 "http", HelpWindow.helpwindows[0].urlHandler) | |
265 QDesktopServices.setUrlHandler( | |
266 "https", HelpWindow.helpwindows[0].urlHandler) | |
267 | |
268 # setup connections | |
269 self.__activating = False | |
270 if HelpWindow._useQtHelp: | |
271 # TOC window | |
272 self.__tocWindow.linkActivated.connect(self.__linkActivated) | |
273 self.__tocWindow.escapePressed.connect( | |
274 self.__activateCurrentBrowser) | |
149 | 275 |
150 if HelpWindow._useQtHelp: | 276 # index window |
151 self.__helpEngine = QHelpEngine( | 277 self.__indexWindow.linkActivated.connect(self.__linkActivated) |
152 HelpWindow.getQtHelpCollectionFileName(), | 278 self.__indexWindow.linksActivated.connect( |
153 self) | 279 self.__linksActivated) |
154 self.__removeOldDocumentation() | 280 self.__indexWindow.escapePressed.connect( |
155 self.__helpEngine.warning.connect(self.__warning) | 281 self.__activateCurrentBrowser) |
156 else: | |
157 self.__helpEngine = None | |
158 self.__helpInstaller = None | |
159 | 282 |
160 self.__zoomWidget = E5ZoomWidget( | 283 # search window |
161 UI.PixmapCache.getPixmap("zoomOut.png"), | 284 self.__searchWindow.linkActivated.connect( |
162 UI.PixmapCache.getPixmap("zoomIn.png"), | 285 self.__linkActivated) |
163 UI.PixmapCache.getPixmap("zoomReset.png"), self) | 286 self.__searchWindow.escapePressed.connect( |
164 self.statusBar().addPermanentWidget(self.__zoomWidget) | 287 self.__activateCurrentBrowser) |
165 self.__zoomWidget.setMapping( | 288 |
166 HelpBrowser.ZoomLevels, HelpBrowser.ZoomLevelDefault) | 289 state = Preferences.getHelp("HelpViewerState") |
167 self.__zoomWidget.valueChanged.connect(self.__zoomValueChanged) | 290 self.restoreState(state) |
168 | 291 |
169 self.tabWidget = HelpTabWidget(self) | 292 self.__initHelpDb() |
170 self.tabWidget.currentChanged[int].connect(self.__currentChanged) | 293 |
171 self.tabWidget.titleChanged.connect(self.__titleChanged) | 294 self.__virusTotal = VirusTotalAPI(self) |
172 self.tabWidget.showMessage.connect(self.statusBar().showMessage) | 295 self.__virusTotal.submitUrlError.connect( |
173 self.tabWidget.browserZoomValueChanged.connect( | 296 self.__virusTotalSubmitUrlError) |
174 self.__zoomWidget.setValue) | 297 self.__virusTotal.urlScanReport.connect( |
175 | 298 self.__virusTotalUrlScanReport) |
176 self.findDlg = SearchWidget(self, self) | 299 self.__virusTotal.fileScanReport.connect( |
177 centralWidget = QWidget() | 300 self.__virusTotalFileScanReport) |
178 layout = QVBoxLayout() | 301 |
179 layout.setContentsMargins(1, 1, 1, 1) | 302 self.__shutdownCalled = False |
180 layout.addWidget(self.tabWidget) | 303 |
181 layout.addWidget(self.findDlg) | 304 self.flashCookieManager() |
182 self.tabWidget.setSizePolicy( | 305 |
183 QSizePolicy.Preferred, QSizePolicy.Expanding) | 306 if single: |
184 centralWidget.setLayout(layout) | 307 self.SAServer = HelpSingleApplicationServer(saname) |
185 self.setCentralWidget(centralWidget) | 308 self.SAServer.loadUrl.connect(self.__saLoadUrl) |
186 self.findDlg.hide() | 309 self.SAServer.newTab.connect(self.__saNewTab) |
187 | 310 self.SAServer.search.connect(self.__saSearchWord) |
188 if HelpWindow._useQtHelp: | 311 self.SAServer.shutdown.connect(self.shutdown) |
189 # setup the TOC widget | 312 else: |
190 self.__tocWindow = HelpTocWidget(self.__helpEngine, self) | 313 self.SAServer = None |
191 self.__tocDock = QDockWidget(self.tr("Contents"), self) | 314 |
192 self.__tocDock.setObjectName("TocWindow") | 315 if HelpWindow._useQtHelp: |
193 self.__tocDock.setWidget(self.__tocWindow) | 316 QTimer.singleShot(50, self.__lookForNewDocumentation) |
194 self.addDockWidget(Qt.LeftDockWidgetArea, self.__tocDock) | 317 if self.__searchWord is not None: |
195 | 318 QTimer.singleShot(0, self.__searchForWord) |
196 # setup the index widget | 319 |
197 self.__indexWindow = HelpIndexWidget(self.__helpEngine, self) | 320 e5App().focusChanged.connect(self.__appFocusChanged) |
198 self.__indexDock = QDockWidget(self.tr("Index"), self) | 321 |
199 self.__indexDock.setObjectName("IndexWindow") | 322 QTimer.singleShot(0, syncMgr.loadSettings) |
200 self.__indexDock.setWidget(self.__indexWindow) | |
201 self.addDockWidget(Qt.LeftDockWidgetArea, self.__indexDock) | |
202 | |
203 # setup the search widget | |
204 self.__searchWord = searchWord | |
205 self.__indexing = False | |
206 self.__indexingProgress = None | |
207 self.__searchEngine = self.__helpEngine.searchEngine() | |
208 self.__searchEngine.indexingStarted.connect( | |
209 self.__indexingStarted) | |
210 self.__searchEngine.indexingFinished.connect( | |
211 self.__indexingFinished) | |
212 self.__searchWindow = HelpSearchWidget( | |
213 self.__searchEngine, self) | |
214 self.__searchDock = QDockWidget(self.tr("Search"), self) | |
215 self.__searchDock.setObjectName("SearchWindow") | |
216 self.__searchDock.setWidget(self.__searchWindow) | |
217 self.addDockWidget(Qt.LeftDockWidgetArea, self.__searchDock) | |
218 | |
219 if Preferences.getHelp("SaveGeometry"): | |
220 g = Preferences.getGeometry("HelpViewerGeometry") | |
221 else: | |
222 g = QByteArray() | |
223 if g.isEmpty(): | |
224 s = QSize(800, 800) | |
225 self.resize(s) | |
226 else: | |
227 self.restoreGeometry(g) | |
228 | |
229 self.__setIconDatabasePath() | |
230 self.__initWebSettings() | |
231 | |
232 self.__initActions() | |
233 self.__initMenus() | |
234 self.__initToolbars() | |
235 | |
236 self.historyManager() | |
237 | |
238 syncMgr = self.syncManager() | |
239 syncMgr.syncMessage.connect(self.statusBar().showMessage) | |
240 syncMgr.syncError.connect(self.statusBar().showMessage) | |
241 | |
242 self.tabWidget.newBrowser(home) | |
243 self.tabWidget.currentBrowser().setFocus() | |
244 | |
245 self.__class__.helpwindows.append(self) | |
246 | |
247 self.__adBlockIcon = AdBlockIcon(self) | |
248 self.statusBar().addPermanentWidget(self.__adBlockIcon) | |
249 self.__adBlockIcon.setEnabled( | |
250 Preferences.getHelp("AdBlockEnabled")) | |
251 self.tabWidget.currentChanged[int].connect( | |
252 self.__adBlockIcon.currentChanged) | |
253 self.tabWidget.sourceChanged.connect( | |
254 self.__adBlockIcon.sourceChanged) | |
255 | |
256 self.networkIcon = E5NetworkIcon(self) | |
257 self.statusBar().addPermanentWidget(self.networkIcon) | |
258 | |
259 if not self.fromEric and len(HelpWindow.helpwindows): | |
260 QDesktopServices.setUrlHandler( | |
261 "http", HelpWindow.helpwindows[0].urlHandler) | |
262 QDesktopServices.setUrlHandler( | |
263 "https", HelpWindow.helpwindows[0].urlHandler) | |
264 | |
265 # setup connections | |
266 self.__activating = False | |
267 if HelpWindow._useQtHelp: | |
268 # TOC window | |
269 self.__tocWindow.linkActivated.connect(self.__linkActivated) | |
270 self.__tocWindow.escapePressed.connect( | |
271 self.__activateCurrentBrowser) | |
272 # index window | |
273 self.__indexWindow.linkActivated.connect(self.__linkActivated) | |
274 self.__indexWindow.linksActivated.connect( | |
275 self.__linksActivated) | |
276 self.__indexWindow.escapePressed.connect( | |
277 self.__activateCurrentBrowser) | |
278 # search window | |
279 self.__searchWindow.linkActivated.connect( | |
280 self.__linkActivated) | |
281 self.__searchWindow.escapePressed.connect( | |
282 self.__activateCurrentBrowser) | |
283 | |
284 state = Preferences.getHelp("HelpViewerState") | |
285 self.restoreState(state) | |
286 | |
287 self.__initHelpDb() | |
288 | |
289 self.__virusTotal = VirusTotalAPI(self) | |
290 self.__virusTotal.submitUrlError.connect( | |
291 self.__virusTotalSubmitUrlError) | |
292 self.__virusTotal.urlScanReport.connect( | |
293 self.__virusTotalUrlScanReport) | |
294 self.__virusTotal.fileScanReport.connect( | |
295 self.__virusTotalFileScanReport) | |
296 | |
297 self.__shutdownCalled = False | |
298 | |
299 self.flashCookieManager() | |
300 | |
301 if HelpWindow._useQtHelp: | |
302 QTimer.singleShot(0, self.__lookForNewDocumentation) | |
303 if self.__searchWord is not None: | |
304 QTimer.singleShot(0, self.__searchForWord) | |
305 | |
306 e5App().focusChanged.connect(self.__appFocusChanged) | |
307 | |
308 QTimer.singleShot(0, syncMgr.loadSettings) | |
309 | 323 |
310 def __del__(self): | 324 def __del__(self): |
311 """ | 325 """ |
312 Special method called during object destruction. | 326 Special method called during object destruction. |
313 | 327 |
465 self.newTabAct.setStatusTip(self.tr('Open a new help window tab')) | 479 self.newTabAct.setStatusTip(self.tr('Open a new help window tab')) |
466 self.newTabAct.setWhatsThis(self.tr( | 480 self.newTabAct.setWhatsThis(self.tr( |
467 """<b>New Tab</b>""" | 481 """<b>New Tab</b>""" |
468 """<p>This opens a new help window tab.</p>""" | 482 """<p>This opens a new help window tab.</p>""" |
469 )) | 483 )) |
470 if not self.initShortcutsOnly: | 484 self.newTabAct.triggered.connect(self.newTab) |
471 self.newTabAct.triggered.connect(self.newTab) | |
472 self.__actions.append(self.newTabAct) | 485 self.__actions.append(self.newTabAct) |
473 | 486 |
474 self.newAct = E5Action( | 487 self.newAct = E5Action( |
475 self.tr('New Window'), | 488 self.tr('New Window'), |
476 UI.PixmapCache.getIcon("newWindow.png"), | 489 UI.PixmapCache.getIcon("newWindow.png"), |
480 self.newAct.setStatusTip(self.tr('Open a new help browser window')) | 493 self.newAct.setStatusTip(self.tr('Open a new help browser window')) |
481 self.newAct.setWhatsThis(self.tr( | 494 self.newAct.setWhatsThis(self.tr( |
482 """<b>New Window</b>""" | 495 """<b>New Window</b>""" |
483 """<p>This opens a new help browser window.</p>""" | 496 """<p>This opens a new help browser window.</p>""" |
484 )) | 497 )) |
485 if not self.initShortcutsOnly: | 498 self.newAct.triggered.connect(self.newWindow) |
486 self.newAct.triggered.connect(self.newWindow) | |
487 self.__actions.append(self.newAct) | 499 self.__actions.append(self.newAct) |
488 | 500 |
489 self.openAct = E5Action( | 501 self.openAct = E5Action( |
490 self.tr('Open File'), | 502 self.tr('Open File'), |
491 UI.PixmapCache.getIcon("open.png"), | 503 UI.PixmapCache.getIcon("open.png"), |
496 self.openAct.setWhatsThis(self.tr( | 508 self.openAct.setWhatsThis(self.tr( |
497 """<b>Open File</b>""" | 509 """<b>Open File</b>""" |
498 """<p>This opens a new help file for display.""" | 510 """<p>This opens a new help file for display.""" |
499 """ It pops up a file selection dialog.</p>""" | 511 """ It pops up a file selection dialog.</p>""" |
500 )) | 512 )) |
501 if not self.initShortcutsOnly: | 513 self.openAct.triggered.connect(self.__openFile) |
502 self.openAct.triggered.connect(self.__openFile) | |
503 self.__actions.append(self.openAct) | 514 self.__actions.append(self.openAct) |
504 | 515 |
505 self.openTabAct = E5Action( | 516 self.openTabAct = E5Action( |
506 self.tr('Open File in New Tab'), | 517 self.tr('Open File in New Tab'), |
507 UI.PixmapCache.getIcon("openNewTab.png"), | 518 UI.PixmapCache.getIcon("openNewTab.png"), |
513 self.openTabAct.setWhatsThis(self.tr( | 524 self.openTabAct.setWhatsThis(self.tr( |
514 """<b>Open File in New Tab</b>""" | 525 """<b>Open File in New Tab</b>""" |
515 """<p>This opens a new help file for display in a new tab.""" | 526 """<p>This opens a new help file for display in a new tab.""" |
516 """ It pops up a file selection dialog.</p>""" | 527 """ It pops up a file selection dialog.</p>""" |
517 )) | 528 )) |
518 if not self.initShortcutsOnly: | 529 self.openTabAct.triggered.connect(self.__openFileNewTab) |
519 self.openTabAct.triggered.connect(self.__openFileNewTab) | |
520 self.__actions.append(self.openTabAct) | 530 self.__actions.append(self.openTabAct) |
521 | 531 |
522 self.saveAsAct = E5Action( | 532 self.saveAsAct = E5Action( |
523 self.tr('Save As'), | 533 self.tr('Save As'), |
524 UI.PixmapCache.getIcon("fileSaveAs.png"), | 534 UI.PixmapCache.getIcon("fileSaveAs.png"), |
529 self.tr('Save the current page to disk')) | 539 self.tr('Save the current page to disk')) |
530 self.saveAsAct.setWhatsThis(self.tr( | 540 self.saveAsAct.setWhatsThis(self.tr( |
531 """<b>Save As...</b>""" | 541 """<b>Save As...</b>""" |
532 """<p>Saves the current page to disk.</p>""" | 542 """<p>Saves the current page to disk.</p>""" |
533 )) | 543 )) |
534 if not self.initShortcutsOnly: | 544 self.saveAsAct.triggered.connect(self.__savePageAs) |
535 self.saveAsAct.triggered.connect(self.__savePageAs) | |
536 self.__actions.append(self.saveAsAct) | 545 self.__actions.append(self.saveAsAct) |
537 | 546 |
538 self.savePageScreenAct = E5Action( | 547 self.savePageScreenAct = E5Action( |
539 self.tr('Save Page Screen'), | 548 self.tr('Save Page Screen'), |
540 UI.PixmapCache.getIcon("fileSavePixmap.png"), | 549 UI.PixmapCache.getIcon("fileSavePixmap.png"), |
544 self.tr('Save the current page as a screen shot')) | 553 self.tr('Save the current page as a screen shot')) |
545 self.savePageScreenAct.setWhatsThis(self.tr( | 554 self.savePageScreenAct.setWhatsThis(self.tr( |
546 """<b>Save Page Screen...</b>""" | 555 """<b>Save Page Screen...</b>""" |
547 """<p>Saves the current page as a screen shot.</p>""" | 556 """<p>Saves the current page as a screen shot.</p>""" |
548 )) | 557 )) |
549 if not self.initShortcutsOnly: | 558 self.savePageScreenAct.triggered.connect(self.__savePageScreen) |
550 self.savePageScreenAct.triggered.connect(self.__savePageScreen) | |
551 self.__actions.append(self.savePageScreenAct) | 559 self.__actions.append(self.savePageScreenAct) |
552 | 560 |
553 self.saveVisiblePageScreenAct = E5Action( | 561 self.saveVisiblePageScreenAct = E5Action( |
554 self.tr('Save Visible Page Screen'), | 562 self.tr('Save Visible Page Screen'), |
555 UI.PixmapCache.getIcon("fileSaveVisiblePixmap.png"), | 563 UI.PixmapCache.getIcon("fileSaveVisiblePixmap.png"), |
561 self.saveVisiblePageScreenAct.setWhatsThis(self.tr( | 569 self.saveVisiblePageScreenAct.setWhatsThis(self.tr( |
562 """<b>Save Visible Page Screen...</b>""" | 570 """<b>Save Visible Page Screen...</b>""" |
563 """<p>Saves the visible part of the current page as a""" | 571 """<p>Saves the visible part of the current page as a""" |
564 """ screen shot.</p>""" | 572 """ screen shot.</p>""" |
565 )) | 573 )) |
566 if not self.initShortcutsOnly: | 574 self.saveVisiblePageScreenAct.triggered.connect( |
567 self.saveVisiblePageScreenAct.triggered.connect( | 575 self.__saveVisiblePageScreen) |
568 self.__saveVisiblePageScreen) | |
569 self.__actions.append(self.saveVisiblePageScreenAct) | 576 self.__actions.append(self.saveVisiblePageScreenAct) |
570 | 577 |
571 bookmarksManager = self.bookmarksManager() | 578 bookmarksManager = self.bookmarksManager() |
572 self.importBookmarksAct = E5Action( | 579 self.importBookmarksAct = E5Action( |
573 self.tr('Import Bookmarks'), | 580 self.tr('Import Bookmarks'), |
577 self.tr('Import bookmarks from other browsers')) | 584 self.tr('Import bookmarks from other browsers')) |
578 self.importBookmarksAct.setWhatsThis(self.tr( | 585 self.importBookmarksAct.setWhatsThis(self.tr( |
579 """<b>Import Bookmarks</b>""" | 586 """<b>Import Bookmarks</b>""" |
580 """<p>Import bookmarks from other browsers.</p>""" | 587 """<p>Import bookmarks from other browsers.</p>""" |
581 )) | 588 )) |
582 if not self.initShortcutsOnly: | 589 self.importBookmarksAct.triggered.connect( |
583 self.importBookmarksAct.triggered.connect( | 590 bookmarksManager.importBookmarks) |
584 bookmarksManager.importBookmarks) | |
585 self.__actions.append(self.importBookmarksAct) | 591 self.__actions.append(self.importBookmarksAct) |
586 | 592 |
587 self.exportBookmarksAct = E5Action( | 593 self.exportBookmarksAct = E5Action( |
588 self.tr('Export Bookmarks'), | 594 self.tr('Export Bookmarks'), |
589 self.tr('&Export Bookmarks...'), | 595 self.tr('&Export Bookmarks...'), |
592 self.tr('Export the bookmarks into a file')) | 598 self.tr('Export the bookmarks into a file')) |
593 self.exportBookmarksAct.setWhatsThis(self.tr( | 599 self.exportBookmarksAct.setWhatsThis(self.tr( |
594 """<b>Export Bookmarks</b>""" | 600 """<b>Export Bookmarks</b>""" |
595 """<p>Export the bookmarks into a file.</p>""" | 601 """<p>Export the bookmarks into a file.</p>""" |
596 )) | 602 )) |
597 if not self.initShortcutsOnly: | 603 self.exportBookmarksAct.triggered.connect( |
598 self.exportBookmarksAct.triggered.connect( | 604 bookmarksManager.exportBookmarks) |
599 bookmarksManager.exportBookmarks) | |
600 self.__actions.append(self.exportBookmarksAct) | 605 self.__actions.append(self.exportBookmarksAct) |
601 | 606 |
602 self.printAct = E5Action( | 607 self.printAct = E5Action( |
603 self.tr('Print'), | 608 self.tr('Print'), |
604 UI.PixmapCache.getIcon("print.png"), | 609 UI.PixmapCache.getIcon("print.png"), |
608 self.printAct.setStatusTip(self.tr('Print the displayed help')) | 613 self.printAct.setStatusTip(self.tr('Print the displayed help')) |
609 self.printAct.setWhatsThis(self.tr( | 614 self.printAct.setWhatsThis(self.tr( |
610 """<b>Print</b>""" | 615 """<b>Print</b>""" |
611 """<p>Print the displayed help text.</p>""" | 616 """<p>Print the displayed help text.</p>""" |
612 )) | 617 )) |
613 if not self.initShortcutsOnly: | 618 self.printAct.triggered.connect(self.tabWidget.printBrowser) |
614 self.printAct.triggered.connect(self.tabWidget.printBrowser) | |
615 self.__actions.append(self.printAct) | 619 self.__actions.append(self.printAct) |
616 | 620 |
617 if Globals.isLinuxPlatform(): | 621 if Globals.isLinuxPlatform(): |
618 self.printPdfAct = E5Action( | 622 self.printPdfAct = E5Action( |
619 self.tr('Print as PDF'), | 623 self.tr('Print as PDF'), |
624 'Print the displayed help as PDF')) | 628 'Print the displayed help as PDF')) |
625 self.printPdfAct.setWhatsThis(self.tr( | 629 self.printPdfAct.setWhatsThis(self.tr( |
626 """<b>Print as PDF</b>""" | 630 """<b>Print as PDF</b>""" |
627 """<p>Print the displayed help text as a PDF file.</p>""" | 631 """<p>Print the displayed help text as a PDF file.</p>""" |
628 )) | 632 )) |
629 if not self.initShortcutsOnly: | 633 self.printPdfAct.triggered.connect( |
630 self.printPdfAct.triggered.connect( | 634 self.tabWidget.printBrowserPdf) |
631 self.tabWidget.printBrowserPdf) | |
632 self.__actions.append(self.printPdfAct) | 635 self.__actions.append(self.printPdfAct) |
633 else: | 636 else: |
634 self.printPdfAct = None | 637 self.printPdfAct = None |
635 | 638 |
636 self.printPreviewAct = E5Action( | 639 self.printPreviewAct = E5Action( |
642 'Print preview of the displayed help')) | 645 'Print preview of the displayed help')) |
643 self.printPreviewAct.setWhatsThis(self.tr( | 646 self.printPreviewAct.setWhatsThis(self.tr( |
644 """<b>Print Preview</b>""" | 647 """<b>Print Preview</b>""" |
645 """<p>Print preview of the displayed help text.</p>""" | 648 """<p>Print preview of the displayed help text.</p>""" |
646 )) | 649 )) |
647 if not self.initShortcutsOnly: | 650 self.printPreviewAct.triggered.connect( |
648 self.printPreviewAct.triggered.connect( | 651 self.tabWidget.printPreviewBrowser) |
649 self.tabWidget.printPreviewBrowser) | |
650 self.__actions.append(self.printPreviewAct) | 652 self.__actions.append(self.printPreviewAct) |
651 | 653 |
652 self.closeAct = E5Action( | 654 self.closeAct = E5Action( |
653 self.tr('Close'), | 655 self.tr('Close'), |
654 UI.PixmapCache.getIcon("close.png"), | 656 UI.PixmapCache.getIcon("close.png"), |
659 'Close the current help window')) | 661 'Close the current help window')) |
660 self.closeAct.setWhatsThis(self.tr( | 662 self.closeAct.setWhatsThis(self.tr( |
661 """<b>Close</b>""" | 663 """<b>Close</b>""" |
662 """<p>Closes the current help window.</p>""" | 664 """<p>Closes the current help window.</p>""" |
663 )) | 665 )) |
664 if not self.initShortcutsOnly: | 666 self.closeAct.triggered.connect(self.tabWidget.closeBrowser) |
665 self.closeAct.triggered.connect(self.tabWidget.closeBrowser) | |
666 self.__actions.append(self.closeAct) | 667 self.__actions.append(self.closeAct) |
667 | 668 |
668 self.closeAllAct = E5Action( | 669 self.closeAllAct = E5Action( |
669 self.tr('Close All'), | 670 self.tr('Close All'), |
670 self.tr('Close &All'), | 671 self.tr('Close &All'), |
672 self.closeAllAct.setStatusTip(self.tr('Close all help windows')) | 673 self.closeAllAct.setStatusTip(self.tr('Close all help windows')) |
673 self.closeAllAct.setWhatsThis(self.tr( | 674 self.closeAllAct.setWhatsThis(self.tr( |
674 """<b>Close All</b>""" | 675 """<b>Close All</b>""" |
675 """<p>Closes all help windows except the first one.</p>""" | 676 """<p>Closes all help windows except the first one.</p>""" |
676 )) | 677 )) |
677 if not self.initShortcutsOnly: | 678 self.closeAllAct.triggered.connect( |
678 self.closeAllAct.triggered.connect( | 679 self.tabWidget.closeAllBrowsers) |
679 self.tabWidget.closeAllBrowsers) | |
680 self.__actions.append(self.closeAllAct) | 680 self.__actions.append(self.closeAllAct) |
681 | 681 |
682 self.privateBrowsingAct = E5Action( | 682 self.privateBrowsingAct = E5Action( |
683 self.tr('Private Browsing'), | 683 self.tr('Private Browsing'), |
684 UI.PixmapCache.getIcon("privateBrowsing.png"), | 684 UI.PixmapCache.getIcon("privateBrowsing.png"), |
688 self.privateBrowsingAct.setWhatsThis(self.tr( | 688 self.privateBrowsingAct.setWhatsThis(self.tr( |
689 """<b>Private Browsing</b>""" | 689 """<b>Private Browsing</b>""" |
690 """<p>Enables private browsing. In this mode no history is""" | 690 """<p>Enables private browsing. In this mode no history is""" |
691 """ recorded anymore.</p>""" | 691 """ recorded anymore.</p>""" |
692 )) | 692 )) |
693 if not self.initShortcutsOnly: | 693 self.privateBrowsingAct.triggered.connect( |
694 self.privateBrowsingAct.triggered.connect( | 694 self.__privateBrowsing) |
695 self.__privateBrowsing) | |
696 self.privateBrowsingAct.setCheckable(True) | 695 self.privateBrowsingAct.setCheckable(True) |
697 self.__actions.append(self.privateBrowsingAct) | 696 self.__actions.append(self.privateBrowsingAct) |
698 | 697 |
699 self.exitAct = E5Action( | 698 self.exitAct = E5Action( |
700 self.tr('Quit'), | 699 self.tr('Quit'), |
705 self.exitAct.setStatusTip(self.tr('Quit the eric6 Web Browser')) | 704 self.exitAct.setStatusTip(self.tr('Quit the eric6 Web Browser')) |
706 self.exitAct.setWhatsThis(self.tr( | 705 self.exitAct.setWhatsThis(self.tr( |
707 """<b>Quit</b>""" | 706 """<b>Quit</b>""" |
708 """<p>Quit the eric6 Web Browser.</p>""" | 707 """<p>Quit the eric6 Web Browser.</p>""" |
709 )) | 708 )) |
710 if not self.initShortcutsOnly: | 709 self.exitAct.triggered.connect(self.__closeAllWindows) |
711 if self.fromEric: | |
712 self.exitAct.triggered.connect(self.close) | |
713 else: | |
714 self.exitAct.triggered.connect(self.__closeAllWindows) | |
715 self.__actions.append(self.exitAct) | 710 self.__actions.append(self.exitAct) |
716 | 711 |
717 self.backAct = E5Action( | 712 self.backAct = E5Action( |
718 self.tr('Backward'), | 713 self.tr('Backward'), |
719 UI.PixmapCache.getIcon("back.png"), | 714 UI.PixmapCache.getIcon("back.png"), |
725 self.backAct.setWhatsThis(self.tr( | 720 self.backAct.setWhatsThis(self.tr( |
726 """<b>Backward</b>""" | 721 """<b>Backward</b>""" |
727 """<p>Moves one help screen backward. If none is""" | 722 """<p>Moves one help screen backward. If none is""" |
728 """ available, this action is disabled.</p>""" | 723 """ available, this action is disabled.</p>""" |
729 )) | 724 )) |
730 if not self.initShortcutsOnly: | 725 self.backAct.triggered.connect(self.__backward) |
731 self.backAct.triggered.connect(self.__backward) | |
732 self.__actions.append(self.backAct) | 726 self.__actions.append(self.backAct) |
733 | 727 |
734 self.forwardAct = E5Action( | 728 self.forwardAct = E5Action( |
735 self.tr('Forward'), | 729 self.tr('Forward'), |
736 UI.PixmapCache.getIcon("forward.png"), | 730 UI.PixmapCache.getIcon("forward.png"), |
743 self.forwardAct.setWhatsThis(self.tr( | 737 self.forwardAct.setWhatsThis(self.tr( |
744 """<b>Forward</b>""" | 738 """<b>Forward</b>""" |
745 """<p>Moves one help screen forward. If none is""" | 739 """<p>Moves one help screen forward. If none is""" |
746 """ available, this action is disabled.</p>""" | 740 """ available, this action is disabled.</p>""" |
747 )) | 741 )) |
748 if not self.initShortcutsOnly: | 742 self.forwardAct.triggered.connect(self.__forward) |
749 self.forwardAct.triggered.connect(self.__forward) | |
750 self.__actions.append(self.forwardAct) | 743 self.__actions.append(self.forwardAct) |
751 | 744 |
752 self.homeAct = E5Action( | 745 self.homeAct = E5Action( |
753 self.tr('Home'), | 746 self.tr('Home'), |
754 UI.PixmapCache.getIcon("home.png"), | 747 UI.PixmapCache.getIcon("home.png"), |
759 'Move to the initial help screen')) | 752 'Move to the initial help screen')) |
760 self.homeAct.setWhatsThis(self.tr( | 753 self.homeAct.setWhatsThis(self.tr( |
761 """<b>Home</b>""" | 754 """<b>Home</b>""" |
762 """<p>Moves to the initial help screen.</p>""" | 755 """<p>Moves to the initial help screen.</p>""" |
763 )) | 756 )) |
764 if not self.initShortcutsOnly: | 757 self.homeAct.triggered.connect(self.__home) |
765 self.homeAct.triggered.connect(self.__home) | |
766 self.__actions.append(self.homeAct) | 758 self.__actions.append(self.homeAct) |
767 | 759 |
768 self.reloadAct = E5Action( | 760 self.reloadAct = E5Action( |
769 self.tr('Reload'), | 761 self.tr('Reload'), |
770 UI.PixmapCache.getIcon("reload.png"), | 762 UI.PixmapCache.getIcon("reload.png"), |
776 'Reload the current help screen')) | 768 'Reload the current help screen')) |
777 self.reloadAct.setWhatsThis(self.tr( | 769 self.reloadAct.setWhatsThis(self.tr( |
778 """<b>Reload</b>""" | 770 """<b>Reload</b>""" |
779 """<p>Reloads the current help screen.</p>""" | 771 """<p>Reloads the current help screen.</p>""" |
780 )) | 772 )) |
781 if not self.initShortcutsOnly: | 773 self.reloadAct.triggered.connect(self.__reload) |
782 self.reloadAct.triggered.connect(self.__reload) | |
783 self.__actions.append(self.reloadAct) | 774 self.__actions.append(self.reloadAct) |
784 | 775 |
785 self.stopAct = E5Action( | 776 self.stopAct = E5Action( |
786 self.tr('Stop'), | 777 self.tr('Stop'), |
787 UI.PixmapCache.getIcon("stopLoading.png"), | 778 UI.PixmapCache.getIcon("stopLoading.png"), |
792 self.stopAct.setStatusTip(self.tr('Stop loading')) | 783 self.stopAct.setStatusTip(self.tr('Stop loading')) |
793 self.stopAct.setWhatsThis(self.tr( | 784 self.stopAct.setWhatsThis(self.tr( |
794 """<b>Stop</b>""" | 785 """<b>Stop</b>""" |
795 """<p>Stops loading of the current tab.</p>""" | 786 """<p>Stops loading of the current tab.</p>""" |
796 )) | 787 )) |
797 if not self.initShortcutsOnly: | 788 self.stopAct.triggered.connect(self.__stopLoading) |
798 self.stopAct.triggered.connect(self.__stopLoading) | |
799 self.__actions.append(self.stopAct) | 789 self.__actions.append(self.stopAct) |
800 | 790 |
801 self.copyAct = E5Action( | 791 self.copyAct = E5Action( |
802 self.tr('Copy'), | 792 self.tr('Copy'), |
803 UI.PixmapCache.getIcon("editCopy.png"), | 793 UI.PixmapCache.getIcon("editCopy.png"), |
807 self.copyAct.setStatusTip(self.tr('Copy the selected text')) | 797 self.copyAct.setStatusTip(self.tr('Copy the selected text')) |
808 self.copyAct.setWhatsThis(self.tr( | 798 self.copyAct.setWhatsThis(self.tr( |
809 """<b>Copy</b>""" | 799 """<b>Copy</b>""" |
810 """<p>Copy the selected text to the clipboard.</p>""" | 800 """<p>Copy the selected text to the clipboard.</p>""" |
811 )) | 801 )) |
812 if not self.initShortcutsOnly: | 802 self.copyAct.triggered.connect(self.__copy) |
813 self.copyAct.triggered.connect(self.__copy) | |
814 self.__actions.append(self.copyAct) | 803 self.__actions.append(self.copyAct) |
815 | 804 |
816 self.findAct = E5Action( | 805 self.findAct = E5Action( |
817 self.tr('Find...'), | 806 self.tr('Find...'), |
818 UI.PixmapCache.getIcon("find.png"), | 807 UI.PixmapCache.getIcon("find.png"), |
822 self.findAct.setStatusTip(self.tr('Find text in page')) | 811 self.findAct.setStatusTip(self.tr('Find text in page')) |
823 self.findAct.setWhatsThis(self.tr( | 812 self.findAct.setWhatsThis(self.tr( |
824 """<b>Find</b>""" | 813 """<b>Find</b>""" |
825 """<p>Find text in the current page.</p>""" | 814 """<p>Find text in the current page.</p>""" |
826 )) | 815 )) |
827 if not self.initShortcutsOnly: | 816 self.findAct.triggered.connect(self.__find) |
828 self.findAct.triggered.connect(self.__find) | |
829 self.__actions.append(self.findAct) | 817 self.__actions.append(self.findAct) |
830 | 818 |
831 self.findNextAct = E5Action( | 819 self.findNextAct = E5Action( |
832 self.tr('Find next'), | 820 self.tr('Find next'), |
833 UI.PixmapCache.getIcon("findNext.png"), | 821 UI.PixmapCache.getIcon("findNext.png"), |
838 'Find next occurrence of text in page')) | 826 'Find next occurrence of text in page')) |
839 self.findNextAct.setWhatsThis(self.tr( | 827 self.findNextAct.setWhatsThis(self.tr( |
840 """<b>Find next</b>""" | 828 """<b>Find next</b>""" |
841 """<p>Find the next occurrence of text in the current page.</p>""" | 829 """<p>Find the next occurrence of text in the current page.</p>""" |
842 )) | 830 )) |
843 if not self.initShortcutsOnly: | 831 self.findNextAct.triggered.connect(self.findDlg.findNext) |
844 self.findNextAct.triggered.connect(self.findDlg.findNext) | |
845 self.__actions.append(self.findNextAct) | 832 self.__actions.append(self.findNextAct) |
846 | 833 |
847 self.findPrevAct = E5Action( | 834 self.findPrevAct = E5Action( |
848 self.tr('Find previous'), | 835 self.tr('Find previous'), |
849 UI.PixmapCache.getIcon("findPrev.png"), | 836 UI.PixmapCache.getIcon("findPrev.png"), |
855 self.findPrevAct.setWhatsThis(self.tr( | 842 self.findPrevAct.setWhatsThis(self.tr( |
856 """<b>Find previous</b>""" | 843 """<b>Find previous</b>""" |
857 """<p>Find the previous occurrence of text in the current""" | 844 """<p>Find the previous occurrence of text in the current""" |
858 """ page.</p>""" | 845 """ page.</p>""" |
859 )) | 846 )) |
860 if not self.initShortcutsOnly: | 847 self.findPrevAct.triggered.connect(self.findDlg.findPrevious) |
861 self.findPrevAct.triggered.connect(self.findDlg.findPrevious) | |
862 self.__actions.append(self.findPrevAct) | 848 self.__actions.append(self.findPrevAct) |
863 | 849 |
864 self.bookmarksManageAct = E5Action( | 850 self.bookmarksManageAct = E5Action( |
865 self.tr('Manage Bookmarks'), | 851 self.tr('Manage Bookmarks'), |
866 self.tr('&Manage Bookmarks...'), | 852 self.tr('&Manage Bookmarks...'), |
870 'Open a dialog to manage the bookmarks.')) | 856 'Open a dialog to manage the bookmarks.')) |
871 self.bookmarksManageAct.setWhatsThis(self.tr( | 857 self.bookmarksManageAct.setWhatsThis(self.tr( |
872 """<b>Manage Bookmarks...</b>""" | 858 """<b>Manage Bookmarks...</b>""" |
873 """<p>Open a dialog to manage the bookmarks.</p>""" | 859 """<p>Open a dialog to manage the bookmarks.</p>""" |
874 )) | 860 )) |
875 if not self.initShortcutsOnly: | 861 self.bookmarksManageAct.triggered.connect( |
876 self.bookmarksManageAct.triggered.connect( | 862 self.__showBookmarksDialog) |
877 self.__showBookmarksDialog) | |
878 self.__actions.append(self.bookmarksManageAct) | 863 self.__actions.append(self.bookmarksManageAct) |
879 | 864 |
880 self.bookmarksAddAct = E5Action( | 865 self.bookmarksAddAct = E5Action( |
881 self.tr('Add Bookmark'), | 866 self.tr('Add Bookmark'), |
882 UI.PixmapCache.getIcon("addBookmark.png"), | 867 UI.PixmapCache.getIcon("addBookmark.png"), |
888 'Open a dialog to add a bookmark.')) | 873 'Open a dialog to add a bookmark.')) |
889 self.bookmarksAddAct.setWhatsThis(self.tr( | 874 self.bookmarksAddAct.setWhatsThis(self.tr( |
890 """<b>Add Bookmark</b>""" | 875 """<b>Add Bookmark</b>""" |
891 """<p>Open a dialog to add the current URL as a bookmark.</p>""" | 876 """<p>Open a dialog to add the current URL as a bookmark.</p>""" |
892 )) | 877 )) |
893 if not self.initShortcutsOnly: | 878 self.bookmarksAddAct.triggered.connect(self.__addBookmark) |
894 self.bookmarksAddAct.triggered.connect(self.__addBookmark) | |
895 self.__actions.append(self.bookmarksAddAct) | 879 self.__actions.append(self.bookmarksAddAct) |
896 | 880 |
897 self.bookmarksAddFolderAct = E5Action( | 881 self.bookmarksAddFolderAct = E5Action( |
898 self.tr('Add Folder'), | 882 self.tr('Add Folder'), |
899 self.tr('Add &Folder...'), | 883 self.tr('Add &Folder...'), |
902 'Open a dialog to add a new bookmarks folder.')) | 886 'Open a dialog to add a new bookmarks folder.')) |
903 self.bookmarksAddFolderAct.setWhatsThis(self.tr( | 887 self.bookmarksAddFolderAct.setWhatsThis(self.tr( |
904 """<b>Add Folder...</b>""" | 888 """<b>Add Folder...</b>""" |
905 """<p>Open a dialog to add a new bookmarks folder.</p>""" | 889 """<p>Open a dialog to add a new bookmarks folder.</p>""" |
906 )) | 890 )) |
907 if not self.initShortcutsOnly: | 891 self.bookmarksAddFolderAct.triggered.connect( |
908 self.bookmarksAddFolderAct.triggered.connect( | 892 self.__addBookmarkFolder) |
909 self.__addBookmarkFolder) | |
910 self.__actions.append(self.bookmarksAddFolderAct) | 893 self.__actions.append(self.bookmarksAddFolderAct) |
911 | 894 |
912 self.bookmarksAllTabsAct = E5Action( | 895 self.bookmarksAllTabsAct = E5Action( |
913 self.tr('Bookmark All Tabs'), | 896 self.tr('Bookmark All Tabs'), |
914 self.tr('Bookmark All Tabs...'), | 897 self.tr('Bookmark All Tabs...'), |
918 self.bookmarksAllTabsAct.setWhatsThis(self.tr( | 901 self.bookmarksAllTabsAct.setWhatsThis(self.tr( |
919 """<b>Bookmark All Tabs...</b>""" | 902 """<b>Bookmark All Tabs...</b>""" |
920 """<p>Open a dialog to add a new bookmarks folder for""" | 903 """<p>Open a dialog to add a new bookmarks folder for""" |
921 """ all open tabs.</p>""" | 904 """ all open tabs.</p>""" |
922 )) | 905 )) |
923 if not self.initShortcutsOnly: | 906 self.bookmarksAllTabsAct.triggered.connect(self.bookmarkAll) |
924 self.bookmarksAllTabsAct.triggered.connect(self.bookmarkAll) | |
925 self.__actions.append(self.bookmarksAllTabsAct) | 907 self.__actions.append(self.bookmarksAllTabsAct) |
926 | 908 |
927 self.whatsThisAct = E5Action( | 909 self.whatsThisAct = E5Action( |
928 self.tr('What\'s This?'), | 910 self.tr('What\'s This?'), |
929 UI.PixmapCache.getIcon("whatsThis.png"), | 911 UI.PixmapCache.getIcon("whatsThis.png"), |
937 """ with a question mark, and you can click on the interface""" | 919 """ with a question mark, and you can click on the interface""" |
938 """ elements to get a short description of what they do and how""" | 920 """ elements to get a short description of what they do and how""" |
939 """ to use them. In dialogs, this feature can be accessed using""" | 921 """ to use them. In dialogs, this feature can be accessed using""" |
940 """ the context help button in the titlebar.</p>""" | 922 """ the context help button in the titlebar.</p>""" |
941 )) | 923 )) |
942 if not self.initShortcutsOnly: | 924 self.whatsThisAct.triggered.connect(self.__whatsThis) |
943 self.whatsThisAct.triggered.connect(self.__whatsThis) | |
944 self.__actions.append(self.whatsThisAct) | 925 self.__actions.append(self.whatsThisAct) |
945 | 926 |
946 self.aboutAct = E5Action( | 927 self.aboutAct = E5Action( |
947 self.tr('About'), | 928 self.tr('About'), |
948 self.tr('&About'), | 929 self.tr('&About'), |
951 'Display information about this software')) | 932 'Display information about this software')) |
952 self.aboutAct.setWhatsThis(self.tr( | 933 self.aboutAct.setWhatsThis(self.tr( |
953 """<b>About</b>""" | 934 """<b>About</b>""" |
954 """<p>Display some information about this software.</p>""" | 935 """<p>Display some information about this software.</p>""" |
955 )) | 936 )) |
956 if not self.initShortcutsOnly: | 937 self.aboutAct.triggered.connect(self.__about) |
957 self.aboutAct.triggered.connect(self.__about) | |
958 self.__actions.append(self.aboutAct) | 938 self.__actions.append(self.aboutAct) |
959 | 939 |
960 self.aboutQtAct = E5Action( | 940 self.aboutQtAct = E5Action( |
961 self.tr('About Qt'), | 941 self.tr('About Qt'), |
962 self.tr('About &Qt'), | 942 self.tr('About &Qt'), |
965 self.tr('Display information about the Qt toolkit')) | 945 self.tr('Display information about the Qt toolkit')) |
966 self.aboutQtAct.setWhatsThis(self.tr( | 946 self.aboutQtAct.setWhatsThis(self.tr( |
967 """<b>About Qt</b>""" | 947 """<b>About Qt</b>""" |
968 """<p>Display some information about the Qt toolkit.</p>""" | 948 """<p>Display some information about the Qt toolkit.</p>""" |
969 )) | 949 )) |
970 if not self.initShortcutsOnly: | 950 self.aboutQtAct.triggered.connect(self.__aboutQt) |
971 self.aboutQtAct.triggered.connect(self.__aboutQt) | |
972 self.__actions.append(self.aboutQtAct) | 951 self.__actions.append(self.aboutQtAct) |
973 | 952 |
974 self.zoomInAct = E5Action( | 953 self.zoomInAct = E5Action( |
975 self.tr('Zoom in'), | 954 self.tr('Zoom in'), |
976 UI.PixmapCache.getIcon("zoomIn.png"), | 955 UI.PixmapCache.getIcon("zoomIn.png"), |
981 self.zoomInAct.setStatusTip(self.tr('Zoom in on the text')) | 960 self.zoomInAct.setStatusTip(self.tr('Zoom in on the text')) |
982 self.zoomInAct.setWhatsThis(self.tr( | 961 self.zoomInAct.setWhatsThis(self.tr( |
983 """<b>Zoom in</b>""" | 962 """<b>Zoom in</b>""" |
984 """<p>Zoom in on the text. This makes the text bigger.</p>""" | 963 """<p>Zoom in on the text. This makes the text bigger.</p>""" |
985 )) | 964 )) |
986 if not self.initShortcutsOnly: | 965 self.zoomInAct.triggered.connect(self.__zoomIn) |
987 self.zoomInAct.triggered.connect(self.__zoomIn) | |
988 self.__actions.append(self.zoomInAct) | 966 self.__actions.append(self.zoomInAct) |
989 | 967 |
990 self.zoomOutAct = E5Action( | 968 self.zoomOutAct = E5Action( |
991 self.tr('Zoom out'), | 969 self.tr('Zoom out'), |
992 UI.PixmapCache.getIcon("zoomOut.png"), | 970 UI.PixmapCache.getIcon("zoomOut.png"), |
997 self.zoomOutAct.setStatusTip(self.tr('Zoom out on the text')) | 975 self.zoomOutAct.setStatusTip(self.tr('Zoom out on the text')) |
998 self.zoomOutAct.setWhatsThis(self.tr( | 976 self.zoomOutAct.setWhatsThis(self.tr( |
999 """<b>Zoom out</b>""" | 977 """<b>Zoom out</b>""" |
1000 """<p>Zoom out on the text. This makes the text smaller.</p>""" | 978 """<p>Zoom out on the text. This makes the text smaller.</p>""" |
1001 )) | 979 )) |
1002 if not self.initShortcutsOnly: | 980 self.zoomOutAct.triggered.connect(self.__zoomOut) |
1003 self.zoomOutAct.triggered.connect(self.__zoomOut) | |
1004 self.__actions.append(self.zoomOutAct) | 981 self.__actions.append(self.zoomOutAct) |
1005 | 982 |
1006 self.zoomResetAct = E5Action( | 983 self.zoomResetAct = E5Action( |
1007 self.tr('Zoom reset'), | 984 self.tr('Zoom reset'), |
1008 UI.PixmapCache.getIcon("zoomReset.png"), | 985 UI.PixmapCache.getIcon("zoomReset.png"), |
1014 self.zoomResetAct.setWhatsThis(self.tr( | 991 self.zoomResetAct.setWhatsThis(self.tr( |
1015 """<b>Zoom reset</b>""" | 992 """<b>Zoom reset</b>""" |
1016 """<p>Reset the zoom of the text. """ | 993 """<p>Reset the zoom of the text. """ |
1017 """This sets the zoom factor to 100%.</p>""" | 994 """This sets the zoom factor to 100%.</p>""" |
1018 )) | 995 )) |
1019 if not self.initShortcutsOnly: | 996 self.zoomResetAct.triggered.connect(self.__zoomReset) |
1020 self.zoomResetAct.triggered.connect(self.__zoomReset) | |
1021 self.__actions.append(self.zoomResetAct) | 997 self.__actions.append(self.zoomResetAct) |
1022 | 998 |
1023 if hasattr(QWebSettings, 'ZoomTextOnly'): | 999 if hasattr(QWebSettings, 'ZoomTextOnly'): |
1024 self.zoomTextOnlyAct = E5Action( | 1000 self.zoomTextOnlyAct = E5Action( |
1025 self.tr('Zoom text only'), | 1001 self.tr('Zoom text only'), |
1030 'Zoom text only; pictures remain constant')) | 1006 'Zoom text only; pictures remain constant')) |
1031 self.zoomTextOnlyAct.setWhatsThis(self.tr( | 1007 self.zoomTextOnlyAct.setWhatsThis(self.tr( |
1032 """<b>Zoom text only</b>""" | 1008 """<b>Zoom text only</b>""" |
1033 """<p>Zoom text only; pictures remain constant.</p>""" | 1009 """<p>Zoom text only; pictures remain constant.</p>""" |
1034 )) | 1010 )) |
1035 if not self.initShortcutsOnly: | 1011 self.zoomTextOnlyAct.triggered[bool].connect( |
1036 self.zoomTextOnlyAct.triggered[bool].connect( | 1012 self.__zoomTextOnly) |
1037 self.__zoomTextOnly) | |
1038 self.__actions.append(self.zoomTextOnlyAct) | 1013 self.__actions.append(self.zoomTextOnlyAct) |
1039 else: | 1014 else: |
1040 self.zoomTextOnlyAct = None | 1015 self.zoomTextOnlyAct = None |
1041 | 1016 |
1042 self.pageSourceAct = E5Action( | 1017 self.pageSourceAct = E5Action( |
1048 'Show the page source in an editor')) | 1023 'Show the page source in an editor')) |
1049 self.pageSourceAct.setWhatsThis(self.tr( | 1024 self.pageSourceAct.setWhatsThis(self.tr( |
1050 """<b>Show page source</b>""" | 1025 """<b>Show page source</b>""" |
1051 """<p>Show the page source in an editor.</p>""" | 1026 """<p>Show the page source in an editor.</p>""" |
1052 )) | 1027 )) |
1053 if not self.initShortcutsOnly: | 1028 self.pageSourceAct.triggered.connect(self.__showPageSource) |
1054 self.pageSourceAct.triggered.connect(self.__showPageSource) | |
1055 self.__actions.append(self.pageSourceAct) | 1029 self.__actions.append(self.pageSourceAct) |
1056 self.addAction(self.pageSourceAct) | 1030 self.addAction(self.pageSourceAct) |
1057 | 1031 |
1058 self.fullScreenAct = E5Action( | 1032 self.fullScreenAct = E5Action( |
1059 self.tr('Full Screen'), | 1033 self.tr('Full Screen'), |
1060 UI.PixmapCache.getIcon("windowFullscreen.png"), | 1034 UI.PixmapCache.getIcon("windowFullscreen.png"), |
1061 self.tr('&Full Screen'), | 1035 self.tr('&Full Screen'), |
1062 QKeySequence(self.tr('F11')), 0, | 1036 QKeySequence(self.tr('F11')), 0, |
1063 self, 'help_view_full_scree') | 1037 self, 'help_view_full_scree') |
1064 if not self.initShortcutsOnly: | 1038 self.fullScreenAct.triggered.connect(self.__viewFullScreen) |
1065 self.fullScreenAct.triggered.connect(self.__viewFullScreen) | |
1066 self.__actions.append(self.fullScreenAct) | 1039 self.__actions.append(self.fullScreenAct) |
1067 self.addAction(self.fullScreenAct) | 1040 self.addAction(self.fullScreenAct) |
1068 | 1041 |
1069 self.nextTabAct = E5Action( | 1042 self.nextTabAct = E5Action( |
1070 self.tr('Show next tab'), | 1043 self.tr('Show next tab'), |
1071 self.tr('Show next tab'), | 1044 self.tr('Show next tab'), |
1072 QKeySequence(self.tr('Ctrl+Alt+Tab')), 0, | 1045 QKeySequence(self.tr('Ctrl+Alt+Tab')), 0, |
1073 self, 'help_view_next_tab') | 1046 self, 'help_view_next_tab') |
1074 if not self.initShortcutsOnly: | 1047 self.nextTabAct.triggered.connect(self.__nextTab) |
1075 self.nextTabAct.triggered.connect(self.__nextTab) | |
1076 self.__actions.append(self.nextTabAct) | 1048 self.__actions.append(self.nextTabAct) |
1077 self.addAction(self.nextTabAct) | 1049 self.addAction(self.nextTabAct) |
1078 | 1050 |
1079 self.prevTabAct = E5Action( | 1051 self.prevTabAct = E5Action( |
1080 self.tr('Show previous tab'), | 1052 self.tr('Show previous tab'), |
1081 self.tr('Show previous tab'), | 1053 self.tr('Show previous tab'), |
1082 QKeySequence(self.tr('Shift+Ctrl+Alt+Tab')), 0, | 1054 QKeySequence(self.tr('Shift+Ctrl+Alt+Tab')), 0, |
1083 self, 'help_view_previous_tab') | 1055 self, 'help_view_previous_tab') |
1084 if not self.initShortcutsOnly: | 1056 self.prevTabAct.triggered.connect(self.__prevTab) |
1085 self.prevTabAct.triggered.connect(self.__prevTab) | |
1086 self.__actions.append(self.prevTabAct) | 1057 self.__actions.append(self.prevTabAct) |
1087 self.addAction(self.prevTabAct) | 1058 self.addAction(self.prevTabAct) |
1088 | 1059 |
1089 self.switchTabAct = E5Action( | 1060 self.switchTabAct = E5Action( |
1090 self.tr('Switch between tabs'), | 1061 self.tr('Switch between tabs'), |
1091 self.tr('Switch between tabs'), | 1062 self.tr('Switch between tabs'), |
1092 QKeySequence(self.tr('Ctrl+1')), 0, | 1063 QKeySequence(self.tr('Ctrl+1')), 0, |
1093 self, 'help_switch_tabs') | 1064 self, 'help_switch_tabs') |
1094 if not self.initShortcutsOnly: | 1065 self.switchTabAct.triggered.connect(self.__switchTab) |
1095 self.switchTabAct.triggered.connect(self.__switchTab) | |
1096 self.__actions.append(self.switchTabAct) | 1066 self.__actions.append(self.switchTabAct) |
1097 self.addAction(self.switchTabAct) | 1067 self.addAction(self.switchTabAct) |
1098 | 1068 |
1099 self.prefAct = E5Action( | 1069 self.prefAct = E5Action( |
1100 self.tr('Preferences'), | 1070 self.tr('Preferences'), |
1105 self.prefAct.setWhatsThis(self.tr( | 1075 self.prefAct.setWhatsThis(self.tr( |
1106 """<b>Preferences</b>""" | 1076 """<b>Preferences</b>""" |
1107 """<p>Set the configuration items of the application""" | 1077 """<p>Set the configuration items of the application""" |
1108 """ with your prefered values.</p>""" | 1078 """ with your prefered values.</p>""" |
1109 )) | 1079 )) |
1110 if not self.initShortcutsOnly: | 1080 self.prefAct.triggered.connect(self.__showPreferences) |
1111 self.prefAct.triggered.connect(self.__showPreferences) | |
1112 self.__actions.append(self.prefAct) | 1081 self.__actions.append(self.prefAct) |
1113 | 1082 |
1114 self.acceptedLanguagesAct = E5Action( | 1083 self.acceptedLanguagesAct = E5Action( |
1115 self.tr('Languages'), | 1084 self.tr('Languages'), |
1116 UI.PixmapCache.getIcon("flag.png"), | 1085 UI.PixmapCache.getIcon("flag.png"), |
1120 'Configure the accepted languages for web pages')) | 1089 'Configure the accepted languages for web pages')) |
1121 self.acceptedLanguagesAct.setWhatsThis(self.tr( | 1090 self.acceptedLanguagesAct.setWhatsThis(self.tr( |
1122 """<b>Languages</b>""" | 1091 """<b>Languages</b>""" |
1123 """<p>Configure the accepted languages for web pages.</p>""" | 1092 """<p>Configure the accepted languages for web pages.</p>""" |
1124 )) | 1093 )) |
1125 if not self.initShortcutsOnly: | 1094 self.acceptedLanguagesAct.triggered.connect( |
1126 self.acceptedLanguagesAct.triggered.connect( | 1095 self.__showAcceptedLanguages) |
1127 self.__showAcceptedLanguages) | |
1128 self.__actions.append(self.acceptedLanguagesAct) | 1096 self.__actions.append(self.acceptedLanguagesAct) |
1129 | 1097 |
1130 self.cookiesAct = E5Action( | 1098 self.cookiesAct = E5Action( |
1131 self.tr('Cookies'), | 1099 self.tr('Cookies'), |
1132 UI.PixmapCache.getIcon("cookie.png"), | 1100 UI.PixmapCache.getIcon("cookie.png"), |
1135 'Configure cookies handling')) | 1103 'Configure cookies handling')) |
1136 self.cookiesAct.setWhatsThis(self.tr( | 1104 self.cookiesAct.setWhatsThis(self.tr( |
1137 """<b>Cookies</b>""" | 1105 """<b>Cookies</b>""" |
1138 """<p>Configure cookies handling.</p>""" | 1106 """<p>Configure cookies handling.</p>""" |
1139 )) | 1107 )) |
1140 if not self.initShortcutsOnly: | 1108 self.cookiesAct.triggered.connect( |
1141 self.cookiesAct.triggered.connect( | 1109 self.__showCookiesConfiguration) |
1142 self.__showCookiesConfiguration) | |
1143 self.__actions.append(self.cookiesAct) | 1110 self.__actions.append(self.cookiesAct) |
1144 | 1111 |
1145 self.flashCookiesAct = E5Action( | 1112 self.flashCookiesAct = E5Action( |
1146 self.tr('Flash Cookies'), | 1113 self.tr('Flash Cookies'), |
1147 UI.PixmapCache.getIcon("flashCookie.png"), | 1114 UI.PixmapCache.getIcon("flashCookie.png"), |
1150 'Manage flash cookies')) | 1117 'Manage flash cookies')) |
1151 self.flashCookiesAct.setWhatsThis(self.tr( | 1118 self.flashCookiesAct.setWhatsThis(self.tr( |
1152 """<b>Flash Cookies</b>""" | 1119 """<b>Flash Cookies</b>""" |
1153 """<p>Show a dialog to manage the flash cookies.</p>""" | 1120 """<p>Show a dialog to manage the flash cookies.</p>""" |
1154 )) | 1121 )) |
1155 if not self.initShortcutsOnly: | 1122 self.flashCookiesAct.triggered.connect( |
1156 self.flashCookiesAct.triggered.connect( | 1123 self.__showFlashCookiesManagement) |
1157 self.__showFlashCookiesManagement) | |
1158 self.__actions.append(self.flashCookiesAct) | 1124 self.__actions.append(self.flashCookiesAct) |
1159 | 1125 |
1160 self.offlineStorageAct = E5Action( | 1126 self.offlineStorageAct = E5Action( |
1161 self.tr('Offline Storage'), | 1127 self.tr('Offline Storage'), |
1162 UI.PixmapCache.getIcon("preferences-html5.png"), | 1128 UI.PixmapCache.getIcon("preferences-html5.png"), |
1166 'Configure offline storage')) | 1132 'Configure offline storage')) |
1167 self.offlineStorageAct.setWhatsThis(self.tr( | 1133 self.offlineStorageAct.setWhatsThis(self.tr( |
1168 """<b>Offline Storage</b>""" | 1134 """<b>Offline Storage</b>""" |
1169 """<p>Opens a dialog to configure offline storage.</p>""" | 1135 """<p>Opens a dialog to configure offline storage.</p>""" |
1170 )) | 1136 )) |
1171 if not self.initShortcutsOnly: | 1137 self.offlineStorageAct.triggered.connect( |
1172 self.offlineStorageAct.triggered.connect( | 1138 self.__showOfflineStorageConfiguration) |
1173 self.__showOfflineStorageConfiguration) | |
1174 self.__actions.append(self.offlineStorageAct) | 1139 self.__actions.append(self.offlineStorageAct) |
1175 | 1140 |
1176 self.personalDataAct = E5Action( | 1141 self.personalDataAct = E5Action( |
1177 self.tr('Personal Information'), | 1142 self.tr('Personal Information'), |
1178 UI.PixmapCache.getIcon("pim.png"), | 1143 UI.PixmapCache.getIcon("pim.png"), |
1184 self.personalDataAct.setWhatsThis(self.tr( | 1149 self.personalDataAct.setWhatsThis(self.tr( |
1185 """<b>Personal Information...</b>""" | 1150 """<b>Personal Information...</b>""" |
1186 """<p>Opens a dialog to configure the personal information""" | 1151 """<p>Opens a dialog to configure the personal information""" |
1187 """ used for completing form fields.</p>""" | 1152 """ used for completing form fields.</p>""" |
1188 )) | 1153 )) |
1189 if not self.initShortcutsOnly: | 1154 self.personalDataAct.triggered.connect( |
1190 self.personalDataAct.triggered.connect( | 1155 self.__showPersonalInformationDialog) |
1191 self.__showPersonalInformationDialog) | |
1192 self.__actions.append(self.personalDataAct) | 1156 self.__actions.append(self.personalDataAct) |
1193 | 1157 |
1194 self.greaseMonkeyAct = E5Action( | 1158 self.greaseMonkeyAct = E5Action( |
1195 self.tr('GreaseMonkey Scripts'), | 1159 self.tr('GreaseMonkey Scripts'), |
1196 UI.PixmapCache.getIcon("greaseMonkey.png"), | 1160 UI.PixmapCache.getIcon("greaseMonkey.png"), |
1202 self.greaseMonkeyAct.setWhatsThis(self.tr( | 1166 self.greaseMonkeyAct.setWhatsThis(self.tr( |
1203 """<b>GreaseMonkey Scripts...</b>""" | 1167 """<b>GreaseMonkey Scripts...</b>""" |
1204 """<p>Opens a dialog to configure the available GreaseMonkey""" | 1168 """<p>Opens a dialog to configure the available GreaseMonkey""" |
1205 """ Scripts.</p>""" | 1169 """ Scripts.</p>""" |
1206 )) | 1170 )) |
1207 if not self.initShortcutsOnly: | 1171 self.greaseMonkeyAct.triggered.connect( |
1208 self.greaseMonkeyAct.triggered.connect( | 1172 self.__showGreaseMonkeyConfigDialog) |
1209 self.__showGreaseMonkeyConfigDialog) | |
1210 self.__actions.append(self.greaseMonkeyAct) | 1173 self.__actions.append(self.greaseMonkeyAct) |
1211 | 1174 |
1212 self.editMessageFilterAct = E5Action( | 1175 self.editMessageFilterAct = E5Action( |
1213 self.tr('Edit Message Filters'), | 1176 self.tr('Edit Message Filters'), |
1214 UI.PixmapCache.getIcon("warning.png"), | 1177 UI.PixmapCache.getIcon("warning.png"), |
1220 """<b>Edit Message Filters</b>""" | 1183 """<b>Edit Message Filters</b>""" |
1221 """<p>Opens a dialog to edit the message filters used to""" | 1184 """<p>Opens a dialog to edit the message filters used to""" |
1222 """ suppress unwanted messages been shown in an error""" | 1185 """ suppress unwanted messages been shown in an error""" |
1223 """ window.</p>""" | 1186 """ window.</p>""" |
1224 )) | 1187 )) |
1225 if not self.initShortcutsOnly: | 1188 self.editMessageFilterAct.triggered.connect( |
1226 self.editMessageFilterAct.triggered.connect( | 1189 E5ErrorMessage.editMessageFilters) |
1227 E5ErrorMessage.editMessageFilters) | |
1228 self.__actions.append(self.editMessageFilterAct) | 1190 self.__actions.append(self.editMessageFilterAct) |
1229 | 1191 |
1230 self.featurePermissionAct = E5Action( | 1192 self.featurePermissionAct = E5Action( |
1231 self.tr('Edit HTML5 Feature Permissions'), | 1193 self.tr('Edit HTML5 Feature Permissions'), |
1232 UI.PixmapCache.getIcon("featurePermission.png"), | 1194 UI.PixmapCache.getIcon("featurePermission.png"), |
1237 self.featurePermissionAct.setWhatsThis(self.tr( | 1199 self.featurePermissionAct.setWhatsThis(self.tr( |
1238 """<b>Edit HTML5 Feature Permissions</b>""" | 1200 """<b>Edit HTML5 Feature Permissions</b>""" |
1239 """<p>Opens a dialog to edit the remembered HTML5""" | 1201 """<p>Opens a dialog to edit the remembered HTML5""" |
1240 """ feature permissions.</p>""" | 1202 """ feature permissions.</p>""" |
1241 )) | 1203 )) |
1242 if not self.initShortcutsOnly: | 1204 self.featurePermissionAct.triggered.connect( |
1243 self.featurePermissionAct.triggered.connect( | 1205 self.__showFeaturePermissionDialog) |
1244 self.__showFeaturePermissionDialog) | |
1245 self.__actions.append(self.featurePermissionAct) | 1206 self.__actions.append(self.featurePermissionAct) |
1246 | 1207 |
1247 if HelpWindow._useQtHelp or self.initShortcutsOnly: | 1208 if HelpWindow._useQtHelp: |
1248 self.syncTocAct = E5Action( | 1209 self.syncTocAct = E5Action( |
1249 self.tr('Sync with Table of Contents'), | 1210 self.tr('Sync with Table of Contents'), |
1250 UI.PixmapCache.getIcon("syncToc.png"), | 1211 UI.PixmapCache.getIcon("syncToc.png"), |
1251 self.tr('Sync with Table of Contents'), | 1212 self.tr('Sync with Table of Contents'), |
1252 0, 0, self, 'help_sync_toc') | 1213 0, 0, self, 'help_sync_toc') |
1255 self.syncTocAct.setWhatsThis(self.tr( | 1216 self.syncTocAct.setWhatsThis(self.tr( |
1256 """<b>Sync with Table of Contents</b>""" | 1217 """<b>Sync with Table of Contents</b>""" |
1257 """<p>Synchronizes the table of contents with current""" | 1218 """<p>Synchronizes the table of contents with current""" |
1258 """ page.</p>""" | 1219 """ page.</p>""" |
1259 )) | 1220 )) |
1260 if not self.initShortcutsOnly: | 1221 self.syncTocAct.triggered.connect(self.__syncTOC) |
1261 self.syncTocAct.triggered.connect(self.__syncTOC) | |
1262 self.__actions.append(self.syncTocAct) | 1222 self.__actions.append(self.syncTocAct) |
1263 | 1223 |
1264 self.showTocAct = E5Action( | 1224 self.showTocAct = E5Action( |
1265 self.tr('Table of Contents'), | 1225 self.tr('Table of Contents'), |
1266 self.tr('Table of Contents'), | 1226 self.tr('Table of Contents'), |
1269 'Shows the table of contents window')) | 1229 'Shows the table of contents window')) |
1270 self.showTocAct.setWhatsThis(self.tr( | 1230 self.showTocAct.setWhatsThis(self.tr( |
1271 """<b>Table of Contents</b>""" | 1231 """<b>Table of Contents</b>""" |
1272 """<p>Shows the table of contents window.</p>""" | 1232 """<p>Shows the table of contents window.</p>""" |
1273 )) | 1233 )) |
1274 if not self.initShortcutsOnly: | 1234 self.showTocAct.triggered.connect(self.__showTocWindow) |
1275 self.showTocAct.triggered.connect(self.__showTocWindow) | |
1276 self.__actions.append(self.showTocAct) | 1235 self.__actions.append(self.showTocAct) |
1277 | 1236 |
1278 self.showIndexAct = E5Action( | 1237 self.showIndexAct = E5Action( |
1279 self.tr('Index'), | 1238 self.tr('Index'), |
1280 self.tr('Index'), | 1239 self.tr('Index'), |
1283 'Shows the index window')) | 1242 'Shows the index window')) |
1284 self.showIndexAct.setWhatsThis(self.tr( | 1243 self.showIndexAct.setWhatsThis(self.tr( |
1285 """<b>Index</b>""" | 1244 """<b>Index</b>""" |
1286 """<p>Shows the index window.</p>""" | 1245 """<p>Shows the index window.</p>""" |
1287 )) | 1246 )) |
1288 if not self.initShortcutsOnly: | 1247 self.showIndexAct.triggered.connect(self.__showIndexWindow) |
1289 self.showIndexAct.triggered.connect(self.__showIndexWindow) | |
1290 self.__actions.append(self.showIndexAct) | 1248 self.__actions.append(self.showIndexAct) |
1291 | 1249 |
1292 self.showSearchAct = E5Action( | 1250 self.showSearchAct = E5Action( |
1293 self.tr('Search'), | 1251 self.tr('Search'), |
1294 self.tr('Search'), | 1252 self.tr('Search'), |
1297 'Shows the search window')) | 1255 'Shows the search window')) |
1298 self.showSearchAct.setWhatsThis(self.tr( | 1256 self.showSearchAct.setWhatsThis(self.tr( |
1299 """<b>Search</b>""" | 1257 """<b>Search</b>""" |
1300 """<p>Shows the search window.</p>""" | 1258 """<p>Shows the search window.</p>""" |
1301 )) | 1259 )) |
1302 if not self.initShortcutsOnly: | 1260 self.showSearchAct.triggered.connect( |
1303 self.showSearchAct.triggered.connect( | 1261 self.__showSearchWindow) |
1304 self.__showSearchWindow) | |
1305 self.__actions.append(self.showSearchAct) | 1262 self.__actions.append(self.showSearchAct) |
1306 | 1263 |
1307 self.manageQtHelpDocsAct = E5Action( | 1264 self.manageQtHelpDocsAct = E5Action( |
1308 self.tr('Manage QtHelp Documents'), | 1265 self.tr('Manage QtHelp Documents'), |
1309 self.tr('Manage QtHelp &Documents'), | 1266 self.tr('Manage QtHelp &Documents'), |
1313 self.manageQtHelpDocsAct.setWhatsThis(self.tr( | 1270 self.manageQtHelpDocsAct.setWhatsThis(self.tr( |
1314 """<b>Manage QtHelp Documents</b>""" | 1271 """<b>Manage QtHelp Documents</b>""" |
1315 """<p>Shows a dialog to manage the QtHelp documentation""" | 1272 """<p>Shows a dialog to manage the QtHelp documentation""" |
1316 """ set.</p>""" | 1273 """ set.</p>""" |
1317 )) | 1274 )) |
1318 if not self.initShortcutsOnly: | 1275 self.manageQtHelpDocsAct.triggered.connect( |
1319 self.manageQtHelpDocsAct.triggered.connect( | 1276 self.__manageQtHelpDocumentation) |
1320 self.__manageQtHelpDocumentation) | |
1321 self.__actions.append(self.manageQtHelpDocsAct) | 1277 self.__actions.append(self.manageQtHelpDocsAct) |
1322 | 1278 |
1323 self.manageQtHelpFiltersAct = E5Action( | 1279 self.manageQtHelpFiltersAct = E5Action( |
1324 self.tr('Manage QtHelp Filters'), | 1280 self.tr('Manage QtHelp Filters'), |
1325 self.tr('Manage QtHelp &Filters'), | 1281 self.tr('Manage QtHelp &Filters'), |
1328 'Shows a dialog to manage the QtHelp filters')) | 1284 'Shows a dialog to manage the QtHelp filters')) |
1329 self.manageQtHelpFiltersAct.setWhatsThis(self.tr( | 1285 self.manageQtHelpFiltersAct.setWhatsThis(self.tr( |
1330 """<b>Manage QtHelp Filters</b>""" | 1286 """<b>Manage QtHelp Filters</b>""" |
1331 """<p>Shows a dialog to manage the QtHelp filters.</p>""" | 1287 """<p>Shows a dialog to manage the QtHelp filters.</p>""" |
1332 )) | 1288 )) |
1333 if not self.initShortcutsOnly: | 1289 self.manageQtHelpFiltersAct.triggered.connect( |
1334 self.manageQtHelpFiltersAct.triggered.connect( | 1290 self.__manageQtHelpFilters) |
1335 self.__manageQtHelpFilters) | |
1336 self.__actions.append(self.manageQtHelpFiltersAct) | 1291 self.__actions.append(self.manageQtHelpFiltersAct) |
1337 | 1292 |
1338 self.reindexDocumentationAct = E5Action( | 1293 self.reindexDocumentationAct = E5Action( |
1339 self.tr('Reindex Documentation'), | 1294 self.tr('Reindex Documentation'), |
1340 self.tr('&Reindex Documentation'), | 1295 self.tr('&Reindex Documentation'), |
1343 'Reindexes the documentation set')) | 1298 'Reindexes the documentation set')) |
1344 self.reindexDocumentationAct.setWhatsThis(self.tr( | 1299 self.reindexDocumentationAct.setWhatsThis(self.tr( |
1345 """<b>Reindex Documentation</b>""" | 1300 """<b>Reindex Documentation</b>""" |
1346 """<p>Reindexes the documentation set.</p>""" | 1301 """<p>Reindexes the documentation set.</p>""" |
1347 )) | 1302 )) |
1348 if not self.initShortcutsOnly: | 1303 self.reindexDocumentationAct.triggered.connect( |
1349 self.reindexDocumentationAct.triggered.connect( | 1304 self.__searchEngine.reindexDocumentation) |
1350 self.__searchEngine.reindexDocumentation) | |
1351 self.__actions.append(self.reindexDocumentationAct) | 1305 self.__actions.append(self.reindexDocumentationAct) |
1352 | 1306 |
1353 self.clearPrivateDataAct = E5Action( | 1307 self.clearPrivateDataAct = E5Action( |
1354 self.tr('Clear private data'), | 1308 self.tr('Clear private data'), |
1355 UI.PixmapCache.getIcon("clearPrivateData.png"), | 1309 UI.PixmapCache.getIcon("clearPrivateData.png"), |
1361 self.clearPrivateDataAct.setWhatsThis(self.tr( | 1315 self.clearPrivateDataAct.setWhatsThis(self.tr( |
1362 """<b>Clear private data</b>""" | 1316 """<b>Clear private data</b>""" |
1363 """<p>Clears the private data like browsing history, search""" | 1317 """<p>Clears the private data like browsing history, search""" |
1364 """ history or the favicons database.</p>""" | 1318 """ history or the favicons database.</p>""" |
1365 )) | 1319 )) |
1366 if not self.initShortcutsOnly: | 1320 self.clearPrivateDataAct.triggered.connect( |
1367 self.clearPrivateDataAct.triggered.connect( | 1321 self.__clearPrivateData) |
1368 self.__clearPrivateData) | |
1369 self.__actions.append(self.clearPrivateDataAct) | 1322 self.__actions.append(self.clearPrivateDataAct) |
1370 | 1323 |
1371 self.clearIconsAct = E5Action( | 1324 self.clearIconsAct = E5Action( |
1372 self.tr('Clear icons database'), | 1325 self.tr('Clear icons database'), |
1373 self.tr('Clear &icons database'), | 1326 self.tr('Clear &icons database'), |
1378 self.clearIconsAct.setWhatsThis(self.tr( | 1331 self.clearIconsAct.setWhatsThis(self.tr( |
1379 """<b>Clear icons database</b>""" | 1332 """<b>Clear icons database</b>""" |
1380 """<p>Clears the database of favicons of previously visited""" | 1333 """<p>Clears the database of favicons of previously visited""" |
1381 """ URLs.</p>""" | 1334 """ URLs.</p>""" |
1382 )) | 1335 )) |
1383 if not self.initShortcutsOnly: | 1336 self.clearIconsAct.triggered.connect(self.__clearIconsDatabase) |
1384 self.clearIconsAct.triggered.connect(self.__clearIconsDatabase) | |
1385 self.__actions.append(self.clearIconsAct) | 1337 self.__actions.append(self.clearIconsAct) |
1386 | 1338 |
1387 self.searchEnginesAct = E5Action( | 1339 self.searchEnginesAct = E5Action( |
1388 self.tr('Configure Search Engines'), | 1340 self.tr('Configure Search Engines'), |
1389 self.tr('Configure Search &Engines...'), | 1341 self.tr('Configure Search &Engines...'), |
1394 self.searchEnginesAct.setWhatsThis(self.tr( | 1346 self.searchEnginesAct.setWhatsThis(self.tr( |
1395 """<b>Configure Search Engines...</b>""" | 1347 """<b>Configure Search Engines...</b>""" |
1396 """<p>Opens a dialog to configure the available search""" | 1348 """<p>Opens a dialog to configure the available search""" |
1397 """ engines.</p>""" | 1349 """ engines.</p>""" |
1398 )) | 1350 )) |
1399 if not self.initShortcutsOnly: | 1351 self.searchEnginesAct.triggered.connect( |
1400 self.searchEnginesAct.triggered.connect( | 1352 self.__showEnginesConfigurationDialog) |
1401 self.__showEnginesConfigurationDialog) | |
1402 self.__actions.append(self.searchEnginesAct) | 1353 self.__actions.append(self.searchEnginesAct) |
1403 | 1354 |
1404 self.passwordsAct = E5Action( | 1355 self.passwordsAct = E5Action( |
1405 self.tr('Manage Saved Passwords'), | 1356 self.tr('Manage Saved Passwords'), |
1406 UI.PixmapCache.getIcon("passwords.png"), | 1357 UI.PixmapCache.getIcon("passwords.png"), |
1411 'Manage the saved passwords')) | 1362 'Manage the saved passwords')) |
1412 self.passwordsAct.setWhatsThis(self.tr( | 1363 self.passwordsAct.setWhatsThis(self.tr( |
1413 """<b>Manage Saved Passwords...</b>""" | 1364 """<b>Manage Saved Passwords...</b>""" |
1414 """<p>Opens a dialog to manage the saved passwords.</p>""" | 1365 """<p>Opens a dialog to manage the saved passwords.</p>""" |
1415 )) | 1366 )) |
1416 if not self.initShortcutsOnly: | 1367 self.passwordsAct.triggered.connect(self.__showPasswordsDialog) |
1417 self.passwordsAct.triggered.connect(self.__showPasswordsDialog) | |
1418 self.__actions.append(self.passwordsAct) | 1368 self.__actions.append(self.passwordsAct) |
1419 | 1369 |
1420 self.adblockAct = E5Action( | 1370 self.adblockAct = E5Action( |
1421 self.tr('Ad Block'), | 1371 self.tr('Ad Block'), |
1422 UI.PixmapCache.getIcon("adBlockPlus.png"), | 1372 UI.PixmapCache.getIcon("adBlockPlus.png"), |
1428 self.adblockAct.setWhatsThis(self.tr( | 1378 self.adblockAct.setWhatsThis(self.tr( |
1429 """<b>Ad Block...</b>""" | 1379 """<b>Ad Block...</b>""" |
1430 """<p>Opens a dialog to configure AdBlock subscriptions and""" | 1380 """<p>Opens a dialog to configure AdBlock subscriptions and""" |
1431 """ rules.</p>""" | 1381 """ rules.</p>""" |
1432 )) | 1382 )) |
1433 if not self.initShortcutsOnly: | 1383 self.adblockAct.triggered.connect(self.__showAdBlockDialog) |
1434 self.adblockAct.triggered.connect(self.__showAdBlockDialog) | |
1435 self.__actions.append(self.adblockAct) | 1384 self.__actions.append(self.adblockAct) |
1436 | 1385 |
1437 self.flashblockAct = E5Action( | 1386 self.flashblockAct = E5Action( |
1438 self.tr('ClickToFlash'), | 1387 self.tr('ClickToFlash'), |
1439 UI.PixmapCache.getIcon("flashBlock.png"), | 1388 UI.PixmapCache.getIcon("flashBlock.png"), |
1445 self.flashblockAct.setWhatsThis(self.tr( | 1394 self.flashblockAct.setWhatsThis(self.tr( |
1446 """<b>ClickToFlash...</b>""" | 1395 """<b>ClickToFlash...</b>""" |
1447 """<p>Opens a dialog to configure the ClickToFlash""" | 1396 """<p>Opens a dialog to configure the ClickToFlash""" |
1448 """ whitelist.</p>""" | 1397 """ whitelist.</p>""" |
1449 )) | 1398 )) |
1450 if not self.initShortcutsOnly: | 1399 self.flashblockAct.triggered.connect( |
1451 self.flashblockAct.triggered.connect( | 1400 self.__showClickToFlashDialog) |
1452 self.__showClickToFlashDialog) | |
1453 self.__actions.append(self.flashblockAct) | 1401 self.__actions.append(self.flashblockAct) |
1454 | 1402 |
1455 if SSL_AVAILABLE: | 1403 if SSL_AVAILABLE: |
1456 self.certificatesAct = E5Action( | 1404 self.certificatesAct = E5Action( |
1457 self.tr('Manage SSL Certificates'), | 1405 self.tr('Manage SSL Certificates'), |
1464 self.certificatesAct.setWhatsThis(self.tr( | 1412 self.certificatesAct.setWhatsThis(self.tr( |
1465 """<b>Manage SSL Certificates...</b>""" | 1413 """<b>Manage SSL Certificates...</b>""" |
1466 """<p>Opens a dialog to manage the saved SSL""" | 1414 """<p>Opens a dialog to manage the saved SSL""" |
1467 """ certificates.</p>""" | 1415 """ certificates.</p>""" |
1468 )) | 1416 )) |
1469 if not self.initShortcutsOnly: | 1417 self.certificatesAct.triggered.connect( |
1470 self.certificatesAct.triggered.connect( | 1418 self.__showCertificatesDialog) |
1471 self.__showCertificatesDialog) | |
1472 self.__actions.append(self.certificatesAct) | 1419 self.__actions.append(self.certificatesAct) |
1473 | 1420 |
1474 self.toolsMonitorAct = E5Action( | 1421 self.toolsMonitorAct = E5Action( |
1475 self.tr('Network Monitor'), | 1422 self.tr('Network Monitor'), |
1476 self.tr('&Network Monitor...'), | 1423 self.tr('&Network Monitor...'), |
1480 'Show the network monitor dialog')) | 1427 'Show the network monitor dialog')) |
1481 self.toolsMonitorAct.setWhatsThis(self.tr( | 1428 self.toolsMonitorAct.setWhatsThis(self.tr( |
1482 """<b>Network Monitor...</b>""" | 1429 """<b>Network Monitor...</b>""" |
1483 """<p>Shows the network monitor dialog.</p>""" | 1430 """<p>Shows the network monitor dialog.</p>""" |
1484 )) | 1431 )) |
1485 if not self.initShortcutsOnly: | 1432 self.toolsMonitorAct.triggered.connect( |
1486 self.toolsMonitorAct.triggered.connect( | 1433 self.__showNetworkMonitor) |
1487 self.__showNetworkMonitor) | |
1488 self.__actions.append(self.toolsMonitorAct) | 1434 self.__actions.append(self.toolsMonitorAct) |
1489 | 1435 |
1490 self.showDownloadManagerAct = E5Action( | 1436 self.showDownloadManagerAct = E5Action( |
1491 self.tr('Downloads'), | 1437 self.tr('Downloads'), |
1492 self.tr('Downloads'), | 1438 self.tr('Downloads'), |
1495 'Shows the downloads window')) | 1441 'Shows the downloads window')) |
1496 self.showDownloadManagerAct.setWhatsThis(self.tr( | 1442 self.showDownloadManagerAct.setWhatsThis(self.tr( |
1497 """<b>Downloads</b>""" | 1443 """<b>Downloads</b>""" |
1498 """<p>Shows the downloads window.</p>""" | 1444 """<p>Shows the downloads window.</p>""" |
1499 )) | 1445 )) |
1500 if not self.initShortcutsOnly: | 1446 self.showDownloadManagerAct.triggered.connect( |
1501 self.showDownloadManagerAct.triggered.connect( | 1447 self.__showDownloadsWindow) |
1502 self.__showDownloadsWindow) | |
1503 self.__actions.append(self.showDownloadManagerAct) | 1448 self.__actions.append(self.showDownloadManagerAct) |
1504 | 1449 |
1505 self.feedsManagerAct = E5Action( | 1450 self.feedsManagerAct = E5Action( |
1506 self.tr('RSS Feeds Dialog'), | 1451 self.tr('RSS Feeds Dialog'), |
1507 UI.PixmapCache.getIcon("rss22.png"), | 1452 UI.PixmapCache.getIcon("rss22.png"), |
1514 """<b>RSS Feeds Dialog...</b>""" | 1459 """<b>RSS Feeds Dialog...</b>""" |
1515 """<p>Open a dialog to show the configured RSS feeds.""" | 1460 """<p>Open a dialog to show the configured RSS feeds.""" |
1516 """ It can be used to mange the feeds and to show their""" | 1461 """ It can be used to mange the feeds and to show their""" |
1517 """ contents.</p>""" | 1462 """ contents.</p>""" |
1518 )) | 1463 )) |
1519 if not self.initShortcutsOnly: | 1464 self.feedsManagerAct.triggered.connect(self.__showFeedsManager) |
1520 self.feedsManagerAct.triggered.connect(self.__showFeedsManager) | |
1521 self.__actions.append(self.feedsManagerAct) | 1465 self.__actions.append(self.feedsManagerAct) |
1522 | 1466 |
1523 self.siteInfoAct = E5Action( | 1467 self.siteInfoAct = E5Action( |
1524 self.tr('Siteinfo Dialog'), | 1468 self.tr('Siteinfo Dialog'), |
1525 UI.PixmapCache.getIcon("helpAbout.png"), | 1469 UI.PixmapCache.getIcon("helpAbout.png"), |
1531 self.siteInfoAct.setWhatsThis(self.tr( | 1475 self.siteInfoAct.setWhatsThis(self.tr( |
1532 """<b>Siteinfo Dialog...</b>""" | 1476 """<b>Siteinfo Dialog...</b>""" |
1533 """<p>Opens a dialog showing some information about the current""" | 1477 """<p>Opens a dialog showing some information about the current""" |
1534 """ site.</p>""" | 1478 """ site.</p>""" |
1535 )) | 1479 )) |
1536 if not self.initShortcutsOnly: | 1480 self.siteInfoAct.triggered.connect(self.__showSiteinfoDialog) |
1537 self.siteInfoAct.triggered.connect(self.__showSiteinfoDialog) | |
1538 self.__actions.append(self.siteInfoAct) | 1481 self.__actions.append(self.siteInfoAct) |
1539 | 1482 |
1540 self.userAgentManagerAct = E5Action( | 1483 self.userAgentManagerAct = E5Action( |
1541 self.tr('Manage User Agent Settings'), | 1484 self.tr('Manage User Agent Settings'), |
1542 self.tr('Manage &User Agent Settings'), | 1485 self.tr('Manage &User Agent Settings'), |
1545 'Shows a dialog to manage the User Agent settings')) | 1488 'Shows a dialog to manage the User Agent settings')) |
1546 self.userAgentManagerAct.setWhatsThis(self.tr( | 1489 self.userAgentManagerAct.setWhatsThis(self.tr( |
1547 """<b>Manage User Agent Settings</b>""" | 1490 """<b>Manage User Agent Settings</b>""" |
1548 """<p>Shows a dialog to manage the User Agent settings.</p>""" | 1491 """<p>Shows a dialog to manage the User Agent settings.</p>""" |
1549 )) | 1492 )) |
1550 if not self.initShortcutsOnly: | 1493 self.userAgentManagerAct.triggered.connect( |
1551 self.userAgentManagerAct.triggered.connect( | 1494 self.__showUserAgentsDialog) |
1552 self.__showUserAgentsDialog) | |
1553 self.__actions.append(self.userAgentManagerAct) | 1495 self.__actions.append(self.userAgentManagerAct) |
1554 | 1496 |
1555 self.synchronizationAct = E5Action( | 1497 self.synchronizationAct = E5Action( |
1556 self.tr('Synchronize data'), | 1498 self.tr('Synchronize data'), |
1557 UI.PixmapCache.getIcon("sync.png"), | 1499 UI.PixmapCache.getIcon("sync.png"), |
1562 self.synchronizationAct.setWhatsThis(self.tr( | 1504 self.synchronizationAct.setWhatsThis(self.tr( |
1563 """<b>Synchronize Data...</b>""" | 1505 """<b>Synchronize Data...</b>""" |
1564 """<p>This shows a dialog to synchronize data via the""" | 1506 """<p>This shows a dialog to synchronize data via the""" |
1565 """ network.</p>""" | 1507 """ network.</p>""" |
1566 )) | 1508 )) |
1567 if not self.initShortcutsOnly: | 1509 self.synchronizationAct.triggered.connect( |
1568 self.synchronizationAct.triggered.connect( | 1510 self.__showSyncDialog) |
1569 self.__showSyncDialog) | |
1570 self.__actions.append(self.synchronizationAct) | 1511 self.__actions.append(self.synchronizationAct) |
1571 | 1512 |
1572 self.zoomValuesAct = E5Action( | 1513 self.zoomValuesAct = E5Action( |
1573 self.tr('Manage Saved Zoom Values'), | 1514 self.tr('Manage Saved Zoom Values'), |
1574 UI.PixmapCache.getIcon("zoomReset.png"), | 1515 UI.PixmapCache.getIcon("zoomReset.png"), |
1579 'Manage the saved zoom values')) | 1520 'Manage the saved zoom values')) |
1580 self.zoomValuesAct.setWhatsThis(self.tr( | 1521 self.zoomValuesAct.setWhatsThis(self.tr( |
1581 """<b>Manage Saved Zoom Values...</b>""" | 1522 """<b>Manage Saved Zoom Values...</b>""" |
1582 """<p>Opens a dialog to manage the saved zoom values.</p>""" | 1523 """<p>Opens a dialog to manage the saved zoom values.</p>""" |
1583 )) | 1524 )) |
1584 if not self.initShortcutsOnly: | 1525 self.zoomValuesAct.triggered.connect(self.__showZoomValuesDialog) |
1585 self.zoomValuesAct.triggered.connect(self.__showZoomValuesDialog) | |
1586 self.__actions.append(self.zoomValuesAct) | 1526 self.__actions.append(self.zoomValuesAct) |
1527 | |
1528 self.shortcutsAct = E5Action( | |
1529 self.tr('Keyboard Shortcuts'), | |
1530 UI.PixmapCache.getIcon("configureShortcuts.png"), | |
1531 self.tr('Keyboard &Shortcuts...'), | |
1532 0, 0, | |
1533 self, 'webbrowser_keyboard_shortcuts') | |
1534 self.shortcutsAct.setStatusTip(self.tr( | |
1535 'Set the keyboard shortcuts')) | |
1536 self.shortcutsAct.setWhatsThis(self.tr( | |
1537 """<b>Keyboard Shortcuts</b>""" | |
1538 """<p>Set the keyboard shortcuts of the application""" | |
1539 """ with your prefered values.</p>""" | |
1540 )) | |
1541 self.shortcutsAct.triggered.connect(self.__configShortcuts) | |
1542 self.__actions.append(self.shortcutsAct) | |
1543 | |
1544 self.exportShortcutsAct = E5Action( | |
1545 self.tr('Export Keyboard Shortcuts'), | |
1546 UI.PixmapCache.getIcon("exportShortcuts.png"), | |
1547 self.tr('&Export Keyboard Shortcuts...'), | |
1548 0, 0, self, 'export_keyboard_shortcuts') | |
1549 self.exportShortcutsAct.setStatusTip(self.tr( | |
1550 'Export the keyboard shortcuts')) | |
1551 self.exportShortcutsAct.setWhatsThis(self.tr( | |
1552 """<b>Export Keyboard Shortcuts</b>""" | |
1553 """<p>Export the keyboard shortcuts of the application.</p>""" | |
1554 )) | |
1555 self.exportShortcutsAct.triggered.connect(self.__exportShortcuts) | |
1556 self.__actions.append(self.exportShortcutsAct) | |
1557 | |
1558 self.importShortcutsAct = E5Action( | |
1559 self.tr('Import Keyboard Shortcuts'), | |
1560 UI.PixmapCache.getIcon("importShortcuts.png"), | |
1561 self.tr('&Import Keyboard Shortcuts...'), | |
1562 0, 0, self, 'import_keyboard_shortcuts') | |
1563 self.importShortcutsAct.setStatusTip(self.tr( | |
1564 'Import the keyboard shortcuts')) | |
1565 self.importShortcutsAct.setWhatsThis(self.tr( | |
1566 """<b>Import Keyboard Shortcuts</b>""" | |
1567 """<p>Import the keyboard shortcuts of the application.</p>""" | |
1568 )) | |
1569 self.importShortcutsAct.triggered.connect(self.__importShortcuts) | |
1570 self.__actions.append(self.importShortcutsAct) | |
1587 | 1571 |
1588 self.backAct.setEnabled(False) | 1572 self.backAct.setEnabled(False) |
1589 self.forwardAct.setEnabled(False) | 1573 self.forwardAct.setEnabled(False) |
1590 | 1574 |
1591 # now read the keyboard shortcuts for the actions | 1575 # now read the keyboard shortcuts for the actions |
1701 self.bookmarksMenu.setInitialActions(bookmarksActions) | 1685 self.bookmarksMenu.setInitialActions(bookmarksActions) |
1702 | 1686 |
1703 menu = mb.addMenu(self.tr('&Settings')) | 1687 menu = mb.addMenu(self.tr('&Settings')) |
1704 menu.setTearOffEnabled(True) | 1688 menu.setTearOffEnabled(True) |
1705 menu.addAction(self.prefAct) | 1689 menu.addAction(self.prefAct) |
1690 menu.addSeparator() | |
1691 menu.addAction(self.shortcutsAct) | |
1692 menu.addAction(self.exportShortcutsAct) | |
1693 menu.addAction(self.importShortcutsAct) | |
1694 menu.addSeparator() | |
1706 menu.addAction(self.acceptedLanguagesAct) | 1695 menu.addAction(self.acceptedLanguagesAct) |
1707 menu.addAction(self.cookiesAct) | 1696 menu.addAction(self.cookiesAct) |
1708 menu.addAction(self.flashCookiesAct) | 1697 menu.addAction(self.flashCookiesAct) |
1709 menu.addAction(self.offlineStorageAct) | 1698 menu.addAction(self.offlineStorageAct) |
1710 menu.addAction(self.personalDataAct) | 1699 menu.addAction(self.personalDataAct) |
1835 | 1824 |
1836 settingstb = self.addToolBar(self.tr("Settings")) | 1825 settingstb = self.addToolBar(self.tr("Settings")) |
1837 settingstb.setObjectName("SettingsToolBar") | 1826 settingstb.setObjectName("SettingsToolBar") |
1838 settingstb.setIconSize(UI.Config.ToolBarIconSize) | 1827 settingstb.setIconSize(UI.Config.ToolBarIconSize) |
1839 settingstb.addAction(self.prefAct) | 1828 settingstb.addAction(self.prefAct) |
1829 settingstb.addAction(self.shortcutsAct) | |
1840 settingstb.addAction(self.acceptedLanguagesAct) | 1830 settingstb.addAction(self.acceptedLanguagesAct) |
1841 settingstb.addAction(self.cookiesAct) | 1831 settingstb.addAction(self.cookiesAct) |
1842 settingstb.addAction(self.flashCookiesAct) | 1832 settingstb.addAction(self.flashCookiesAct) |
1843 settingstb.addAction(self.offlineStorageAct) | 1833 settingstb.addAction(self.offlineStorageAct) |
1844 settingstb.addAction(self.personalDataAct) | 1834 settingstb.addAction(self.personalDataAct) |
2009 linkName = "" | 1999 linkName = "" |
2010 elif isinstance(link, QUrl): | 2000 elif isinstance(link, QUrl): |
2011 linkName = link.toString() | 2001 linkName = link.toString() |
2012 else: | 2002 else: |
2013 linkName = link | 2003 linkName = link |
2014 h = HelpWindow(linkName, ".", self.parent(), "qbrowser", self.fromEric) | 2004 h = HelpWindow(linkName, ".", self.parent(), "qbrowser") |
2015 h.show() | 2005 h.show() |
2016 | 2006 |
2017 def __openFile(self): | 2007 def __openFile(self): |
2018 """ | 2008 """ |
2019 Private slot called to open a file. | 2009 Private slot called to open a file. |
2296 else: | 2286 else: |
2297 Preferences.setGeometry("HelpViewerGeometry", QByteArray()) | 2287 Preferences.setGeometry("HelpViewerGeometry", QByteArray()) |
2298 | 2288 |
2299 try: | 2289 try: |
2300 browserIndex = HelpWindow.helpwindows.index(self) | 2290 browserIndex = HelpWindow.helpwindows.index(self) |
2301 if not self.fromEric and len(HelpWindow.helpwindows): | 2291 if len(HelpWindow.helpwindows): |
2302 if browserIndex == 0: | 2292 if browserIndex == 0: |
2303 if len(HelpWindow.helpwindows) > 1: | 2293 if len(HelpWindow.helpwindows) > 1: |
2304 # first window will be deleted | 2294 # first window will be deleted |
2305 QDesktopServices.setUrlHandler( | 2295 QDesktopServices.setUrlHandler( |
2306 "http", | 2296 "http", |
2309 "https", | 2299 "https", |
2310 HelpWindow.helpwindows[1].urlHandler) | 2300 HelpWindow.helpwindows[1].urlHandler) |
2311 else: | 2301 else: |
2312 QDesktopServices.unsetUrlHandler("http") | 2302 QDesktopServices.unsetUrlHandler("http") |
2313 QDesktopServices.unsetUrlHandler("https") | 2303 QDesktopServices.unsetUrlHandler("https") |
2314 if self.fromEric or len(HelpWindow.helpwindows) > 0: | 2304 if len(HelpWindow.helpwindows) > 0: |
2315 del HelpWindow.helpwindows[browserIndex] | 2305 del HelpWindow.helpwindows[browserIndex] |
2316 except ValueError: | 2306 except ValueError: |
2317 pass | 2307 pass |
2318 | 2308 |
2319 if not self.fromEric: | 2309 Preferences.syncPreferences() |
2320 Preferences.syncPreferences() | |
2321 | 2310 |
2322 self.__shutdownCalled = True | 2311 self.__shutdownCalled = True |
2323 return True | 2312 return True |
2324 | 2313 |
2325 def __backward(self): | 2314 def __backward(self): |
2508 """ | 2497 """ |
2509 Private slot to set the preferences. | 2498 Private slot to set the preferences. |
2510 """ | 2499 """ |
2511 from Preferences.ConfigurationDialog import ConfigurationDialog | 2500 from Preferences.ConfigurationDialog import ConfigurationDialog |
2512 dlg = ConfigurationDialog( | 2501 dlg = ConfigurationDialog( |
2513 self, 'Configuration', True, fromEric=self.fromEric, | 2502 self, 'Configuration', True, fromEric=False, |
2514 displayMode=ConfigurationDialog.HelpBrowserMode) | 2503 displayMode=ConfigurationDialog.HelpBrowserMode) |
2515 dlg.preferencesChanged.connect(self.preferencesChanged) | 2504 dlg.preferencesChanged.connect(self.preferencesChanged) |
2516 dlg.masterPasswordChanged.connect( | 2505 dlg.masterPasswordChanged.connect( |
2517 lambda old, new: self.masterPasswordChanged(old, new, local=True)) | 2506 lambda old, new: self.masterPasswordChanged(old, new, local=True)) |
2518 dlg.show() | 2507 dlg.show() |
2530 | 2519 |
2531 def preferencesChanged(self): | 2520 def preferencesChanged(self): |
2532 """ | 2521 """ |
2533 Public slot to handle a change of preferences. | 2522 Public slot to handle a change of preferences. |
2534 """ | 2523 """ |
2535 if not self.fromEric: | 2524 self.setStyle(Preferences.getUI("Style"), |
2536 self.setStyle(Preferences.getUI("Style"), | 2525 Preferences.getUI("StyleSheet")) |
2537 Preferences.getUI("StyleSheet")) | |
2538 | 2526 |
2539 self.__initWebSettings() | 2527 self.__initWebSettings() |
2540 | 2528 |
2541 self.networkAccessManager().preferencesChanged() | 2529 self.networkAccessManager().preferencesChanged() |
2542 | 2530 |
2568 @param local flag indicating being called from the local configuration | 2556 @param local flag indicating being called from the local configuration |
2569 dialog | 2557 dialog |
2570 @type bool | 2558 @type bool |
2571 """ | 2559 """ |
2572 self.passwordManager().masterPasswordChanged(oldPassword, newPassword) | 2560 self.passwordManager().masterPasswordChanged(oldPassword, newPassword) |
2573 if self.fromEric and local: | 2561 if local: |
2574 # we were called from our local configuration dialog | 2562 # we were called from our local configuration dialog |
2575 Preferences.convertPasswords(oldPassword, newPassword) | 2563 Preferences.convertPasswords(oldPassword, newPassword) |
2576 Utilities.crypto.changeRememberedMaster(newPassword) | 2564 Utilities.crypto.changeRememberedMaster(newPassword) |
2577 | 2565 |
2578 def __showAcceptedLanguages(self): | 2566 def __showAcceptedLanguages(self): |
2917 | 2905 |
2918 def __removeOldDocumentation(self): | 2906 def __removeOldDocumentation(self): |
2919 """ | 2907 """ |
2920 Private slot to remove non-existing documentation from the help engine. | 2908 Private slot to remove non-existing documentation from the help engine. |
2921 """ | 2909 """ |
2922 for namespace in self.__helpEngine.registeredDocumentations(): | 2910 if HelpWindow._useQtHelp: |
2923 docFile = self.__helpEngine.documentationFileName(namespace) | 2911 for namespace in self.__helpEngine.registeredDocumentations(): |
2924 if not os.path.exists(docFile): | 2912 docFile = self.__helpEngine.documentationFileName(namespace) |
2925 self.__helpEngine.unregisterDocumentation(namespace) | 2913 if not os.path.exists(docFile): |
2914 self.__helpEngine.unregisterDocumentation(namespace) | |
2926 | 2915 |
2927 def __lookForNewDocumentation(self): | 2916 def __lookForNewDocumentation(self): |
2928 """ | 2917 """ |
2929 Private slot to look for new documentation to be loaded into the | 2918 Private slot to look for new documentation to be loaded into the |
2930 help database. | 2919 help database. |
3916 | 3905 |
3917 @param icon icon to be shown in the notification (QPixmap) | 3906 @param icon icon to be shown in the notification (QPixmap) |
3918 @param heading heading of the notification (string) | 3907 @param heading heading of the notification (string) |
3919 @param text text of the notification (string) | 3908 @param text text of the notification (string) |
3920 """ | 3909 """ |
3921 if cls._fromEric: | 3910 if Preferences.getUI("NotificationsEnabled"): |
3922 e5App().getObject("UserInterface").showNotification( | 3911 if cls._notification is None: |
3923 icon, heading, text) | 3912 from UI.NotificationWidget import NotificationWidget |
3924 else: | 3913 cls._notification = NotificationWidget() |
3925 if Preferences.getUI("NotificationsEnabled"): | 3914 cls._notification.setPixmap(icon) |
3926 if cls._notification is None: | 3915 cls._notification.setHeading(heading) |
3927 from UI.NotificationWidget import NotificationWidget | 3916 cls._notification.setText(text) |
3928 cls._notification = NotificationWidget() | 3917 cls._notification.setTimeout( |
3929 cls._notification.setPixmap(icon) | 3918 Preferences.getUI("NotificationTimeout")) |
3930 cls._notification.setHeading(heading) | 3919 cls._notification.move( |
3931 cls._notification.setText(text) | 3920 Preferences.getUI("NotificationPosition")) |
3932 cls._notification.setTimeout( | 3921 cls._notification.show() |
3933 Preferences.getUI("NotificationTimeout")) | |
3934 cls._notification.move( | |
3935 Preferences.getUI("NotificationPosition")) | |
3936 cls._notification.show() | |
3937 | 3922 |
3938 @classmethod | 3923 @classmethod |
3939 def notificationsEnabled(cls): | 3924 def notificationsEnabled(cls): |
3940 """ | 3925 """ |
3941 Class method to check, if notifications are enabled. | 3926 Class method to check, if notifications are enabled. |
3942 | 3927 |
3943 @return flag indicating, if notifications are enabled (boolean) | 3928 @return flag indicating, if notifications are enabled (boolean) |
3944 """ | 3929 """ |
3945 if cls._fromEric: | 3930 return Preferences.getUI("NotificationsEnabled") |
3946 return e5App().getObject("UserInterface").notificationsEnabled() | 3931 |
3947 else: | 3932 ############################################################### |
3948 return Preferences.getUI("NotificationsEnabled") | 3933 ## Methods below implement single application related functions |
3934 ############################################################### | |
3935 | |
3936 @pyqtSlot(str) | |
3937 def __saLoadUrl(self, urlStr): | |
3938 """ | |
3939 Private slot to load an URL received via the single application | |
3940 protocol. | |
3941 | |
3942 @param urlStr URL to be loaded | |
3943 @type str | |
3944 """ | |
3945 url = QUrl.fromUserInput(urlStr) | |
3946 self.__linkActivated(url) | |
3947 | |
3948 @pyqtSlot(str) | |
3949 def __saNewTab(self, urlStr): | |
3950 """ | |
3951 Private slot to load an URL received via the single application | |
3952 protocol in a new tab. | |
3953 | |
3954 @param urlStr URL to be loaded | |
3955 @type str | |
3956 """ | |
3957 url = QUrl.fromUserInput(urlStr) | |
3958 self.newTab(url) | |
3959 | |
3960 @pyqtSlot(str) | |
3961 def __saSearchWord(self, word): | |
3962 """ | |
3963 Private slot to search for the given word. | |
3964 | |
3965 @param word word to be searched for | |
3966 @type str | |
3967 """ | |
3968 if HelpWindow._useQtHelp: | |
3969 self.__searchWord = word | |
3970 self.__searchForWord() | |
3971 | |
3972 ###################################################### | |
3973 ## Methods below implement shortcuts related functions | |
3974 ###################################################### | |
3975 | |
3976 def __configShortcuts(self): | |
3977 """ | |
3978 Private slot to configure the keyboard shortcuts. | |
3979 """ | |
3980 if self.__shortcutsDialog is None: | |
3981 from Preferences.ShortcutsDialog import ShortcutsDialog | |
3982 self.__shortcutsDialog = ShortcutsDialog(self) | |
3983 self.__shortcutsDialog.populate(helpViewer=self) | |
3984 self.__shortcutsDialog.show() | |
3985 | |
3986 def __exportShortcuts(self): | |
3987 """ | |
3988 Private slot to export the keyboard shortcuts. | |
3989 """ | |
3990 fn, selectedFilter = E5FileDialog.getSaveFileNameAndFilter( | |
3991 None, | |
3992 self.tr("Export Keyboard Shortcuts"), | |
3993 "", | |
3994 self.tr("Keyboard shortcut file (*.e4k)"), | |
3995 "", | |
3996 E5FileDialog.Options(E5FileDialog.DontConfirmOverwrite)) | |
3997 | |
3998 if not fn: | |
3999 return | |
4000 | |
4001 ext = QFileInfo(fn).suffix() | |
4002 if not ext: | |
4003 ex = selectedFilter.split("(*")[1].split(")")[0] | |
4004 if ex: | |
4005 fn += ex | |
4006 | |
4007 from Preferences import Shortcuts | |
4008 Shortcuts.exportShortcuts(fn, helpViewer=self) | |
4009 | |
4010 def __importShortcuts(self): | |
4011 """ | |
4012 Private slot to import the keyboard shortcuts. | |
4013 """ | |
4014 fn = E5FileDialog.getOpenFileName( | |
4015 None, | |
4016 self.tr("Import Keyboard Shortcuts"), | |
4017 "", | |
4018 self.tr("Keyboard shortcut file (*.e4k)")) | |
4019 | |
4020 if fn: | |
4021 from Preferences import Shortcuts | |
4022 Shortcuts.importShortcuts(fn, helpViewer=self) |