944:1b59c4ba121e | 945:8cd4d08fa9f6 |
---|---|
55 import Utilities | 55 import Utilities |
56 | 56 |
57 import UI.PixmapCache | 57 import UI.PixmapCache |
58 import UI.Config | 58 import UI.Config |
59 | 59 |
60 | |
60 class HelpWindow(QMainWindow): | 61 class HelpWindow(QMainWindow): |
61 """ | 62 """ |
62 Class implementing the web browser main window. | 63 Class implementing the web browser main window. |
63 | 64 |
64 @signal helpClosed() emitted after the window was requested to close down | 65 @signal helpClosed() emitted after the window was requested to close down |
80 _historyManager = None | 81 _historyManager = None |
81 _passwordManager = None | 82 _passwordManager = None |
82 _adblockManager = None | 83 _adblockManager = None |
83 _downloadManager = None | 84 _downloadManager = None |
84 | 85 |
85 def __init__(self, home, path, parent, name, fromEric = False, | 86 def __init__(self, home, path, parent, name, fromEric=False, |
86 initShortcutsOnly = False, searchWord = None): | 87 initShortcutsOnly=False, searchWord=None): |
87 """ | 88 """ |
88 Constructor | 89 Constructor |
89 | 90 |
90 @param home the URL to be shown (string) | 91 @param home the URL to be shown (string) |
91 @param path the path of the working dir (usually '.') (string) | 92 @param path the path of the working dir (usually '.') (string) |
110 | 111 |
111 if self.initShortcutsOnly: | 112 if self.initShortcutsOnly: |
112 self.__initActions() | 113 self.__initActions() |
113 else: | 114 else: |
114 self.__helpEngine = \ | 115 self.__helpEngine = \ |
115 QHelpEngine(os.path.join(Utilities.getConfigDir(), | 116 QHelpEngine(os.path.join(Utilities.getConfigDir(), |
116 "browser", "eric5help.qhc"), self) | 117 "browser", "eric5help.qhc"), self) |
117 self.__helpEngine.warning.connect(self.__warning) | 118 self.__helpEngine.warning.connect(self.__warning) |
118 self.__helpInstaller = None | 119 self.__helpInstaller = None |
119 | 120 |
120 self.tabWidget = HelpTabWidget(self) | 121 self.tabWidget = HelpTabWidget(self) |
207 | 208 |
208 QTimer.singleShot(0, self.__lookForNewDocumentation) | 209 QTimer.singleShot(0, self.__lookForNewDocumentation) |
209 if self.__searchWord is not None: | 210 if self.__searchWord is not None: |
210 QTimer.singleShot(0, self.__searchForWord) | 211 QTimer.singleShot(0, self.__searchForWord) |
211 | 212 |
212 def __setIconDatabasePath(self, enable = True): | 213 def __setIconDatabasePath(self, enable=True): |
213 """ | 214 """ |
214 Private method to set the favicons path. | 215 Private method to set the favicons path. |
215 | 216 |
216 @param enable flag indicating to enabled icon storage (boolean) | 217 @param enable flag indicating to enabled icon storage (boolean) |
217 """ | 218 """ |
218 if enable: | 219 if enable: |
219 iconDatabasePath = os.path.join(Utilities.getConfigDir(), | 220 iconDatabasePath = os.path.join(Utilities.getConfigDir(), |
220 "browser", "favicons") | 221 "browser", "favicons") |
221 if not os.path.exists(iconDatabasePath): | 222 if not os.path.exists(iconDatabasePath): |
222 os.makedirs(iconDatabasePath) | 223 os.makedirs(iconDatabasePath) |
223 else: | 224 else: |
224 iconDatabasePath = "" # setting an empty path disables it | 225 iconDatabasePath = "" # setting an empty path disables it |
241 | 242 |
242 styleSheet = Preferences.getHelp("UserStyleSheet") | 243 styleSheet = Preferences.getHelp("UserStyleSheet") |
243 if styleSheet: | 244 if styleSheet: |
244 settings.setUserStyleSheetUrl(QUrl(styleSheet)) | 245 settings.setUserStyleSheetUrl(QUrl(styleSheet)) |
245 | 246 |
246 settings.setAttribute(QWebSettings.AutoLoadImages, | 247 settings.setAttribute(QWebSettings.AutoLoadImages, |
247 Preferences.getHelp("AutoLoadImages")) | 248 Preferences.getHelp("AutoLoadImages")) |
248 settings.setAttribute(QWebSettings.JavaEnabled, | 249 settings.setAttribute(QWebSettings.JavaEnabled, |
249 Preferences.getHelp("JavaEnabled")) | 250 Preferences.getHelp("JavaEnabled")) |
250 settings.setAttribute(QWebSettings.JavascriptEnabled, | 251 settings.setAttribute(QWebSettings.JavascriptEnabled, |
251 Preferences.getHelp("JavaScriptEnabled")) | 252 Preferences.getHelp("JavaScriptEnabled")) |
252 settings.setAttribute(QWebSettings.JavascriptCanOpenWindows, | 253 settings.setAttribute(QWebSettings.JavascriptCanOpenWindows, |
253 Preferences.getHelp("JavaScriptCanOpenWindows")) | 254 Preferences.getHelp("JavaScriptCanOpenWindows")) |
254 settings.setAttribute(QWebSettings.JavascriptCanAccessClipboard, | 255 settings.setAttribute(QWebSettings.JavascriptCanAccessClipboard, |
255 Preferences.getHelp("JavaScriptCanAccessClipboard")) | 256 Preferences.getHelp("JavaScriptCanAccessClipboard")) |
256 settings.setAttribute(QWebSettings.PluginsEnabled, | 257 settings.setAttribute(QWebSettings.PluginsEnabled, |
257 Preferences.getHelp("PluginsEnabled")) | 258 Preferences.getHelp("PluginsEnabled")) |
258 | 259 |
259 if hasattr(QWebSettings, "PrintElementBackgrounds"): | 260 if hasattr(QWebSettings, "PrintElementBackgrounds"): |
260 settings.setAttribute(QWebSettings.PrintElementBackgrounds, | 261 settings.setAttribute(QWebSettings.PrintElementBackgrounds, |
261 Preferences.getHelp("PrintBackgrounds")) | 262 Preferences.getHelp("PrintBackgrounds")) |
262 | 263 |
263 if hasattr(QWebSettings, "setOfflineStoragePath"): | 264 if hasattr(QWebSettings, "setOfflineStoragePath"): |
264 settings.setAttribute(QWebSettings.OfflineStorageDatabaseEnabled, | 265 settings.setAttribute(QWebSettings.OfflineStorageDatabaseEnabled, |
265 Preferences.getHelp("OfflineStorageDatabaseEnabled")) | 266 Preferences.getHelp("OfflineStorageDatabaseEnabled")) |
266 webDatabaseDir = os.path.join( | 267 webDatabaseDir = os.path.join( |
267 Utilities.getConfigDir(), "browser", "webdatabases") | 268 Utilities.getConfigDir(), "browser", "webdatabases") |
268 if not os.path.exists(webDatabaseDir): | 269 if not os.path.exists(webDatabaseDir): |
269 os.makedirs(webDatabaseDir) | 270 os.makedirs(webDatabaseDir) |
270 settings.setOfflineStoragePath(webDatabaseDir) | 271 settings.setOfflineStoragePath(webDatabaseDir) |
271 settings.setOfflineStorageDefaultQuota( | 272 settings.setOfflineStorageDefaultQuota( |
272 Preferences.getHelp("OfflineStorageDatabaseQuota") * 1024 * 1024) | 273 Preferences.getHelp("OfflineStorageDatabaseQuota") * 1024 * 1024) |
273 | 274 |
274 if hasattr(QWebSettings, "OfflineWebApplicationCacheEnabled"): | 275 if hasattr(QWebSettings, "OfflineWebApplicationCacheEnabled"): |
275 settings.setAttribute(QWebSettings.OfflineWebApplicationCacheEnabled, | 276 settings.setAttribute(QWebSettings.OfflineWebApplicationCacheEnabled, |
276 Preferences.getHelp("OfflineWebApplicationCacheEnabled")) | 277 Preferences.getHelp("OfflineWebApplicationCacheEnabled")) |
277 appCacheDir = os.path.join( | 278 appCacheDir = os.path.join( |
278 Utilities.getConfigDir(), "browser", "webappcaches") | 279 Utilities.getConfigDir(), "browser", "webappcaches") |
279 if not os.path.exists(appCacheDir): | 280 if not os.path.exists(appCacheDir): |
280 os.makedirs(appCacheDir) | 281 os.makedirs(appCacheDir) |
281 settings.setOfflineWebApplicationCachePath(appCacheDir) | 282 settings.setOfflineWebApplicationCachePath(appCacheDir) |
282 settings.setOfflineWebApplicationCacheQuota( | 283 settings.setOfflineWebApplicationCacheQuota( |
283 Preferences.getHelp("OfflineWebApplicationCacheQuota") * 1024 * 1024) | 284 Preferences.getHelp("OfflineWebApplicationCacheQuota") * 1024 * 1024) |
284 | 285 |
285 if hasattr(QWebSettings, "LocalStorageEnabled"): | 286 if hasattr(QWebSettings, "LocalStorageEnabled"): |
286 settings.setAttribute(QWebSettings.LocalStorageEnabled, | 287 settings.setAttribute(QWebSettings.LocalStorageEnabled, |
287 Preferences.getHelp("LocalStorageEnabled")) | 288 Preferences.getHelp("LocalStorageEnabled")) |
288 localStorageDir = os.path.join( | 289 localStorageDir = os.path.join( |
289 Utilities.getConfigDir(), "browser", "weblocalstorage") | 290 Utilities.getConfigDir(), "browser", "weblocalstorage") |
290 if not os.path.exists(localStorageDir): | 291 if not os.path.exists(localStorageDir): |
291 os.makedirs(localStorageDir) | 292 os.makedirs(localStorageDir) |
292 settings.setLocalStoragePath(localStorageDir) | 293 settings.setLocalStoragePath(localStorageDir) |
293 | 294 |
294 if hasattr(QWebSettings, "DnsPrefetchEnabled"): | 295 if hasattr(QWebSettings, "DnsPrefetchEnabled"): |
295 settings.setAttribute(QWebSettings.DnsPrefetchEnabled, | 296 settings.setAttribute(QWebSettings.DnsPrefetchEnabled, |
296 Preferences.getHelp("DnsPrefetchEnabled")) | 297 Preferences.getHelp("DnsPrefetchEnabled")) |
297 | 298 |
298 if hasattr(QWebSettings, "defaultTextEncoding"): | 299 if hasattr(QWebSettings, "defaultTextEncoding"): |
299 settings.setDefaultTextEncoding( | 300 settings.setDefaultTextEncoding( |
300 Preferences.getHelp("DefaultTextEncoding")) | 301 Preferences.getHelp("DefaultTextEncoding")) |
304 Private method to define the user interface actions. | 305 Private method to define the user interface actions. |
305 """ | 306 """ |
306 # list of all actions | 307 # list of all actions |
307 self.__actions = [] | 308 self.__actions = [] |
308 | 309 |
309 self.newTabAct = E5Action(self.trUtf8('New Tab'), | 310 self.newTabAct = E5Action(self.trUtf8('New Tab'), |
310 UI.PixmapCache.getIcon("tabNew.png"), | 311 UI.PixmapCache.getIcon("tabNew.png"), |
311 self.trUtf8('&New Tab'), | 312 self.trUtf8('&New Tab'), |
312 QKeySequence(self.trUtf8("Ctrl+T","File|New Tab")), | 313 QKeySequence(self.trUtf8("Ctrl+T", "File|New Tab")), |
313 0, self, 'help_file_new_tab') | 314 0, self, 'help_file_new_tab') |
314 self.newTabAct.setStatusTip(self.trUtf8('Open a new help window tab')) | 315 self.newTabAct.setStatusTip(self.trUtf8('Open a new help window tab')) |
315 self.newTabAct.setWhatsThis(self.trUtf8( | 316 self.newTabAct.setWhatsThis(self.trUtf8( |
316 """<b>New Tab</b>""" | 317 """<b>New Tab</b>""" |
317 """<p>This opens a new help window tab.</p>""" | 318 """<p>This opens a new help window tab.</p>""" |
318 )) | 319 )) |
319 if not self.initShortcutsOnly: | 320 if not self.initShortcutsOnly: |
320 self.newTabAct.triggered[()].connect(self.newTab) | 321 self.newTabAct.triggered[()].connect(self.newTab) |
321 self.__actions.append(self.newTabAct) | 322 self.__actions.append(self.newTabAct) |
322 | 323 |
323 self.newAct = E5Action(self.trUtf8('New Window'), | 324 self.newAct = E5Action(self.trUtf8('New Window'), |
324 UI.PixmapCache.getIcon("newWindow.png"), | 325 UI.PixmapCache.getIcon("newWindow.png"), |
325 self.trUtf8('New &Window'), | 326 self.trUtf8('New &Window'), |
326 QKeySequence(self.trUtf8("Ctrl+N","File|New Window")), | 327 QKeySequence(self.trUtf8("Ctrl+N", "File|New Window")), |
327 0, self, 'help_file_new_window') | 328 0, self, 'help_file_new_window') |
328 self.newAct.setStatusTip(self.trUtf8('Open a new help browser window')) | 329 self.newAct.setStatusTip(self.trUtf8('Open a new help browser window')) |
329 self.newAct.setWhatsThis(self.trUtf8( | 330 self.newAct.setWhatsThis(self.trUtf8( |
330 """<b>New Window</b>""" | 331 """<b>New Window</b>""" |
331 """<p>This opens a new help browser window.</p>""" | 332 """<p>This opens a new help browser window.</p>""" |
332 )) | 333 )) |
333 if not self.initShortcutsOnly: | 334 if not self.initShortcutsOnly: |
334 self.newAct.triggered[()].connect(self.newWindow) | 335 self.newAct.triggered[()].connect(self.newWindow) |
335 self.__actions.append(self.newAct) | 336 self.__actions.append(self.newAct) |
336 | 337 |
337 self.openAct = E5Action(self.trUtf8('Open File'), | 338 self.openAct = E5Action(self.trUtf8('Open File'), |
338 UI.PixmapCache.getIcon("open.png"), | 339 UI.PixmapCache.getIcon("open.png"), |
339 self.trUtf8('&Open File'), | 340 self.trUtf8('&Open File'), |
340 QKeySequence(self.trUtf8("Ctrl+O","File|Open")), | 341 QKeySequence(self.trUtf8("Ctrl+O", "File|Open")), |
341 0, self, 'help_file_open') | 342 0, self, 'help_file_open') |
342 self.openAct.setStatusTip(self.trUtf8('Open a help file for display')) | 343 self.openAct.setStatusTip(self.trUtf8('Open a help file for display')) |
343 self.openAct.setWhatsThis(self.trUtf8( | 344 self.openAct.setWhatsThis(self.trUtf8( |
344 """<b>Open File</b>""" | 345 """<b>Open File</b>""" |
345 """<p>This opens a new help file for display.""" | 346 """<p>This opens a new help file for display.""" |
347 )) | 348 )) |
348 if not self.initShortcutsOnly: | 349 if not self.initShortcutsOnly: |
349 self.openAct.triggered[()].connect(self.__openFile) | 350 self.openAct.triggered[()].connect(self.__openFile) |
350 self.__actions.append(self.openAct) | 351 self.__actions.append(self.openAct) |
351 | 352 |
352 self.openTabAct = E5Action(self.trUtf8('Open File in New Tab'), | 353 self.openTabAct = E5Action(self.trUtf8('Open File in New Tab'), |
353 UI.PixmapCache.getIcon("openNewTab.png"), | 354 UI.PixmapCache.getIcon("openNewTab.png"), |
354 self.trUtf8('Open File in New &Tab'), | 355 self.trUtf8('Open File in New &Tab'), |
355 QKeySequence(self.trUtf8("Shift+Ctrl+O","File|Open in new tab")), | 356 QKeySequence(self.trUtf8("Shift+Ctrl+O", "File|Open in new tab")), |
356 0, self, 'help_file_open_tab') | 357 0, self, 'help_file_open_tab') |
357 self.openTabAct.setStatusTip( | 358 self.openTabAct.setStatusTip( |
358 self.trUtf8('Open a help file for display in a new tab')) | 359 self.trUtf8('Open a help file for display in a new tab')) |
359 self.openTabAct.setWhatsThis(self.trUtf8( | 360 self.openTabAct.setWhatsThis(self.trUtf8( |
360 """<b>Open File in New Tab</b>""" | 361 """<b>Open File in New Tab</b>""" |
363 )) | 364 )) |
364 if not self.initShortcutsOnly: | 365 if not self.initShortcutsOnly: |
365 self.openTabAct.triggered[()].connect(self.__openFileNewTab) | 366 self.openTabAct.triggered[()].connect(self.__openFileNewTab) |
366 self.__actions.append(self.openTabAct) | 367 self.__actions.append(self.openTabAct) |
367 | 368 |
368 self.saveAsAct = E5Action(self.trUtf8('Save As '), | 369 self.saveAsAct = E5Action(self.trUtf8('Save As '), |
369 UI.PixmapCache.getIcon("fileSaveAs.png"), | 370 UI.PixmapCache.getIcon("fileSaveAs.png"), |
370 self.trUtf8('&Save As...'), | 371 self.trUtf8('&Save As...'), |
371 QKeySequence(self.trUtf8("Shift+Ctrl+S","File|Save As")), | 372 QKeySequence(self.trUtf8("Shift+Ctrl+S", "File|Save As")), |
372 0, self, 'help_file_save_as') | 373 0, self, 'help_file_save_as') |
373 self.saveAsAct.setStatusTip( | 374 self.saveAsAct.setStatusTip( |
374 self.trUtf8('Save the current page to disk')) | 375 self.trUtf8('Save the current page to disk')) |
375 self.saveAsAct.setWhatsThis(self.trUtf8( | 376 self.saveAsAct.setWhatsThis(self.trUtf8( |
376 """<b>Save As...</b>""" | 377 """<b>Save As...</b>""" |
379 if not self.initShortcutsOnly: | 380 if not self.initShortcutsOnly: |
380 self.saveAsAct.triggered[()].connect(self.__savePageAs) | 381 self.saveAsAct.triggered[()].connect(self.__savePageAs) |
381 self.__actions.append(self.saveAsAct) | 382 self.__actions.append(self.saveAsAct) |
382 | 383 |
383 bookmarksManager = self.bookmarksManager() | 384 bookmarksManager = self.bookmarksManager() |
384 self.importBookmarksAct = E5Action(self.trUtf8('Import Bookmarks'), | 385 self.importBookmarksAct = E5Action(self.trUtf8('Import Bookmarks'), |
385 self.trUtf8('&Import Bookmarks...'), | 386 self.trUtf8('&Import Bookmarks...'), |
386 0, 0, self, 'help_file_import_bookmarks') | 387 0, 0, self, 'help_file_import_bookmarks') |
387 self.importBookmarksAct.setStatusTip( | 388 self.importBookmarksAct.setStatusTip( |
388 self.trUtf8('Import bookmarks from other browsers')) | 389 self.trUtf8('Import bookmarks from other browsers')) |
389 self.importBookmarksAct.setWhatsThis(self.trUtf8( | 390 self.importBookmarksAct.setWhatsThis(self.trUtf8( |
390 """<b>Import Bookmarks</b>""" | 391 """<b>Import Bookmarks</b>""" |
393 if not self.initShortcutsOnly: | 394 if not self.initShortcutsOnly: |
394 self.importBookmarksAct.triggered[()].connect( | 395 self.importBookmarksAct.triggered[()].connect( |
395 bookmarksManager.importBookmarks) | 396 bookmarksManager.importBookmarks) |
396 self.__actions.append(self.importBookmarksAct) | 397 self.__actions.append(self.importBookmarksAct) |
397 | 398 |
398 self.exportBookmarksAct = E5Action(self.trUtf8('Export Bookmarks'), | 399 self.exportBookmarksAct = E5Action(self.trUtf8('Export Bookmarks'), |
399 self.trUtf8('&Export Bookmarks...'), | 400 self.trUtf8('&Export Bookmarks...'), |
400 0, 0, self, 'help_file_export_bookmarks') | 401 0, 0, self, 'help_file_export_bookmarks') |
401 self.exportBookmarksAct.setStatusTip( | 402 self.exportBookmarksAct.setStatusTip( |
402 self.trUtf8('Export the bookmarks into a file')) | 403 self.trUtf8('Export the bookmarks into a file')) |
403 self.exportBookmarksAct.setWhatsThis(self.trUtf8( | 404 self.exportBookmarksAct.setWhatsThis(self.trUtf8( |
404 """<b>Export Bookmarks</b>""" | 405 """<b>Export Bookmarks</b>""" |
407 if not self.initShortcutsOnly: | 408 if not self.initShortcutsOnly: |
408 self.exportBookmarksAct.triggered[()].connect( | 409 self.exportBookmarksAct.triggered[()].connect( |
409 bookmarksManager.exportBookmarks) | 410 bookmarksManager.exportBookmarks) |
410 self.__actions.append(self.exportBookmarksAct) | 411 self.__actions.append(self.exportBookmarksAct) |
411 | 412 |
412 self.printAct = E5Action(self.trUtf8('Print'), | 413 self.printAct = E5Action(self.trUtf8('Print'), |
413 UI.PixmapCache.getIcon("print.png"), | 414 UI.PixmapCache.getIcon("print.png"), |
414 self.trUtf8('&Print'), | 415 self.trUtf8('&Print'), |
415 QKeySequence(self.trUtf8("Ctrl+P","File|Print")), | 416 QKeySequence(self.trUtf8("Ctrl+P", "File|Print")), |
416 0, self, 'help_file_print') | 417 0, self, 'help_file_print') |
417 self.printAct.setStatusTip(self.trUtf8('Print the displayed help')) | 418 self.printAct.setStatusTip(self.trUtf8('Print the displayed help')) |
418 self.printAct.setWhatsThis(self.trUtf8( | 419 self.printAct.setWhatsThis(self.trUtf8( |
419 """<b>Print</b>""" | 420 """<b>Print</b>""" |
420 """<p>Print the displayed help text.</p>""" | 421 """<p>Print the displayed help text.</p>""" |
421 )) | 422 )) |
422 if not self.initShortcutsOnly: | 423 if not self.initShortcutsOnly: |
423 self.printAct.triggered[()].connect(self.tabWidget.printBrowser) | 424 self.printAct.triggered[()].connect(self.tabWidget.printBrowser) |
424 self.__actions.append(self.printAct) | 425 self.__actions.append(self.printAct) |
425 | 426 |
426 self.printPdfAct = E5Action(self.trUtf8('Print as PDF'), | 427 self.printPdfAct = E5Action(self.trUtf8('Print as PDF'), |
427 UI.PixmapCache.getIcon("printPdf.png"), | 428 UI.PixmapCache.getIcon("printPdf.png"), |
428 self.trUtf8('Print as PDF'), | 429 self.trUtf8('Print as PDF'), |
429 0, 0, self, 'help_file_print_pdf') | 430 0, 0, self, 'help_file_print_pdf') |
430 self.printPdfAct.setStatusTip(self.trUtf8('Print the displayed help as PDF')) | 431 self.printPdfAct.setStatusTip(self.trUtf8('Print the displayed help as PDF')) |
431 self.printPdfAct.setWhatsThis(self.trUtf8( | 432 self.printPdfAct.setWhatsThis(self.trUtf8( |
432 """<b>Print as PDF</b>""" | 433 """<b>Print as PDF</b>""" |
433 """<p>Print the displayed help text as a PDF file.</p>""" | 434 """<p>Print the displayed help text as a PDF file.</p>""" |
434 )) | 435 )) |
435 if not self.initShortcutsOnly: | 436 if not self.initShortcutsOnly: |
436 self.printPdfAct.triggered[()].connect(self.tabWidget.printBrowserPdf) | 437 self.printPdfAct.triggered[()].connect(self.tabWidget.printBrowserPdf) |
437 self.__actions.append(self.printPdfAct) | 438 self.__actions.append(self.printPdfAct) |
438 | 439 |
439 self.printPreviewAct = E5Action(self.trUtf8('Print Preview'), | 440 self.printPreviewAct = E5Action(self.trUtf8('Print Preview'), |
440 UI.PixmapCache.getIcon("printPreview.png"), | 441 UI.PixmapCache.getIcon("printPreview.png"), |
441 self.trUtf8('Print Preview'), | 442 self.trUtf8('Print Preview'), |
442 0, 0, self, 'help_file_print_preview') | 443 0, 0, self, 'help_file_print_preview') |
443 self.printPreviewAct.setStatusTip(self.trUtf8( | 444 self.printPreviewAct.setStatusTip(self.trUtf8( |
444 'Print preview of the displayed help')) | 445 'Print preview of the displayed help')) |
445 self.printPreviewAct.setWhatsThis(self.trUtf8( | 446 self.printPreviewAct.setWhatsThis(self.trUtf8( |
446 """<b>Print Preview</b>""" | 447 """<b>Print Preview</b>""" |
448 )) | 449 )) |
449 if not self.initShortcutsOnly: | 450 if not self.initShortcutsOnly: |
450 self.printPreviewAct.triggered[()].connect(self.tabWidget.printPreviewBrowser) | 451 self.printPreviewAct.triggered[()].connect(self.tabWidget.printPreviewBrowser) |
451 self.__actions.append(self.printPreviewAct) | 452 self.__actions.append(self.printPreviewAct) |
452 | 453 |
453 self.closeAct = E5Action(self.trUtf8('Close'), | 454 self.closeAct = E5Action(self.trUtf8('Close'), |
454 UI.PixmapCache.getIcon("close.png"), | 455 UI.PixmapCache.getIcon("close.png"), |
455 self.trUtf8('&Close'), | 456 self.trUtf8('&Close'), |
456 QKeySequence(self.trUtf8("Ctrl+W","File|Close")), | 457 QKeySequence(self.trUtf8("Ctrl+W", "File|Close")), |
457 0, self, 'help_file_close') | 458 0, self, 'help_file_close') |
458 self.closeAct.setStatusTip(self.trUtf8('Close the current help window')) | 459 self.closeAct.setStatusTip(self.trUtf8('Close the current help window')) |
459 self.closeAct.setWhatsThis(self.trUtf8( | 460 self.closeAct.setWhatsThis(self.trUtf8( |
460 """<b>Close</b>""" | 461 """<b>Close</b>""" |
461 """<p>Closes the current help window.</p>""" | 462 """<p>Closes the current help window.</p>""" |
462 )) | 463 )) |
463 if not self.initShortcutsOnly: | 464 if not self.initShortcutsOnly: |
464 self.closeAct.triggered[()].connect(self.tabWidget.closeBrowser) | 465 self.closeAct.triggered[()].connect(self.tabWidget.closeBrowser) |
465 self.__actions.append(self.closeAct) | 466 self.__actions.append(self.closeAct) |
466 | 467 |
467 self.closeAllAct = E5Action(self.trUtf8('Close All'), | 468 self.closeAllAct = E5Action(self.trUtf8('Close All'), |
468 self.trUtf8('Close &All'), | 469 self.trUtf8('Close &All'), |
469 0, 0, self, 'help_file_close_all') | 470 0, 0, self, 'help_file_close_all') |
470 self.closeAllAct.setStatusTip(self.trUtf8('Close all help windows')) | 471 self.closeAllAct.setStatusTip(self.trUtf8('Close all help windows')) |
471 self.closeAllAct.setWhatsThis(self.trUtf8( | 472 self.closeAllAct.setWhatsThis(self.trUtf8( |
472 """<b>Close All</b>""" | 473 """<b>Close All</b>""" |
473 """<p>Closes all help windows except the first one.</p>""" | 474 """<p>Closes all help windows except the first one.</p>""" |
474 )) | 475 )) |
475 if not self.initShortcutsOnly: | 476 if not self.initShortcutsOnly: |
476 self.closeAllAct.triggered[()].connect(self.tabWidget.closeAllBrowsers) | 477 self.closeAllAct.triggered[()].connect(self.tabWidget.closeAllBrowsers) |
477 self.__actions.append(self.closeAllAct) | 478 self.__actions.append(self.closeAllAct) |
478 | 479 |
479 self.privateBrowsingAct = E5Action(self.trUtf8('Private Browsing'), | 480 self.privateBrowsingAct = E5Action(self.trUtf8('Private Browsing'), |
480 UI.PixmapCache.getIcon("privateBrowsing.png"), | 481 UI.PixmapCache.getIcon("privateBrowsing.png"), |
481 self.trUtf8('Private &Browsing'), | 482 self.trUtf8('Private &Browsing'), |
482 0, 0, self, 'help_file_private_browsing') | 483 0, 0, self, 'help_file_private_browsing') |
483 self.privateBrowsingAct.setStatusTip(self.trUtf8('Private Browsing')) | 484 self.privateBrowsingAct.setStatusTip(self.trUtf8('Private Browsing')) |
484 self.privateBrowsingAct.setWhatsThis(self.trUtf8( | 485 self.privateBrowsingAct.setWhatsThis(self.trUtf8( |
485 """<b>Private Browsing</b>""" | 486 """<b>Private Browsing</b>""" |
486 """<p>Enables private browsing. In this mode no history is""" | 487 """<p>Enables private browsing. In this mode no history is""" |
489 if not self.initShortcutsOnly: | 490 if not self.initShortcutsOnly: |
490 self.privateBrowsingAct.triggered[()].connect(self.__privateBrowsing) | 491 self.privateBrowsingAct.triggered[()].connect(self.__privateBrowsing) |
491 self.privateBrowsingAct.setCheckable(True) | 492 self.privateBrowsingAct.setCheckable(True) |
492 self.__actions.append(self.privateBrowsingAct) | 493 self.__actions.append(self.privateBrowsingAct) |
493 | 494 |
494 self.exitAct = E5Action(self.trUtf8('Quit'), | 495 self.exitAct = E5Action(self.trUtf8('Quit'), |
495 UI.PixmapCache.getIcon("exit.png"), | 496 UI.PixmapCache.getIcon("exit.png"), |
496 self.trUtf8('&Quit'), | 497 self.trUtf8('&Quit'), |
497 QKeySequence(self.trUtf8("Ctrl+Q","File|Quit")), | 498 QKeySequence(self.trUtf8("Ctrl+Q", "File|Quit")), |
498 0, self, 'help_file_quit') | 499 0, self, 'help_file_quit') |
499 self.exitAct.setStatusTip(self.trUtf8('Quit the web browser')) | 500 self.exitAct.setStatusTip(self.trUtf8('Quit the web browser')) |
500 self.exitAct.setWhatsThis(self.trUtf8( | 501 self.exitAct.setWhatsThis(self.trUtf8( |
501 """<b>Quit</b>""" | 502 """<b>Quit</b>""" |
502 """<p>Quit the web browser.</p>""" | 503 """<p>Quit the web browser.</p>""" |
506 self.exitAct.triggered[()].connect(self.close) | 507 self.exitAct.triggered[()].connect(self.close) |
507 else: | 508 else: |
508 self.exitAct.triggered[()].connect(qApp.closeAllWindows) | 509 self.exitAct.triggered[()].connect(qApp.closeAllWindows) |
509 self.__actions.append(self.exitAct) | 510 self.__actions.append(self.exitAct) |
510 | 511 |
511 self.backAct = E5Action(self.trUtf8('Backward'), | 512 self.backAct = E5Action(self.trUtf8('Backward'), |
512 UI.PixmapCache.getIcon("back.png"), | 513 UI.PixmapCache.getIcon("back.png"), |
513 self.trUtf8('&Backward'), | 514 self.trUtf8('&Backward'), |
514 QKeySequence(self.trUtf8("Alt+Left","Go|Backward")), | 515 QKeySequence(self.trUtf8("Alt+Left", "Go|Backward")), |
515 QKeySequence(self.trUtf8("Backspace","Go|Backward")), | 516 QKeySequence(self.trUtf8("Backspace", "Go|Backward")), |
516 self, 'help_go_backward') | 517 self, 'help_go_backward') |
517 self.backAct.setStatusTip(self.trUtf8('Move one help screen backward')) | 518 self.backAct.setStatusTip(self.trUtf8('Move one help screen backward')) |
518 self.backAct.setWhatsThis(self.trUtf8( | 519 self.backAct.setWhatsThis(self.trUtf8( |
519 """<b>Backward</b>""" | 520 """<b>Backward</b>""" |
520 """<p>Moves one help screen backward. If none is""" | 521 """<p>Moves one help screen backward. If none is""" |
522 )) | 523 )) |
523 if not self.initShortcutsOnly: | 524 if not self.initShortcutsOnly: |
524 self.backAct.triggered[()].connect(self.__backward) | 525 self.backAct.triggered[()].connect(self.__backward) |
525 self.__actions.append(self.backAct) | 526 self.__actions.append(self.backAct) |
526 | 527 |
527 self.forwardAct = E5Action(self.trUtf8('Forward'), | 528 self.forwardAct = E5Action(self.trUtf8('Forward'), |
528 UI.PixmapCache.getIcon("forward.png"), | 529 UI.PixmapCache.getIcon("forward.png"), |
529 self.trUtf8('&Forward'), | 530 self.trUtf8('&Forward'), |
530 QKeySequence(self.trUtf8("Alt+Right","Go|Forward")), | 531 QKeySequence(self.trUtf8("Alt+Right", "Go|Forward")), |
531 QKeySequence(self.trUtf8("Shift+Backspace","Go|Forward")), | 532 QKeySequence(self.trUtf8("Shift+Backspace", "Go|Forward")), |
532 self, 'help_go_foreward') | 533 self, 'help_go_foreward') |
533 self.forwardAct.setStatusTip(self.trUtf8('Move one help screen forward')) | 534 self.forwardAct.setStatusTip(self.trUtf8('Move one help screen forward')) |
534 self.forwardAct.setWhatsThis(self.trUtf8( | 535 self.forwardAct.setWhatsThis(self.trUtf8( |
535 """<b>Forward</b>""" | 536 """<b>Forward</b>""" |
536 """<p>Moves one help screen forward. If none is""" | 537 """<p>Moves one help screen forward. If none is""" |
538 )) | 539 )) |
539 if not self.initShortcutsOnly: | 540 if not self.initShortcutsOnly: |
540 self.forwardAct.triggered[()].connect(self.__forward) | 541 self.forwardAct.triggered[()].connect(self.__forward) |
541 self.__actions.append(self.forwardAct) | 542 self.__actions.append(self.forwardAct) |
542 | 543 |
543 self.homeAct = E5Action(self.trUtf8('Home'), | 544 self.homeAct = E5Action(self.trUtf8('Home'), |
544 UI.PixmapCache.getIcon("home.png"), | 545 UI.PixmapCache.getIcon("home.png"), |
545 self.trUtf8('&Home'), | 546 self.trUtf8('&Home'), |
546 QKeySequence(self.trUtf8("Ctrl+Home","Go|Home")), | 547 QKeySequence(self.trUtf8("Ctrl+Home", "Go|Home")), |
547 0, self, 'help_go_home') | 548 0, self, 'help_go_home') |
548 self.homeAct.setStatusTip(self.trUtf8('Move to the initial help screen')) | 549 self.homeAct.setStatusTip(self.trUtf8('Move to the initial help screen')) |
549 self.homeAct.setWhatsThis(self.trUtf8( | 550 self.homeAct.setWhatsThis(self.trUtf8( |
550 """<b>Home</b>""" | 551 """<b>Home</b>""" |
551 """<p>Moves to the initial help screen.</p>""" | 552 """<p>Moves to the initial help screen.</p>""" |
552 )) | 553 )) |
553 if not self.initShortcutsOnly: | 554 if not self.initShortcutsOnly: |
554 self.homeAct.triggered[()].connect(self.__home) | 555 self.homeAct.triggered[()].connect(self.__home) |
555 self.__actions.append(self.homeAct) | 556 self.__actions.append(self.homeAct) |
556 | 557 |
557 self.reloadAct = E5Action(self.trUtf8('Reload'), | 558 self.reloadAct = E5Action(self.trUtf8('Reload'), |
558 UI.PixmapCache.getIcon("reload.png"), | 559 UI.PixmapCache.getIcon("reload.png"), |
559 self.trUtf8('&Reload'), | 560 self.trUtf8('&Reload'), |
560 QKeySequence(self.trUtf8("Ctrl+R","Go|Reload")), | 561 QKeySequence(self.trUtf8("Ctrl+R", "Go|Reload")), |
561 QKeySequence(self.trUtf8("F5","Go|Reload")), | 562 QKeySequence(self.trUtf8("F5", "Go|Reload")), |
562 self, 'help_go_reload') | 563 self, 'help_go_reload') |
563 self.reloadAct.setStatusTip(self.trUtf8('Reload the current help screen')) | 564 self.reloadAct.setStatusTip(self.trUtf8('Reload the current help screen')) |
564 self.reloadAct.setWhatsThis(self.trUtf8( | 565 self.reloadAct.setWhatsThis(self.trUtf8( |
565 """<b>Reload</b>""" | 566 """<b>Reload</b>""" |
566 """<p>Reloads the current help screen.</p>""" | 567 """<p>Reloads the current help screen.</p>""" |
567 )) | 568 )) |
568 if not self.initShortcutsOnly: | 569 if not self.initShortcutsOnly: |
569 self.reloadAct.triggered[()].connect(self.__reload) | 570 self.reloadAct.triggered[()].connect(self.__reload) |
570 self.__actions.append(self.reloadAct) | 571 self.__actions.append(self.reloadAct) |
571 | 572 |
572 self.stopAct = E5Action(self.trUtf8('Stop'), | 573 self.stopAct = E5Action(self.trUtf8('Stop'), |
573 UI.PixmapCache.getIcon("stopLoading.png"), | 574 UI.PixmapCache.getIcon("stopLoading.png"), |
574 self.trUtf8('&Stop'), | 575 self.trUtf8('&Stop'), |
575 QKeySequence(self.trUtf8("Ctrl+.","Go|Stop")), | 576 QKeySequence(self.trUtf8("Ctrl+.", "Go|Stop")), |
576 QKeySequence(self.trUtf8("Esc","Go|Stop")), | 577 QKeySequence(self.trUtf8("Esc", "Go|Stop")), |
577 self, 'help_go_stop') | 578 self, 'help_go_stop') |
578 self.stopAct.setStatusTip(self.trUtf8('Stop loading')) | 579 self.stopAct.setStatusTip(self.trUtf8('Stop loading')) |
579 self.stopAct.setWhatsThis(self.trUtf8( | 580 self.stopAct.setWhatsThis(self.trUtf8( |
580 """<b>Stop</b>""" | 581 """<b>Stop</b>""" |
581 """<p>Stops loading of the current tab.</p>""" | 582 """<p>Stops loading of the current tab.</p>""" |
582 )) | 583 )) |
583 if not self.initShortcutsOnly: | 584 if not self.initShortcutsOnly: |
584 self.stopAct.triggered[()].connect(self.__stopLoading) | 585 self.stopAct.triggered[()].connect(self.__stopLoading) |
585 self.__actions.append(self.stopAct) | 586 self.__actions.append(self.stopAct) |
586 | 587 |
587 self.copyAct = E5Action(self.trUtf8('Copy'), | 588 self.copyAct = E5Action(self.trUtf8('Copy'), |
588 UI.PixmapCache.getIcon("editCopy.png"), | 589 UI.PixmapCache.getIcon("editCopy.png"), |
589 self.trUtf8('&Copy'), | 590 self.trUtf8('&Copy'), |
590 QKeySequence(self.trUtf8("Ctrl+C","Edit|Copy")), | 591 QKeySequence(self.trUtf8("Ctrl+C", "Edit|Copy")), |
591 0, self, 'help_edit_copy') | 592 0, self, 'help_edit_copy') |
592 self.copyAct.setStatusTip(self.trUtf8('Copy the selected text')) | 593 self.copyAct.setStatusTip(self.trUtf8('Copy the selected text')) |
593 self.copyAct.setWhatsThis(self.trUtf8( | 594 self.copyAct.setWhatsThis(self.trUtf8( |
594 """<b>Copy</b>""" | 595 """<b>Copy</b>""" |
595 """<p>Copy the selected text to the clipboard.</p>""" | 596 """<p>Copy the selected text to the clipboard.</p>""" |
596 )) | 597 )) |
597 if not self.initShortcutsOnly: | 598 if not self.initShortcutsOnly: |
598 self.copyAct.triggered[()].connect(self.__copy) | 599 self.copyAct.triggered[()].connect(self.__copy) |
599 self.__actions.append(self.copyAct) | 600 self.__actions.append(self.copyAct) |
600 | 601 |
601 self.findAct = E5Action(self.trUtf8('Find...'), | 602 self.findAct = E5Action(self.trUtf8('Find...'), |
602 UI.PixmapCache.getIcon("find.png"), | 603 UI.PixmapCache.getIcon("find.png"), |
603 self.trUtf8('&Find...'), | 604 self.trUtf8('&Find...'), |
604 QKeySequence(self.trUtf8("Ctrl+F","Edit|Find")), | 605 QKeySequence(self.trUtf8("Ctrl+F", "Edit|Find")), |
605 0, self, 'help_edit_find') | 606 0, self, 'help_edit_find') |
606 self.findAct.setStatusTip(self.trUtf8('Find text in page')) | 607 self.findAct.setStatusTip(self.trUtf8('Find text in page')) |
607 self.findAct.setWhatsThis(self.trUtf8( | 608 self.findAct.setWhatsThis(self.trUtf8( |
608 """<b>Find</b>""" | 609 """<b>Find</b>""" |
609 """<p>Find text in the current page.</p>""" | 610 """<p>Find text in the current page.</p>""" |
610 )) | 611 )) |
611 if not self.initShortcutsOnly: | 612 if not self.initShortcutsOnly: |
612 self.findAct.triggered[()].connect(self.__find) | 613 self.findAct.triggered[()].connect(self.__find) |
613 self.__actions.append(self.findAct) | 614 self.__actions.append(self.findAct) |
614 | 615 |
615 self.findNextAct = E5Action(self.trUtf8('Find next'), | 616 self.findNextAct = E5Action(self.trUtf8('Find next'), |
616 UI.PixmapCache.getIcon("findNext.png"), | 617 UI.PixmapCache.getIcon("findNext.png"), |
617 self.trUtf8('Find &next'), | 618 self.trUtf8('Find &next'), |
618 QKeySequence(self.trUtf8("F3","Edit|Find next")), | 619 QKeySequence(self.trUtf8("F3", "Edit|Find next")), |
619 0, self, 'help_edit_find_next') | 620 0, self, 'help_edit_find_next') |
620 self.findNextAct.setStatusTip(self.trUtf8('Find next occurrence of text in page')) | 621 self.findNextAct.setStatusTip(self.trUtf8('Find next occurrence of text in page')) |
621 self.findNextAct.setWhatsThis(self.trUtf8( | 622 self.findNextAct.setWhatsThis(self.trUtf8( |
622 """<b>Find next</b>""" | 623 """<b>Find next</b>""" |
623 """<p>Find the next occurrence of text in the current page.</p>""" | 624 """<p>Find the next occurrence of text in the current page.</p>""" |
624 )) | 625 )) |
625 if not self.initShortcutsOnly: | 626 if not self.initShortcutsOnly: |
626 self.findNextAct.triggered[()].connect(self.findDlg.findNext) | 627 self.findNextAct.triggered[()].connect(self.findDlg.findNext) |
627 self.__actions.append(self.findNextAct) | 628 self.__actions.append(self.findNextAct) |
628 | 629 |
629 self.findPrevAct = E5Action(self.trUtf8('Find previous'), | 630 self.findPrevAct = E5Action(self.trUtf8('Find previous'), |
630 UI.PixmapCache.getIcon("findPrev.png"), | 631 UI.PixmapCache.getIcon("findPrev.png"), |
631 self.trUtf8('Find &previous'), | 632 self.trUtf8('Find &previous'), |
632 QKeySequence(self.trUtf8("Shift+F3","Edit|Find previous")), | 633 QKeySequence(self.trUtf8("Shift+F3", "Edit|Find previous")), |
633 0, self, 'help_edit_find_previous') | 634 0, self, 'help_edit_find_previous') |
634 self.findPrevAct.setStatusTip( | 635 self.findPrevAct.setStatusTip( |
635 self.trUtf8('Find previous occurrence of text in page')) | 636 self.trUtf8('Find previous occurrence of text in page')) |
636 self.findPrevAct.setWhatsThis(self.trUtf8( | 637 self.findPrevAct.setWhatsThis(self.trUtf8( |
637 """<b>Find previous</b>""" | 638 """<b>Find previous</b>""" |
639 )) | 640 )) |
640 if not self.initShortcutsOnly: | 641 if not self.initShortcutsOnly: |
641 self.findPrevAct.triggered[()].connect(self.findDlg.findPrevious) | 642 self.findPrevAct.triggered[()].connect(self.findDlg.findPrevious) |
642 self.__actions.append(self.findPrevAct) | 643 self.__actions.append(self.findPrevAct) |
643 | 644 |
644 self.bookmarksManageAct = E5Action(self.trUtf8('Manage Bookmarks'), | 645 self.bookmarksManageAct = E5Action(self.trUtf8('Manage Bookmarks'), |
645 self.trUtf8('&Manage Bookmarks...'), | 646 self.trUtf8('&Manage Bookmarks...'), |
646 QKeySequence(self.trUtf8("Ctrl+Shift+B", "Help|Manage bookmarks")), | 647 QKeySequence(self.trUtf8("Ctrl+Shift+B", "Help|Manage bookmarks")), |
647 0, self, 'help_bookmarks_manage') | 648 0, self, 'help_bookmarks_manage') |
648 self.bookmarksManageAct.setStatusTip(self.trUtf8( | 649 self.bookmarksManageAct.setStatusTip(self.trUtf8( |
649 'Open a dialog to manage the bookmarks.')) | 650 'Open a dialog to manage the bookmarks.')) |
650 self.bookmarksManageAct.setWhatsThis(self.trUtf8( | 651 self.bookmarksManageAct.setWhatsThis(self.trUtf8( |
651 """<b>Manage Bookmarks...</b>""" | 652 """<b>Manage Bookmarks...</b>""" |
653 )) | 654 )) |
654 if not self.initShortcutsOnly: | 655 if not self.initShortcutsOnly: |
655 self.bookmarksManageAct.triggered[()].connect(self.__showBookmarksDialog) | 656 self.bookmarksManageAct.triggered[()].connect(self.__showBookmarksDialog) |
656 self.__actions.append(self.bookmarksManageAct) | 657 self.__actions.append(self.bookmarksManageAct) |
657 | 658 |
658 self.bookmarksAddAct = E5Action(self.trUtf8('Add Bookmark'), | 659 self.bookmarksAddAct = E5Action(self.trUtf8('Add Bookmark'), |
659 UI.PixmapCache.getIcon("addBookmark.png"), | 660 UI.PixmapCache.getIcon("addBookmark.png"), |
660 self.trUtf8('Add &Bookmark...'), | 661 self.trUtf8('Add &Bookmark...'), |
661 QKeySequence(self.trUtf8("Ctrl+D", "Help|Add bookmark")), | 662 QKeySequence(self.trUtf8("Ctrl+D", "Help|Add bookmark")), |
662 0, self, 'help_bookmark_add') | 663 0, self, 'help_bookmark_add') |
663 self.bookmarksAddAct.setIconVisibleInMenu(False) | 664 self.bookmarksAddAct.setIconVisibleInMenu(False) |
664 self.bookmarksAddAct.setStatusTip(self.trUtf8('Open a dialog to add a bookmark.')) | 665 self.bookmarksAddAct.setStatusTip(self.trUtf8('Open a dialog to add a bookmark.')) |
665 self.bookmarksAddAct.setWhatsThis(self.trUtf8( | 666 self.bookmarksAddAct.setWhatsThis(self.trUtf8( |
666 """<b>Add Bookmark</b>""" | 667 """<b>Add Bookmark</b>""" |
668 )) | 669 )) |
669 if not self.initShortcutsOnly: | 670 if not self.initShortcutsOnly: |
670 self.bookmarksAddAct.triggered[()].connect(self.__addBookmark) | 671 self.bookmarksAddAct.triggered[()].connect(self.__addBookmark) |
671 self.__actions.append(self.bookmarksAddAct) | 672 self.__actions.append(self.bookmarksAddAct) |
672 | 673 |
673 self.bookmarksAddFolderAct = E5Action(self.trUtf8('Add Folder'), | 674 self.bookmarksAddFolderAct = E5Action(self.trUtf8('Add Folder'), |
674 self.trUtf8('Add &Folder...'), | 675 self.trUtf8('Add &Folder...'), |
675 0, 0, self, 'help_bookmark_show_all') | 676 0, 0, self, 'help_bookmark_show_all') |
676 self.bookmarksAddFolderAct.setStatusTip(self.trUtf8( | 677 self.bookmarksAddFolderAct.setStatusTip(self.trUtf8( |
677 'Open a dialog to add a new bookmarks folder.')) | 678 'Open a dialog to add a new bookmarks folder.')) |
678 self.bookmarksAddFolderAct.setWhatsThis(self.trUtf8( | 679 self.bookmarksAddFolderAct.setWhatsThis(self.trUtf8( |
679 """<b>Add Folder...</b>""" | 680 """<b>Add Folder...</b>""" |
681 )) | 682 )) |
682 if not self.initShortcutsOnly: | 683 if not self.initShortcutsOnly: |
683 self.bookmarksAddFolderAct.triggered[()].connect(self.__addBookmarkFolder) | 684 self.bookmarksAddFolderAct.triggered[()].connect(self.__addBookmarkFolder) |
684 self.__actions.append(self.bookmarksAddFolderAct) | 685 self.__actions.append(self.bookmarksAddFolderAct) |
685 | 686 |
686 self.bookmarksAllTabsAct = E5Action(self.trUtf8('Bookmark All Tabs'), | 687 self.bookmarksAllTabsAct = E5Action(self.trUtf8('Bookmark All Tabs'), |
687 self.trUtf8('Bookmark All Tabs...'), | 688 self.trUtf8('Bookmark All Tabs...'), |
688 0, 0, self, 'help_bookmark_all_tabs') | 689 0, 0, self, 'help_bookmark_all_tabs') |
689 self.bookmarksAllTabsAct.setStatusTip(self.trUtf8( | 690 self.bookmarksAllTabsAct.setStatusTip(self.trUtf8( |
690 'Bookmark all open tabs.')) | 691 'Bookmark all open tabs.')) |
691 self.bookmarksAllTabsAct.setWhatsThis(self.trUtf8( | 692 self.bookmarksAllTabsAct.setWhatsThis(self.trUtf8( |
692 """<b>Bookmark All Tabs...</b>""" | 693 """<b>Bookmark All Tabs...</b>""" |
695 )) | 696 )) |
696 if not self.initShortcutsOnly: | 697 if not self.initShortcutsOnly: |
697 self.bookmarksAllTabsAct.triggered[()].connect(self.bookmarkAll) | 698 self.bookmarksAllTabsAct.triggered[()].connect(self.bookmarkAll) |
698 self.__actions.append(self.bookmarksAllTabsAct) | 699 self.__actions.append(self.bookmarksAllTabsAct) |
699 | 700 |
700 self.whatsThisAct = E5Action(self.trUtf8('What\'s This?'), | 701 self.whatsThisAct = E5Action(self.trUtf8('What\'s This?'), |
701 UI.PixmapCache.getIcon("whatsThis.png"), | 702 UI.PixmapCache.getIcon("whatsThis.png"), |
702 self.trUtf8('&What\'s This?'), | 703 self.trUtf8('&What\'s This?'), |
703 QKeySequence(self.trUtf8("Shift+F1","Help|What's This?'")), | 704 QKeySequence(self.trUtf8("Shift+F1", "Help|What's This?'")), |
704 0, self, 'help_help_whats_this') | 705 0, self, 'help_help_whats_this') |
705 self.whatsThisAct.setStatusTip(self.trUtf8('Context sensitive help')) | 706 self.whatsThisAct.setStatusTip(self.trUtf8('Context sensitive help')) |
706 self.whatsThisAct.setWhatsThis(self.trUtf8( | 707 self.whatsThisAct.setWhatsThis(self.trUtf8( |
707 """<b>Display context sensitive help</b>""" | 708 """<b>Display context sensitive help</b>""" |
708 """<p>In What's This? mode, the mouse cursor shows an arrow with a""" | 709 """<p>In What's This? mode, the mouse cursor shows an arrow with a""" |
713 )) | 714 )) |
714 if not self.initShortcutsOnly: | 715 if not self.initShortcutsOnly: |
715 self.whatsThisAct.triggered[()].connect(self.__whatsThis) | 716 self.whatsThisAct.triggered[()].connect(self.__whatsThis) |
716 self.__actions.append(self.whatsThisAct) | 717 self.__actions.append(self.whatsThisAct) |
717 | 718 |
718 self.aboutAct = E5Action(self.trUtf8('About'), | 719 self.aboutAct = E5Action(self.trUtf8('About'), |
719 self.trUtf8('&About'), | 720 self.trUtf8('&About'), |
720 0, 0, self, 'help_help_about') | 721 0, 0, self, 'help_help_about') |
721 self.aboutAct.setStatusTip(self.trUtf8('Display information about this software')) | 722 self.aboutAct.setStatusTip(self.trUtf8('Display information about this software')) |
722 self.aboutAct.setWhatsThis(self.trUtf8( | 723 self.aboutAct.setWhatsThis(self.trUtf8( |
723 """<b>About</b>""" | 724 """<b>About</b>""" |
724 """<p>Display some information about this software.</p>""" | 725 """<p>Display some information about this software.</p>""" |
725 )) | 726 )) |
726 if not self.initShortcutsOnly: | 727 if not self.initShortcutsOnly: |
727 self.aboutAct.triggered[()].connect(self.__about) | 728 self.aboutAct.triggered[()].connect(self.__about) |
728 self.__actions.append(self.aboutAct) | 729 self.__actions.append(self.aboutAct) |
729 | 730 |
730 self.aboutQtAct = E5Action(self.trUtf8('About Qt'), | 731 self.aboutQtAct = E5Action(self.trUtf8('About Qt'), |
731 self.trUtf8('About &Qt'), | 732 self.trUtf8('About &Qt'), |
732 0, 0, self, 'help_help_about_qt') | 733 0, 0, self, 'help_help_about_qt') |
733 self.aboutQtAct.setStatusTip( | 734 self.aboutQtAct.setStatusTip( |
734 self.trUtf8('Display information about the Qt toolkit')) | 735 self.trUtf8('Display information about the Qt toolkit')) |
735 self.aboutQtAct.setWhatsThis(self.trUtf8( | 736 self.aboutQtAct.setWhatsThis(self.trUtf8( |
736 """<b>About Qt</b>""" | 737 """<b>About Qt</b>""" |
738 )) | 739 )) |
739 if not self.initShortcutsOnly: | 740 if not self.initShortcutsOnly: |
740 self.aboutQtAct.triggered[()].connect(self.__aboutQt) | 741 self.aboutQtAct.triggered[()].connect(self.__aboutQt) |
741 self.__actions.append(self.aboutQtAct) | 742 self.__actions.append(self.aboutQtAct) |
742 | 743 |
743 self.zoomInAct = E5Action(self.trUtf8('Zoom in'), | 744 self.zoomInAct = E5Action(self.trUtf8('Zoom in'), |
744 UI.PixmapCache.getIcon("zoomIn.png"), | 745 UI.PixmapCache.getIcon("zoomIn.png"), |
745 self.trUtf8('Zoom &in'), | 746 self.trUtf8('Zoom &in'), |
746 QKeySequence(self.trUtf8("Ctrl++","View|Zoom in")), | 747 QKeySequence(self.trUtf8("Ctrl++", "View|Zoom in")), |
747 0, self, 'help_view_zoom_in') | 748 0, self, 'help_view_zoom_in') |
748 self.zoomInAct.setStatusTip(self.trUtf8('Zoom in on the text')) | 749 self.zoomInAct.setStatusTip(self.trUtf8('Zoom in on the text')) |
749 self.zoomInAct.setWhatsThis(self.trUtf8( | 750 self.zoomInAct.setWhatsThis(self.trUtf8( |
750 """<b>Zoom in</b>""" | 751 """<b>Zoom in</b>""" |
751 """<p>Zoom in on the text. This makes the text bigger.</p>""" | 752 """<p>Zoom in on the text. This makes the text bigger.</p>""" |
752 )) | 753 )) |
753 if not self.initShortcutsOnly: | 754 if not self.initShortcutsOnly: |
754 self.zoomInAct.triggered[()].connect(self.__zoomIn) | 755 self.zoomInAct.triggered[()].connect(self.__zoomIn) |
755 self.__actions.append(self.zoomInAct) | 756 self.__actions.append(self.zoomInAct) |
756 | 757 |
757 self.zoomOutAct = E5Action(self.trUtf8('Zoom out'), | 758 self.zoomOutAct = E5Action(self.trUtf8('Zoom out'), |
758 UI.PixmapCache.getIcon("zoomOut.png"), | 759 UI.PixmapCache.getIcon("zoomOut.png"), |
759 self.trUtf8('Zoom &out'), | 760 self.trUtf8('Zoom &out'), |
760 QKeySequence(self.trUtf8("Ctrl+-","View|Zoom out")), | 761 QKeySequence(self.trUtf8("Ctrl+-", "View|Zoom out")), |
761 0, self, 'help_view_zoom_out') | 762 0, self, 'help_view_zoom_out') |
762 self.zoomOutAct.setStatusTip(self.trUtf8('Zoom out on the text')) | 763 self.zoomOutAct.setStatusTip(self.trUtf8('Zoom out on the text')) |
763 self.zoomOutAct.setWhatsThis(self.trUtf8( | 764 self.zoomOutAct.setWhatsThis(self.trUtf8( |
764 """<b>Zoom out</b>""" | 765 """<b>Zoom out</b>""" |
765 """<p>Zoom out on the text. This makes the text smaller.</p>""" | 766 """<p>Zoom out on the text. This makes the text smaller.</p>""" |
766 )) | 767 )) |
767 if not self.initShortcutsOnly: | 768 if not self.initShortcutsOnly: |
768 self.zoomOutAct.triggered[()].connect(self.__zoomOut) | 769 self.zoomOutAct.triggered[()].connect(self.__zoomOut) |
769 self.__actions.append(self.zoomOutAct) | 770 self.__actions.append(self.zoomOutAct) |
770 | 771 |
771 self.zoomResetAct = E5Action(self.trUtf8('Zoom reset'), | 772 self.zoomResetAct = E5Action(self.trUtf8('Zoom reset'), |
772 UI.PixmapCache.getIcon("zoomReset.png"), | 773 UI.PixmapCache.getIcon("zoomReset.png"), |
773 self.trUtf8('Zoom &reset'), | 774 self.trUtf8('Zoom &reset'), |
774 QKeySequence(self.trUtf8("Ctrl+0","View|Zoom reset")), | 775 QKeySequence(self.trUtf8("Ctrl+0", "View|Zoom reset")), |
775 0, self, 'help_view_zoom_reset') | 776 0, self, 'help_view_zoom_reset') |
776 self.zoomResetAct.setStatusTip(self.trUtf8('Reset the zoom of the text')) | 777 self.zoomResetAct.setStatusTip(self.trUtf8('Reset the zoom of the text')) |
777 self.zoomResetAct.setWhatsThis(self.trUtf8( | 778 self.zoomResetAct.setWhatsThis(self.trUtf8( |
778 """<b>Zoom reset</b>""" | 779 """<b>Zoom reset</b>""" |
779 """<p>Reset the zoom of the text. """ | 780 """<p>Reset the zoom of the text. """ |
782 if not self.initShortcutsOnly: | 783 if not self.initShortcutsOnly: |
783 self.zoomResetAct.triggered[()].connect(self.__zoomReset) | 784 self.zoomResetAct.triggered[()].connect(self.__zoomReset) |
784 self.__actions.append(self.zoomResetAct) | 785 self.__actions.append(self.zoomResetAct) |
785 | 786 |
786 if hasattr(QWebSettings, 'ZoomTextOnly'): | 787 if hasattr(QWebSettings, 'ZoomTextOnly'): |
787 self.zoomTextOnlyAct = E5Action(self.trUtf8('Zoom text only'), | 788 self.zoomTextOnlyAct = E5Action(self.trUtf8('Zoom text only'), |
788 self.trUtf8('Zoom &text only'), | 789 self.trUtf8('Zoom &text only'), |
789 0, 0, self, 'help_view_zoom_text_only') | 790 0, 0, self, 'help_view_zoom_text_only') |
790 self.zoomTextOnlyAct.setCheckable(True) | 791 self.zoomTextOnlyAct.setCheckable(True) |
791 self.zoomTextOnlyAct.setStatusTip(self.trUtf8( | 792 self.zoomTextOnlyAct.setStatusTip(self.trUtf8( |
792 'Zoom text only; pictures remain constant')) | 793 'Zoom text only; pictures remain constant')) |
793 self.zoomTextOnlyAct.setWhatsThis(self.trUtf8( | 794 self.zoomTextOnlyAct.setWhatsThis(self.trUtf8( |
798 self.zoomTextOnlyAct.triggered[bool].connect(self.__zoomTextOnly) | 799 self.zoomTextOnlyAct.triggered[bool].connect(self.__zoomTextOnly) |
799 self.__actions.append(self.zoomTextOnlyAct) | 800 self.__actions.append(self.zoomTextOnlyAct) |
800 else: | 801 else: |
801 self.zoomTextOnlyAct = None | 802 self.zoomTextOnlyAct = None |
802 | 803 |
803 self.pageSourceAct = E5Action(self.trUtf8('Show page source'), | 804 self.pageSourceAct = E5Action(self.trUtf8('Show page source'), |
804 self.trUtf8('Show page source'), | 805 self.trUtf8('Show page source'), |
805 QKeySequence(self.trUtf8('Ctrl+U')), 0, | 806 QKeySequence(self.trUtf8('Ctrl+U')), 0, |
806 self, 'help_show_page_source') | 807 self, 'help_show_page_source') |
807 self.pageSourceAct.setStatusTip(self.trUtf8('Show the page source in an editor')) | 808 self.pageSourceAct.setStatusTip(self.trUtf8('Show the page source in an editor')) |
808 self.pageSourceAct.setWhatsThis(self.trUtf8( | 809 self.pageSourceAct.setWhatsThis(self.trUtf8( |
809 """<b>Show page source</b>""" | 810 """<b>Show page source</b>""" |
812 if not self.initShortcutsOnly: | 813 if not self.initShortcutsOnly: |
813 self.pageSourceAct.triggered[()].connect(self.__showPageSource) | 814 self.pageSourceAct.triggered[()].connect(self.__showPageSource) |
814 self.__actions.append(self.pageSourceAct) | 815 self.__actions.append(self.pageSourceAct) |
815 self.addAction(self.pageSourceAct) | 816 self.addAction(self.pageSourceAct) |
816 | 817 |
817 self.fullScreenAct = E5Action(self.trUtf8('Full Screen'), | 818 self.fullScreenAct = E5Action(self.trUtf8('Full Screen'), |
818 UI.PixmapCache.getIcon("windowFullscreen.png"), | 819 UI.PixmapCache.getIcon("windowFullscreen.png"), |
819 self.trUtf8('&Full Screen'), | 820 self.trUtf8('&Full Screen'), |
820 QKeySequence(self.trUtf8('F11')), 0, | 821 QKeySequence(self.trUtf8('F11')), 0, |
821 self, 'help_view_full_scree') | 822 self, 'help_view_full_scree') |
822 if not self.initShortcutsOnly: | 823 if not self.initShortcutsOnly: |
823 self.fullScreenAct.triggered[()].connect(self.__viewFullScreen) | 824 self.fullScreenAct.triggered[()].connect(self.__viewFullScreen) |
824 self.__actions.append(self.fullScreenAct) | 825 self.__actions.append(self.fullScreenAct) |
825 self.addAction(self.fullScreenAct) | 826 self.addAction(self.fullScreenAct) |
826 | 827 |
827 self.nextTabAct = E5Action(self.trUtf8('Show next tab'), | 828 self.nextTabAct = E5Action(self.trUtf8('Show next tab'), |
828 self.trUtf8('Show next tab'), | 829 self.trUtf8('Show next tab'), |
829 QKeySequence(self.trUtf8('Ctrl+Alt+Tab')), 0, | 830 QKeySequence(self.trUtf8('Ctrl+Alt+Tab')), 0, |
830 self, 'help_view_next_tab') | 831 self, 'help_view_next_tab') |
831 if not self.initShortcutsOnly: | 832 if not self.initShortcutsOnly: |
832 self.nextTabAct.triggered[()].connect(self.__nextTab) | 833 self.nextTabAct.triggered[()].connect(self.__nextTab) |
833 self.__actions.append(self.nextTabAct) | 834 self.__actions.append(self.nextTabAct) |
834 self.addAction(self.nextTabAct) | 835 self.addAction(self.nextTabAct) |
835 | 836 |
836 self.prevTabAct = E5Action(self.trUtf8('Show previous tab'), | 837 self.prevTabAct = E5Action(self.trUtf8('Show previous tab'), |
837 self.trUtf8('Show previous tab'), | 838 self.trUtf8('Show previous tab'), |
838 QKeySequence(self.trUtf8('Shift+Ctrl+Alt+Tab')), 0, | 839 QKeySequence(self.trUtf8('Shift+Ctrl+Alt+Tab')), 0, |
839 self, 'help_view_previous_tab') | 840 self, 'help_view_previous_tab') |
840 if not self.initShortcutsOnly: | 841 if not self.initShortcutsOnly: |
841 self.prevTabAct.triggered[()].connect(self.__prevTab) | 842 self.prevTabAct.triggered[()].connect(self.__prevTab) |
842 self.__actions.append(self.prevTabAct) | 843 self.__actions.append(self.prevTabAct) |
843 self.addAction(self.prevTabAct) | 844 self.addAction(self.prevTabAct) |
844 | 845 |
845 self.switchTabAct = E5Action(self.trUtf8('Switch between tabs'), | 846 self.switchTabAct = E5Action(self.trUtf8('Switch between tabs'), |
846 self.trUtf8('Switch between tabs'), | 847 self.trUtf8('Switch between tabs'), |
847 QKeySequence(self.trUtf8('Ctrl+1')), 0, | 848 QKeySequence(self.trUtf8('Ctrl+1')), 0, |
848 self, 'help_switch_tabs') | 849 self, 'help_switch_tabs') |
849 if not self.initShortcutsOnly: | 850 if not self.initShortcutsOnly: |
850 self.switchTabAct.triggered[()].connect(self.__switchTab) | 851 self.switchTabAct.triggered[()].connect(self.__switchTab) |
851 self.__actions.append(self.switchTabAct) | 852 self.__actions.append(self.switchTabAct) |
901 )) | 902 )) |
902 if not self.initShortcutsOnly: | 903 if not self.initShortcutsOnly: |
903 self.offlineStorageAct.triggered[()].connect(self.__showOfflineStorageConfiguration) | 904 self.offlineStorageAct.triggered[()].connect(self.__showOfflineStorageConfiguration) |
904 self.__actions.append(self.offlineStorageAct) | 905 self.__actions.append(self.offlineStorageAct) |
905 | 906 |
906 self.syncTocAct = E5Action(self.trUtf8('Sync with Table of Contents'), | 907 self.syncTocAct = E5Action(self.trUtf8('Sync with Table of Contents'), |
907 UI.PixmapCache.getIcon("syncToc.png"), | 908 UI.PixmapCache.getIcon("syncToc.png"), |
908 self.trUtf8('Sync with Table of Contents'), | 909 self.trUtf8('Sync with Table of Contents'), |
909 0, 0, self, 'help_sync_toc') | 910 0, 0, self, 'help_sync_toc') |
910 self.syncTocAct.setStatusTip(self.trUtf8( | 911 self.syncTocAct.setStatusTip(self.trUtf8( |
911 'Synchronizes the table of contents with current page')) | 912 'Synchronizes the table of contents with current page')) |
912 self.syncTocAct.setWhatsThis(self.trUtf8( | 913 self.syncTocAct.setWhatsThis(self.trUtf8( |
913 """<b>Sync with Table of Contents</b>""" | 914 """<b>Sync with Table of Contents</b>""" |
915 )) | 916 )) |
916 if not self.initShortcutsOnly: | 917 if not self.initShortcutsOnly: |
917 self.syncTocAct.triggered[()].connect(self.__syncTOC) | 918 self.syncTocAct.triggered[()].connect(self.__syncTOC) |
918 self.__actions.append(self.syncTocAct) | 919 self.__actions.append(self.syncTocAct) |
919 | 920 |
920 self.showTocAct = E5Action(self.trUtf8('Table of Contents'), | 921 self.showTocAct = E5Action(self.trUtf8('Table of Contents'), |
921 self.trUtf8('Table of Contents'), | 922 self.trUtf8('Table of Contents'), |
922 0, 0, self, 'help_show_toc') | 923 0, 0, self, 'help_show_toc') |
923 self.showTocAct.setStatusTip(self.trUtf8( | 924 self.showTocAct.setStatusTip(self.trUtf8( |
924 'Shows the table of contents window')) | 925 'Shows the table of contents window')) |
925 self.showTocAct.setWhatsThis(self.trUtf8( | 926 self.showTocAct.setWhatsThis(self.trUtf8( |
926 """<b>Table of Contents</b>""" | 927 """<b>Table of Contents</b>""" |
928 )) | 929 )) |
929 if not self.initShortcutsOnly: | 930 if not self.initShortcutsOnly: |
930 self.showTocAct.triggered[()].connect(self.__showTocWindow) | 931 self.showTocAct.triggered[()].connect(self.__showTocWindow) |
931 self.__actions.append(self.showTocAct) | 932 self.__actions.append(self.showTocAct) |
932 | 933 |
933 self.showIndexAct = E5Action(self.trUtf8('Index'), | 934 self.showIndexAct = E5Action(self.trUtf8('Index'), |
934 self.trUtf8('Index'), | 935 self.trUtf8('Index'), |
935 0, 0, self, 'help_show_index') | 936 0, 0, self, 'help_show_index') |
936 self.showIndexAct.setStatusTip(self.trUtf8( | 937 self.showIndexAct.setStatusTip(self.trUtf8( |
937 'Shows the index window')) | 938 'Shows the index window')) |
938 self.showIndexAct.setWhatsThis(self.trUtf8( | 939 self.showIndexAct.setWhatsThis(self.trUtf8( |
939 """<b>Index</b>""" | 940 """<b>Index</b>""" |
941 )) | 942 )) |
942 if not self.initShortcutsOnly: | 943 if not self.initShortcutsOnly: |
943 self.showIndexAct.triggered[()].connect(self.__showIndexWindow) | 944 self.showIndexAct.triggered[()].connect(self.__showIndexWindow) |
944 self.__actions.append(self.showIndexAct) | 945 self.__actions.append(self.showIndexAct) |
945 | 946 |
946 self.showSearchAct = E5Action(self.trUtf8('Search'), | 947 self.showSearchAct = E5Action(self.trUtf8('Search'), |
947 self.trUtf8('Search'), | 948 self.trUtf8('Search'), |
948 0, 0, self, 'help_show_search') | 949 0, 0, self, 'help_show_search') |
949 self.showSearchAct.setStatusTip(self.trUtf8( | 950 self.showSearchAct.setStatusTip(self.trUtf8( |
950 'Shows the search window')) | 951 'Shows the search window')) |
951 self.showSearchAct.setWhatsThis(self.trUtf8( | 952 self.showSearchAct.setWhatsThis(self.trUtf8( |
952 """<b>Search</b>""" | 953 """<b>Search</b>""" |
954 )) | 955 )) |
955 if not self.initShortcutsOnly: | 956 if not self.initShortcutsOnly: |
956 self.showSearchAct.triggered[()].connect(self.__showSearchWindow) | 957 self.showSearchAct.triggered[()].connect(self.__showSearchWindow) |
957 self.__actions.append(self.showSearchAct) | 958 self.__actions.append(self.showSearchAct) |
958 | 959 |
959 self.manageQtHelpDocsAct = E5Action(self.trUtf8('Manage QtHelp Documents'), | 960 self.manageQtHelpDocsAct = E5Action(self.trUtf8('Manage QtHelp Documents'), |
960 self.trUtf8('Manage QtHelp &Documents'), | 961 self.trUtf8('Manage QtHelp &Documents'), |
961 0, 0, self, 'help_qthelp_documents') | 962 0, 0, self, 'help_qthelp_documents') |
962 self.manageQtHelpDocsAct.setStatusTip(self.trUtf8( | 963 self.manageQtHelpDocsAct.setStatusTip(self.trUtf8( |
963 'Shows a dialog to manage the QtHelp documentation set')) | 964 'Shows a dialog to manage the QtHelp documentation set')) |
964 self.manageQtHelpDocsAct.setWhatsThis(self.trUtf8( | 965 self.manageQtHelpDocsAct.setWhatsThis(self.trUtf8( |
965 """<b>Manage QtHelp Documents</b>""" | 966 """<b>Manage QtHelp Documents</b>""" |
967 )) | 968 )) |
968 if not self.initShortcutsOnly: | 969 if not self.initShortcutsOnly: |
969 self.manageQtHelpDocsAct.triggered[()].connect(self.__manageQtHelpDocumentation) | 970 self.manageQtHelpDocsAct.triggered[()].connect(self.__manageQtHelpDocumentation) |
970 self.__actions.append(self.manageQtHelpDocsAct) | 971 self.__actions.append(self.manageQtHelpDocsAct) |
971 | 972 |
972 self.manageQtHelpFiltersAct = E5Action(self.trUtf8('Manage QtHelp Filters'), | 973 self.manageQtHelpFiltersAct = E5Action(self.trUtf8('Manage QtHelp Filters'), |
973 self.trUtf8('Manage QtHelp &Filters'), | 974 self.trUtf8('Manage QtHelp &Filters'), |
974 0, 0, self, 'help_qthelp_filters') | 975 0, 0, self, 'help_qthelp_filters') |
975 self.manageQtHelpFiltersAct.setStatusTip(self.trUtf8( | 976 self.manageQtHelpFiltersAct.setStatusTip(self.trUtf8( |
976 'Shows a dialog to manage the QtHelp filters')) | 977 'Shows a dialog to manage the QtHelp filters')) |
977 self.manageQtHelpFiltersAct.setWhatsThis(self.trUtf8( | 978 self.manageQtHelpFiltersAct.setWhatsThis(self.trUtf8( |
978 """<b>Manage QtHelp Filters</b>""" | 979 """<b>Manage QtHelp Filters</b>""" |
980 )) | 981 )) |
981 if not self.initShortcutsOnly: | 982 if not self.initShortcutsOnly: |
982 self.manageQtHelpFiltersAct.triggered[()].connect(self.__manageQtHelpFilters) | 983 self.manageQtHelpFiltersAct.triggered[()].connect(self.__manageQtHelpFilters) |
983 self.__actions.append(self.manageQtHelpFiltersAct) | 984 self.__actions.append(self.manageQtHelpFiltersAct) |
984 | 985 |
985 self.reindexDocumentationAct = E5Action(self.trUtf8('Reindex Documentation'), | 986 self.reindexDocumentationAct = E5Action(self.trUtf8('Reindex Documentation'), |
986 self.trUtf8('&Reindex Documentation'), | 987 self.trUtf8('&Reindex Documentation'), |
987 0, 0, self, 'help_qthelp_reindex') | 988 0, 0, self, 'help_qthelp_reindex') |
988 self.reindexDocumentationAct.setStatusTip(self.trUtf8( | 989 self.reindexDocumentationAct.setStatusTip(self.trUtf8( |
989 'Reindexes the documentation set')) | 990 'Reindexes the documentation set')) |
990 self.reindexDocumentationAct.setWhatsThis(self.trUtf8( | 991 self.reindexDocumentationAct.setWhatsThis(self.trUtf8( |
991 """<b>Reindex Documentation</b>""" | 992 """<b>Reindex Documentation</b>""" |
994 if not self.initShortcutsOnly: | 995 if not self.initShortcutsOnly: |
995 self.reindexDocumentationAct.triggered[()].connect( | 996 self.reindexDocumentationAct.triggered[()].connect( |
996 self.__searchEngine.reindexDocumentation) | 997 self.__searchEngine.reindexDocumentation) |
997 self.__actions.append(self.reindexDocumentationAct) | 998 self.__actions.append(self.reindexDocumentationAct) |
998 | 999 |
999 self.clearPrivateDataAct = E5Action(self.trUtf8('Clear private data'), | 1000 self.clearPrivateDataAct = E5Action(self.trUtf8('Clear private data'), |
1000 self.trUtf8('&Clear private data'), | 1001 self.trUtf8('&Clear private data'), |
1001 0, 0, | 1002 0, 0, |
1002 self, 'help_clear_private_data') | 1003 self, 'help_clear_private_data') |
1003 self.clearPrivateDataAct.setStatusTip(self.trUtf8('Clear private data')) | 1004 self.clearPrivateDataAct.setStatusTip(self.trUtf8('Clear private data')) |
1004 self.clearPrivateDataAct.setWhatsThis(self.trUtf8( | 1005 self.clearPrivateDataAct.setWhatsThis(self.trUtf8( |
1005 """<b>Clear private data</b>""" | 1006 """<b>Clear private data</b>""" |
1008 )) | 1009 )) |
1009 if not self.initShortcutsOnly: | 1010 if not self.initShortcutsOnly: |
1010 self.clearPrivateDataAct.triggered[()].connect(self.__clearPrivateData) | 1011 self.clearPrivateDataAct.triggered[()].connect(self.__clearPrivateData) |
1011 self.__actions.append(self.clearPrivateDataAct) | 1012 self.__actions.append(self.clearPrivateDataAct) |
1012 | 1013 |
1013 self.clearIconsAct = E5Action(self.trUtf8('Clear icons database'), | 1014 self.clearIconsAct = E5Action(self.trUtf8('Clear icons database'), |
1014 self.trUtf8('Clear &icons database'), | 1015 self.trUtf8('Clear &icons database'), |
1015 0, 0, | 1016 0, 0, |
1016 self, 'help_clear_icons_db') | 1017 self, 'help_clear_icons_db') |
1017 self.clearIconsAct.setStatusTip(self.trUtf8('Clear the database of favicons')) | 1018 self.clearIconsAct.setStatusTip(self.trUtf8('Clear the database of favicons')) |
1018 self.clearIconsAct.setWhatsThis(self.trUtf8( | 1019 self.clearIconsAct.setWhatsThis(self.trUtf8( |
1019 """<b>Clear icons database</b>""" | 1020 """<b>Clear icons database</b>""" |
1021 )) | 1022 )) |
1022 if not self.initShortcutsOnly: | 1023 if not self.initShortcutsOnly: |
1023 self.clearIconsAct.triggered[()].connect(self.__clearIconsDatabase) | 1024 self.clearIconsAct.triggered[()].connect(self.__clearIconsDatabase) |
1024 self.__actions.append(self.clearIconsAct) | 1025 self.__actions.append(self.clearIconsAct) |
1025 | 1026 |
1026 self.searchEnginesAct = E5Action(self.trUtf8('Configure Search Engines'), | 1027 self.searchEnginesAct = E5Action(self.trUtf8('Configure Search Engines'), |
1027 self.trUtf8('Configure Search &Engines...'), | 1028 self.trUtf8('Configure Search &Engines...'), |
1028 0, 0, | 1029 0, 0, |
1029 self, 'help_search_engines') | 1030 self, 'help_search_engines') |
1030 self.searchEnginesAct.setStatusTip(self.trUtf8( | 1031 self.searchEnginesAct.setStatusTip(self.trUtf8( |
1031 'Configure the available search engines')) | 1032 'Configure the available search engines')) |
1032 self.searchEnginesAct.setWhatsThis(self.trUtf8( | 1033 self.searchEnginesAct.setWhatsThis(self.trUtf8( |
1035 )) | 1036 )) |
1036 if not self.initShortcutsOnly: | 1037 if not self.initShortcutsOnly: |
1037 self.searchEnginesAct.triggered[()].connect(self.__showEnginesConfigurationDialog) | 1038 self.searchEnginesAct.triggered[()].connect(self.__showEnginesConfigurationDialog) |
1038 self.__actions.append(self.searchEnginesAct) | 1039 self.__actions.append(self.searchEnginesAct) |
1039 | 1040 |
1040 self.passwordsAct = E5Action(self.trUtf8('Manage Saved Passwords'), | 1041 self.passwordsAct = E5Action(self.trUtf8('Manage Saved Passwords'), |
1041 self.trUtf8('Manage Saved Passwords...'), | 1042 self.trUtf8('Manage Saved Passwords...'), |
1042 0, 0, | 1043 0, 0, |
1043 self, 'help_manage_passwords') | 1044 self, 'help_manage_passwords') |
1044 self.passwordsAct.setStatusTip(self.trUtf8( | 1045 self.passwordsAct.setStatusTip(self.trUtf8( |
1045 'Manage the saved passwords')) | 1046 'Manage the saved passwords')) |
1046 self.passwordsAct.setWhatsThis(self.trUtf8( | 1047 self.passwordsAct.setWhatsThis(self.trUtf8( |
1049 )) | 1050 )) |
1050 if not self.initShortcutsOnly: | 1051 if not self.initShortcutsOnly: |
1051 self.passwordsAct.triggered[()].connect(self.__showPasswordsDialog) | 1052 self.passwordsAct.triggered[()].connect(self.__showPasswordsDialog) |
1052 self.__actions.append(self.passwordsAct) | 1053 self.__actions.append(self.passwordsAct) |
1053 | 1054 |
1054 self.adblockAct = E5Action(self.trUtf8('Ad Block'), | 1055 self.adblockAct = E5Action(self.trUtf8('Ad Block'), |
1055 self.trUtf8('&Ad Block...'), | 1056 self.trUtf8('&Ad Block...'), |
1056 0, 0, | 1057 0, 0, |
1057 self, 'help_adblock') | 1058 self, 'help_adblock') |
1058 self.adblockAct.setStatusTip(self.trUtf8( | 1059 self.adblockAct.setStatusTip(self.trUtf8( |
1059 'Configure AdBlock subscriptions and rules')) | 1060 'Configure AdBlock subscriptions and rules')) |
1060 self.adblockAct.setWhatsThis(self.trUtf8( | 1061 self.adblockAct.setWhatsThis(self.trUtf8( |
1064 if not self.initShortcutsOnly: | 1065 if not self.initShortcutsOnly: |
1065 self.adblockAct.triggered[()].connect(self.__showAdBlockDialog) | 1066 self.adblockAct.triggered[()].connect(self.__showAdBlockDialog) |
1066 self.__actions.append(self.adblockAct) | 1067 self.__actions.append(self.adblockAct) |
1067 | 1068 |
1068 if SSL_AVAILABLE: | 1069 if SSL_AVAILABLE: |
1069 self.certificatesAct = E5Action(self.trUtf8('Manage Certificates'), | 1070 self.certificatesAct = E5Action(self.trUtf8('Manage Certificates'), |
1070 self.trUtf8('Manage Certificates...'), | 1071 self.trUtf8('Manage Certificates...'), |
1071 0, 0, | 1072 0, 0, |
1072 self, 'help_manage_certificates') | 1073 self, 'help_manage_certificates') |
1073 self.certificatesAct.setStatusTip(self.trUtf8( | 1074 self.certificatesAct.setStatusTip(self.trUtf8( |
1074 'Manage the saved certificates')) | 1075 'Manage the saved certificates')) |
1075 self.certificatesAct.setWhatsThis(self.trUtf8( | 1076 self.certificatesAct.setWhatsThis(self.trUtf8( |
1078 )) | 1079 )) |
1079 if not self.initShortcutsOnly: | 1080 if not self.initShortcutsOnly: |
1080 self.certificatesAct.triggered[()].connect(self.__showCertificatesDialog) | 1081 self.certificatesAct.triggered[()].connect(self.__showCertificatesDialog) |
1081 self.__actions.append(self.certificatesAct) | 1082 self.__actions.append(self.certificatesAct) |
1082 | 1083 |
1083 self.toolsMonitorAct = E5Action(self.trUtf8('Show Network Monitor'), | 1084 self.toolsMonitorAct = E5Action(self.trUtf8('Show Network Monitor'), |
1084 self.trUtf8('Show &Network Monitor'), | 1085 self.trUtf8('Show &Network Monitor'), |
1085 0, 0, | 1086 0, 0, |
1086 self, 'help_tools_network_monitor') | 1087 self, 'help_tools_network_monitor') |
1087 self.toolsMonitorAct.setStatusTip(self.trUtf8('Show the network monitor dialog')) | 1088 self.toolsMonitorAct.setStatusTip(self.trUtf8('Show the network monitor dialog')) |
1088 self.toolsMonitorAct.setWhatsThis(self.trUtf8( | 1089 self.toolsMonitorAct.setWhatsThis(self.trUtf8( |
1089 """<b>Show Network Monitor</b>""" | 1090 """<b>Show Network Monitor</b>""" |
1091 )) | 1092 )) |
1092 if not self.initShortcutsOnly: | 1093 if not self.initShortcutsOnly: |
1093 self.toolsMonitorAct.triggered[()].connect(self.__showNetworkMonitor) | 1094 self.toolsMonitorAct.triggered[()].connect(self.__showNetworkMonitor) |
1094 self.__actions.append(self.toolsMonitorAct) | 1095 self.__actions.append(self.toolsMonitorAct) |
1095 | 1096 |
1096 self.showDownloadManagerAct = E5Action(self.trUtf8('Downloads'), | 1097 self.showDownloadManagerAct = E5Action(self.trUtf8('Downloads'), |
1097 self.trUtf8('Downloads'), | 1098 self.trUtf8('Downloads'), |
1098 0, 0, self, 'help_show_downloads') | 1099 0, 0, self, 'help_show_downloads') |
1099 self.showDownloadManagerAct.setStatusTip(self.trUtf8( | 1100 self.showDownloadManagerAct.setStatusTip(self.trUtf8( |
1100 'Shows the downloads window')) | 1101 'Shows the downloads window')) |
1101 self.showDownloadManagerAct.setWhatsThis(self.trUtf8( | 1102 self.showDownloadManagerAct.setWhatsThis(self.trUtf8( |
1102 """<b>Downloads</b>""" | 1103 """<b>Downloads</b>""" |
1108 | 1109 |
1109 self.backAct.setEnabled(False) | 1110 self.backAct.setEnabled(False) |
1110 self.forwardAct.setEnabled(False) | 1111 self.forwardAct.setEnabled(False) |
1111 | 1112 |
1112 # now read the keyboard shortcuts for the actions | 1113 # now read the keyboard shortcuts for the actions |
1113 Shortcuts.readShortcuts(helpViewer = self) | 1114 Shortcuts.readShortcuts(helpViewer=self) |
1114 | 1115 |
1115 def getActions(self): | 1116 def getActions(self): |
1116 """ | 1117 """ |
1117 Public method to get a list of all actions. | 1118 Public method to get a list of all actions. |
1118 | 1119 |
1427 @param title new title (string) | 1428 @param title new title (string) |
1428 """ | 1429 """ |
1429 self.historyManager().updateHistoryEntry( | 1430 self.historyManager().updateHistoryEntry( |
1430 self.currentBrowser().url().toString(), title) | 1431 self.currentBrowser().url().toString(), title) |
1431 | 1432 |
1432 def newTab(self, link = None): | 1433 def newTab(self, link=None): |
1433 """ | 1434 """ |
1434 Public slot called to open a new help window tab. | 1435 Public slot called to open a new help window tab. |
1435 | 1436 |
1436 @param link file to be displayed in the new window (string or QUrl) | 1437 @param link file to be displayed in the new window (string or QUrl) |
1437 """ | 1438 """ |
1438 self.tabWidget.newBrowser(link) | 1439 self.tabWidget.newBrowser(link) |
1439 | 1440 |
1440 def newWindow(self, link = None): | 1441 def newWindow(self, link=None): |
1441 """ | 1442 """ |
1442 Public slot called to open a new help browser dialog. | 1443 Public slot called to open a new help browser dialog. |
1443 | 1444 |
1444 @param link file to be displayed in the new window (string or QUrl) | 1445 @param link file to be displayed in the new window (string or QUrl) |
1445 """ | 1446 """ |
1455 def __openFile(self): | 1456 def __openFile(self): |
1456 """ | 1457 """ |
1457 Private slot called to open a file. | 1458 Private slot called to open a file. |
1458 """ | 1459 """ |
1459 fn = E5FileDialog.getOpenFileName( | 1460 fn = E5FileDialog.getOpenFileName( |
1460 self, | 1461 self, |
1461 self.trUtf8("Open File"), | 1462 self.trUtf8("Open File"), |
1462 "", | 1463 "", |
1463 self.trUtf8("Help Files (*.html *.htm);;" | 1464 self.trUtf8("Help Files (*.html *.htm);;" |
1464 "PDF Files (*.pdf);;" | 1465 "PDF Files (*.pdf);;" |
1465 "CHM Files (*.chm);;" | 1466 "CHM Files (*.chm);;" |
1475 def __openFileNewTab(self): | 1476 def __openFileNewTab(self): |
1476 """ | 1477 """ |
1477 Private slot called to open a file in a new tab. | 1478 Private slot called to open a file in a new tab. |
1478 """ | 1479 """ |
1479 fn = E5FileDialog.getOpenFileName( | 1480 fn = E5FileDialog.getOpenFileName( |
1480 self, | 1481 self, |
1481 self.trUtf8("Open File"), | 1482 self.trUtf8("Open File"), |
1482 "", | 1483 "", |
1483 self.trUtf8("Help Files (*.html *.htm);;" | 1484 self.trUtf8("Help Files (*.html *.htm);;" |
1484 "PDF Files (*.pdf);;" | 1485 "PDF Files (*.pdf);;" |
1485 "CHM Files (*.chm);;" | 1486 "CHM Files (*.chm);;" |
1829 | 1830 |
1830 def __showPreferences(self): | 1831 def __showPreferences(self): |
1831 """ | 1832 """ |
1832 Private slot to set the preferences. | 1833 Private slot to set the preferences. |
1833 """ | 1834 """ |
1834 dlg = ConfigurationDialog(self, 'Configuration', True, | 1835 dlg = ConfigurationDialog(self, 'Configuration', True, |
1835 fromEric = self.fromEric, | 1836 fromEric=self.fromEric, |
1836 displayMode = ConfigurationDialog.HelpBrowserMode) | 1837 displayMode=ConfigurationDialog.HelpBrowserMode) |
1837 dlg.preferencesChanged.connect(self.preferencesChanged) | 1838 dlg.preferencesChanged.connect(self.preferencesChanged) |
1838 dlg.show() | 1839 dlg.show() |
1839 if self.__lastConfigurationPageName: | 1840 if self.__lastConfigurationPageName: |
1840 dlg.showConfigurationPageByName(self.__lastConfigurationPageName) | 1841 dlg.showConfigurationPageByName(self.__lastConfigurationPageName) |
1841 else: | 1842 else: |
1893 | 1894 |
1894 @return reference to the help engine (QHelpEngine) | 1895 @return reference to the help engine (QHelpEngine) |
1895 """ | 1896 """ |
1896 if cls._helpEngine is None: | 1897 if cls._helpEngine is None: |
1897 cls._helpEngine = \ | 1898 cls._helpEngine = \ |
1898 QHelpEngine(os.path.join(Utilities.getConfigDir(), | 1899 QHelpEngine(os.path.join(Utilities.getConfigDir(), |
1899 "browser", "eric5help.qhc")) | 1900 "browser", "eric5help.qhc")) |
1900 return cls._helpEngine | 1901 return cls._helpEngine |
1901 | 1902 |
1902 @classmethod | 1903 @classmethod |
1903 def networkAccessManager(cls): | 1904 def networkAccessManager(cls): |
2041 Private slot to manage the QtHelp documentation database. | 2042 Private slot to manage the QtHelp documentation database. |
2042 """ | 2043 """ |
2043 dlg = QtHelpDocumentationDialog(self.__helpEngine, self) | 2044 dlg = QtHelpDocumentationDialog(self.__helpEngine, self) |
2044 dlg.exec_() | 2045 dlg.exec_() |
2045 if dlg.hasChanges(): | 2046 if dlg.hasChanges(): |
2046 for i in sorted(dlg.getTabsToClose(), reverse = True): | 2047 for i in sorted(dlg.getTabsToClose(), reverse=True): |
2047 self.tabWidget.closeBrowserAt(i) | 2048 self.tabWidget.closeBrowserAt(i) |
2048 self.__helpEngine.setupData() | 2049 self.__helpEngine.setupData() |
2049 | 2050 |
2050 def getSourceFileList(self): | 2051 def getSourceFileList(self): |
2051 """ | 2052 """ |
2231 """ | 2232 """ |
2232 Private slot to clear the private data. | 2233 Private slot to clear the private data. |
2233 """ | 2234 """ |
2234 dlg = HelpClearPrivateDataDialog(self) | 2235 dlg = HelpClearPrivateDataDialog(self) |
2235 if dlg.exec_() == QDialog.Accepted: | 2236 if dlg.exec_() == QDialog.Accepted: |
2236 # browsing history, search history, favicons, disk cache, cookies, | 2237 # browsing history, search history, favicons, disk cache, cookies, |
2237 # passwords, web databases, downloads | 2238 # passwords, web databases, downloads |
2238 history, searches, favicons, cache, cookies, | 2239 history, searches, favicons, cache, cookies, |
2239 passwords, databases, downloads = \ | 2240 passwords, databases, downloads = \ |
2240 dlg.getData() | 2241 dlg.getData() |
2241 if history: | 2242 if history: |
2242 self.historyManager().clear() | 2243 self.historyManager().clear() |
2243 if searches: | 2244 if searches: |
2328 """ | 2329 """ |
2329 Private slot to show the source of the current page in an editor. | 2330 Private slot to show the source of the current page in an editor. |
2330 """ | 2331 """ |
2331 from QScintilla.MiniEditor import MiniEditor | 2332 from QScintilla.MiniEditor import MiniEditor |
2332 src = self.currentBrowser().page().mainFrame().toHtml() | 2333 src = self.currentBrowser().page().mainFrame().toHtml() |
2333 editor = MiniEditor(parent = self) | 2334 editor = MiniEditor(parent=self) |
2334 editor.setText(src, "Html") | 2335 editor.setText(src, "Html") |
2335 editor.setLanguage("dummy.html") | 2336 editor.setLanguage("dummy.html") |
2336 editor.show() | 2337 editor.show() |
2337 | 2338 |
2338 @classmethod | 2339 @classmethod |
2393 """ | 2394 """ |
2394 self.__linkActivated(url) | 2395 self.__linkActivated(url) |
2395 | 2396 |
2396 def openUrlNewTab(self, url, title): | 2397 def openUrlNewTab(self, url, title): |
2397 """ | 2398 """ |
2398 Public slot to load a URL from the bookmarks menu or bookmarks toolbar | 2399 Public slot to load a URL from the bookmarks menu or bookmarks toolbar |
2399 in a new tab. | 2400 in a new tab. |
2400 | 2401 |
2401 @param url url to be opened (QUrl) | 2402 @param url url to be opened (QUrl) |
2402 @param title title of the bookmark (string) | 2403 @param title title of the bookmark (string) |
2403 """ | 2404 """ |
2477 """ | 2478 """ |
2478 self.__textEncodingMenu.clear() | 2479 self.__textEncodingMenu.clear() |
2479 | 2480 |
2480 codecs = [] | 2481 codecs = [] |
2481 for codec in QTextCodec.availableCodecs(): | 2482 for codec in QTextCodec.availableCodecs(): |
2482 codecs.append(str(codec, encoding = "utf-8").lower()) | 2483 codecs.append(str(codec, encoding="utf-8").lower()) |
2483 codecs.sort() | 2484 codecs.sort() |
2484 | 2485 |
2485 defaultTextEncoding = QWebSettings.globalSettings().defaultTextEncoding().lower() | 2486 defaultTextEncoding = QWebSettings.globalSettings().defaultTextEncoding().lower() |
2486 if defaultTextEncoding in codecs: | 2487 if defaultTextEncoding in codecs: |
2487 currentCodec = defaultTextEncoding | 2488 currentCodec = defaultTextEncoding |