Helpviewer/HelpWindow.py

branch
Py2 comp.
changeset 3060
5883ce99ee12
parent 3058
0a02c433f52d
parent 3035
36e9f388958b
child 3080
6c0a430b19df
equal deleted inserted replaced
3058:0a02c433f52d 3060:5883ce99ee12
355 Utilities.getConfigDir(), "browser", "webdatabases") 355 Utilities.getConfigDir(), "browser", "webdatabases")
356 if not os.path.exists(webDatabaseDir): 356 if not os.path.exists(webDatabaseDir):
357 os.makedirs(webDatabaseDir) 357 os.makedirs(webDatabaseDir)
358 settings.setOfflineStoragePath(webDatabaseDir) 358 settings.setOfflineStoragePath(webDatabaseDir)
359 settings.setOfflineStorageDefaultQuota( 359 settings.setOfflineStorageDefaultQuota(
360 Preferences.getHelp("OfflineStorageDatabaseQuota") * \ 360 Preferences.getHelp("OfflineStorageDatabaseQuota") *
361 1024 * 1024) 361 1024 * 1024)
362 362
363 if hasattr(QWebSettings, "OfflineWebApplicationCacheEnabled"): 363 if hasattr(QWebSettings, "OfflineWebApplicationCacheEnabled"):
364 settings.setAttribute( 364 settings.setAttribute(
365 QWebSettings.OfflineWebApplicationCacheEnabled, 365 QWebSettings.OfflineWebApplicationCacheEnabled,
368 Utilities.getConfigDir(), "browser", "webappcaches") 368 Utilities.getConfigDir(), "browser", "webappcaches")
369 if not os.path.exists(appCacheDir): 369 if not os.path.exists(appCacheDir):
370 os.makedirs(appCacheDir) 370 os.makedirs(appCacheDir)
371 settings.setOfflineWebApplicationCachePath(appCacheDir) 371 settings.setOfflineWebApplicationCachePath(appCacheDir)
372 settings.setOfflineWebApplicationCacheQuota( 372 settings.setOfflineWebApplicationCacheQuota(
373 Preferences.getHelp("OfflineWebApplicationCacheQuota") * \ 373 Preferences.getHelp("OfflineWebApplicationCacheQuota") *
374 1024 * 1024) 374 1024 * 1024)
375 375
376 if hasattr(QWebSettings, "LocalStorageEnabled"): 376 if hasattr(QWebSettings, "LocalStorageEnabled"):
377 settings.setAttribute( 377 settings.setAttribute(
378 QWebSettings.LocalStorageEnabled, 378 QWebSettings.LocalStorageEnabled,
432 self.trUtf8('&New Tab'), 432 self.trUtf8('&New Tab'),
433 QKeySequence(self.trUtf8("Ctrl+T", "File|New Tab")), 433 QKeySequence(self.trUtf8("Ctrl+T", "File|New Tab")),
434 0, self, 'help_file_new_tab') 434 0, self, 'help_file_new_tab')
435 self.newTabAct.setStatusTip(self.trUtf8('Open a new help window tab')) 435 self.newTabAct.setStatusTip(self.trUtf8('Open a new help window tab'))
436 self.newTabAct.setWhatsThis(self.trUtf8( 436 self.newTabAct.setWhatsThis(self.trUtf8(
437 """<b>New Tab</b>""" 437 """<b>New Tab</b>"""
438 """<p>This opens a new help window tab.</p>""" 438 """<p>This opens a new help window tab.</p>"""
439 )) 439 ))
440 if not self.initShortcutsOnly: 440 if not self.initShortcutsOnly:
441 self.newTabAct.triggered[()].connect(self.newTab) 441 self.newTabAct.triggered[()].connect(self.newTab)
442 self.__actions.append(self.newTabAct) 442 self.__actions.append(self.newTabAct)
443 443
447 self.trUtf8('New &Window'), 447 self.trUtf8('New &Window'),
448 QKeySequence(self.trUtf8("Ctrl+N", "File|New Window")), 448 QKeySequence(self.trUtf8("Ctrl+N", "File|New Window")),
449 0, self, 'help_file_new_window') 449 0, self, 'help_file_new_window')
450 self.newAct.setStatusTip(self.trUtf8('Open a new help browser window')) 450 self.newAct.setStatusTip(self.trUtf8('Open a new help browser window'))
451 self.newAct.setWhatsThis(self.trUtf8( 451 self.newAct.setWhatsThis(self.trUtf8(
452 """<b>New Window</b>""" 452 """<b>New Window</b>"""
453 """<p>This opens a new help browser window.</p>""" 453 """<p>This opens a new help browser window.</p>"""
454 )) 454 ))
455 if not self.initShortcutsOnly: 455 if not self.initShortcutsOnly:
456 self.newAct.triggered[()].connect(self.newWindow) 456 self.newAct.triggered[()].connect(self.newWindow)
457 self.__actions.append(self.newAct) 457 self.__actions.append(self.newAct)
458 458
462 self.trUtf8('&Open File'), 462 self.trUtf8('&Open File'),
463 QKeySequence(self.trUtf8("Ctrl+O", "File|Open")), 463 QKeySequence(self.trUtf8("Ctrl+O", "File|Open")),
464 0, self, 'help_file_open') 464 0, self, 'help_file_open')
465 self.openAct.setStatusTip(self.trUtf8('Open a help file for display')) 465 self.openAct.setStatusTip(self.trUtf8('Open a help file for display'))
466 self.openAct.setWhatsThis(self.trUtf8( 466 self.openAct.setWhatsThis(self.trUtf8(
467 """<b>Open File</b>""" 467 """<b>Open File</b>"""
468 """<p>This opens a new help file for display.""" 468 """<p>This opens a new help file for display."""
469 """ It pops up a file selection dialog.</p>""" 469 """ It pops up a file selection dialog.</p>"""
470 )) 470 ))
471 if not self.initShortcutsOnly: 471 if not self.initShortcutsOnly:
472 self.openAct.triggered[()].connect(self.__openFile) 472 self.openAct.triggered[()].connect(self.__openFile)
473 self.__actions.append(self.openAct) 473 self.__actions.append(self.openAct)
474 474
479 QKeySequence(self.trUtf8("Shift+Ctrl+O", "File|Open in new tab")), 479 QKeySequence(self.trUtf8("Shift+Ctrl+O", "File|Open in new tab")),
480 0, self, 'help_file_open_tab') 480 0, self, 'help_file_open_tab')
481 self.openTabAct.setStatusTip( 481 self.openTabAct.setStatusTip(
482 self.trUtf8('Open a help file for display in a new tab')) 482 self.trUtf8('Open a help file for display in a new tab'))
483 self.openTabAct.setWhatsThis(self.trUtf8( 483 self.openTabAct.setWhatsThis(self.trUtf8(
484 """<b>Open File in New Tab</b>""" 484 """<b>Open File in New Tab</b>"""
485 """<p>This opens a new help file for display in a new tab.""" 485 """<p>This opens a new help file for display in a new tab."""
486 """ It pops up a file selection dialog.</p>""" 486 """ It pops up a file selection dialog.</p>"""
487 )) 487 ))
488 if not self.initShortcutsOnly: 488 if not self.initShortcutsOnly:
489 self.openTabAct.triggered[()].connect(self.__openFileNewTab) 489 self.openTabAct.triggered[()].connect(self.__openFileNewTab)
490 self.__actions.append(self.openTabAct) 490 self.__actions.append(self.openTabAct)
491 491
496 QKeySequence(self.trUtf8("Shift+Ctrl+S", "File|Save As")), 496 QKeySequence(self.trUtf8("Shift+Ctrl+S", "File|Save As")),
497 0, self, 'help_file_save_as') 497 0, self, 'help_file_save_as')
498 self.saveAsAct.setStatusTip( 498 self.saveAsAct.setStatusTip(
499 self.trUtf8('Save the current page to disk')) 499 self.trUtf8('Save the current page to disk'))
500 self.saveAsAct.setWhatsThis(self.trUtf8( 500 self.saveAsAct.setWhatsThis(self.trUtf8(
501 """<b>Save As...</b>""" 501 """<b>Save As...</b>"""
502 """<p>Saves the current page to disk.</p>""" 502 """<p>Saves the current page to disk.</p>"""
503 )) 503 ))
504 if not self.initShortcutsOnly: 504 if not self.initShortcutsOnly:
505 self.saveAsAct.triggered[()].connect(self.__savePageAs) 505 self.saveAsAct.triggered[()].connect(self.__savePageAs)
506 self.__actions.append(self.saveAsAct) 506 self.__actions.append(self.saveAsAct)
507 507
511 self.trUtf8('Save Page Screen...'), 511 self.trUtf8('Save Page Screen...'),
512 0, 0, self, 'help_file_save_page_screen') 512 0, 0, self, 'help_file_save_page_screen')
513 self.savePageScreenAct.setStatusTip( 513 self.savePageScreenAct.setStatusTip(
514 self.trUtf8('Save the current page as a screen shot')) 514 self.trUtf8('Save the current page as a screen shot'))
515 self.savePageScreenAct.setWhatsThis(self.trUtf8( 515 self.savePageScreenAct.setWhatsThis(self.trUtf8(
516 """<b>Save Page Screen...</b>""" 516 """<b>Save Page Screen...</b>"""
517 """<p>Saves the current page as a screen shot.</p>""" 517 """<p>Saves the current page as a screen shot.</p>"""
518 )) 518 ))
519 if not self.initShortcutsOnly: 519 if not self.initShortcutsOnly:
520 self.savePageScreenAct.triggered[()].connect(self.__savePageScreen) 520 self.savePageScreenAct.triggered[()].connect(self.__savePageScreen)
521 self.__actions.append(self.savePageScreenAct) 521 self.__actions.append(self.savePageScreenAct)
522 522
544 self.trUtf8('&Import Bookmarks...'), 544 self.trUtf8('&Import Bookmarks...'),
545 0, 0, self, 'help_file_import_bookmarks') 545 0, 0, self, 'help_file_import_bookmarks')
546 self.importBookmarksAct.setStatusTip( 546 self.importBookmarksAct.setStatusTip(
547 self.trUtf8('Import bookmarks from other browsers')) 547 self.trUtf8('Import bookmarks from other browsers'))
548 self.importBookmarksAct.setWhatsThis(self.trUtf8( 548 self.importBookmarksAct.setWhatsThis(self.trUtf8(
549 """<b>Import Bookmarks</b>""" 549 """<b>Import Bookmarks</b>"""
550 """<p>Import bookmarks from other browsers.</p>""" 550 """<p>Import bookmarks from other browsers.</p>"""
551 )) 551 ))
552 if not self.initShortcutsOnly: 552 if not self.initShortcutsOnly:
553 self.importBookmarksAct.triggered[()].connect( 553 self.importBookmarksAct.triggered[()].connect(
554 bookmarksManager.importBookmarks) 554 bookmarksManager.importBookmarks)
555 self.__actions.append(self.importBookmarksAct) 555 self.__actions.append(self.importBookmarksAct)
559 self.trUtf8('&Export Bookmarks...'), 559 self.trUtf8('&Export Bookmarks...'),
560 0, 0, self, 'help_file_export_bookmarks') 560 0, 0, self, 'help_file_export_bookmarks')
561 self.exportBookmarksAct.setStatusTip( 561 self.exportBookmarksAct.setStatusTip(
562 self.trUtf8('Export the bookmarks into a file')) 562 self.trUtf8('Export the bookmarks into a file'))
563 self.exportBookmarksAct.setWhatsThis(self.trUtf8( 563 self.exportBookmarksAct.setWhatsThis(self.trUtf8(
564 """<b>Export Bookmarks</b>""" 564 """<b>Export Bookmarks</b>"""
565 """<p>Export the bookmarks into a file.</p>""" 565 """<p>Export the bookmarks into a file.</p>"""
566 )) 566 ))
567 if not self.initShortcutsOnly: 567 if not self.initShortcutsOnly:
568 self.exportBookmarksAct.triggered[()].connect( 568 self.exportBookmarksAct.triggered[()].connect(
569 bookmarksManager.exportBookmarks) 569 bookmarksManager.exportBookmarks)
570 self.__actions.append(self.exportBookmarksAct) 570 self.__actions.append(self.exportBookmarksAct)
575 self.trUtf8('&Print'), 575 self.trUtf8('&Print'),
576 QKeySequence(self.trUtf8("Ctrl+P", "File|Print")), 576 QKeySequence(self.trUtf8("Ctrl+P", "File|Print")),
577 0, self, 'help_file_print') 577 0, self, 'help_file_print')
578 self.printAct.setStatusTip(self.trUtf8('Print the displayed help')) 578 self.printAct.setStatusTip(self.trUtf8('Print the displayed help'))
579 self.printAct.setWhatsThis(self.trUtf8( 579 self.printAct.setWhatsThis(self.trUtf8(
580 """<b>Print</b>""" 580 """<b>Print</b>"""
581 """<p>Print the displayed help text.</p>""" 581 """<p>Print the displayed help text.</p>"""
582 )) 582 ))
583 if not self.initShortcutsOnly: 583 if not self.initShortcutsOnly:
584 self.printAct.triggered[()].connect(self.tabWidget.printBrowser) 584 self.printAct.triggered[()].connect(self.tabWidget.printBrowser)
585 self.__actions.append(self.printAct) 585 self.__actions.append(self.printAct)
586 586
604 self.trUtf8('Print Preview'), 604 self.trUtf8('Print Preview'),
605 UI.PixmapCache.getIcon("printPreview.png"), 605 UI.PixmapCache.getIcon("printPreview.png"),
606 self.trUtf8('Print Preview'), 606 self.trUtf8('Print Preview'),
607 0, 0, self, 'help_file_print_preview') 607 0, 0, self, 'help_file_print_preview')
608 self.printPreviewAct.setStatusTip(self.trUtf8( 608 self.printPreviewAct.setStatusTip(self.trUtf8(
609 'Print preview of the displayed help')) 609 'Print preview of the displayed help'))
610 self.printPreviewAct.setWhatsThis(self.trUtf8( 610 self.printPreviewAct.setWhatsThis(self.trUtf8(
611 """<b>Print Preview</b>""" 611 """<b>Print Preview</b>"""
612 """<p>Print preview of the displayed help text.</p>""" 612 """<p>Print preview of the displayed help text.</p>"""
613 )) 613 ))
614 if not self.initShortcutsOnly: 614 if not self.initShortcutsOnly:
615 self.printPreviewAct.triggered[()].connect( 615 self.printPreviewAct.triggered[()].connect(
616 self.tabWidget.printPreviewBrowser) 616 self.tabWidget.printPreviewBrowser)
617 self.__actions.append(self.printPreviewAct) 617 self.__actions.append(self.printPreviewAct)
636 self.trUtf8('Close All'), 636 self.trUtf8('Close All'),
637 self.trUtf8('Close &All'), 637 self.trUtf8('Close &All'),
638 0, 0, self, 'help_file_close_all') 638 0, 0, self, 'help_file_close_all')
639 self.closeAllAct.setStatusTip(self.trUtf8('Close all help windows')) 639 self.closeAllAct.setStatusTip(self.trUtf8('Close all help windows'))
640 self.closeAllAct.setWhatsThis(self.trUtf8( 640 self.closeAllAct.setWhatsThis(self.trUtf8(
641 """<b>Close All</b>""" 641 """<b>Close All</b>"""
642 """<p>Closes all help windows except the first one.</p>""" 642 """<p>Closes all help windows except the first one.</p>"""
643 )) 643 ))
644 if not self.initShortcutsOnly: 644 if not self.initShortcutsOnly:
645 self.closeAllAct.triggered[()].connect( 645 self.closeAllAct.triggered[()].connect(
646 self.tabWidget.closeAllBrowsers) 646 self.tabWidget.closeAllBrowsers)
647 self.__actions.append(self.closeAllAct) 647 self.__actions.append(self.closeAllAct)
651 UI.PixmapCache.getIcon("privateBrowsing.png"), 651 UI.PixmapCache.getIcon("privateBrowsing.png"),
652 self.trUtf8('Private &Browsing'), 652 self.trUtf8('Private &Browsing'),
653 0, 0, self, 'help_file_private_browsing') 653 0, 0, self, 'help_file_private_browsing')
654 self.privateBrowsingAct.setStatusTip(self.trUtf8('Private Browsing')) 654 self.privateBrowsingAct.setStatusTip(self.trUtf8('Private Browsing'))
655 self.privateBrowsingAct.setWhatsThis(self.trUtf8( 655 self.privateBrowsingAct.setWhatsThis(self.trUtf8(
656 """<b>Private Browsing</b>""" 656 """<b>Private Browsing</b>"""
657 """<p>Enables private browsing. In this mode no history is""" 657 """<p>Enables private browsing. In this mode no history is"""
658 """ recorded anymore.</p>""" 658 """ recorded anymore.</p>"""
659 )) 659 ))
660 if not self.initShortcutsOnly: 660 if not self.initShortcutsOnly:
661 self.privateBrowsingAct.triggered[()].connect( 661 self.privateBrowsingAct.triggered[()].connect(
662 self.__privateBrowsing) 662 self.__privateBrowsing)
663 self.privateBrowsingAct.setCheckable(True) 663 self.privateBrowsingAct.setCheckable(True)
669 self.trUtf8('&Quit'), 669 self.trUtf8('&Quit'),
670 QKeySequence(self.trUtf8("Ctrl+Q", "File|Quit")), 670 QKeySequence(self.trUtf8("Ctrl+Q", "File|Quit")),
671 0, self, 'help_file_quit') 671 0, self, 'help_file_quit')
672 self.exitAct.setStatusTip(self.trUtf8('Quit the eric5 Web Browser')) 672 self.exitAct.setStatusTip(self.trUtf8('Quit the eric5 Web Browser'))
673 self.exitAct.setWhatsThis(self.trUtf8( 673 self.exitAct.setWhatsThis(self.trUtf8(
674 """<b>Quit</b>""" 674 """<b>Quit</b>"""
675 """<p>Quit the eric5 Web Browser.</p>""" 675 """<p>Quit the eric5 Web Browser.</p>"""
676 )) 676 ))
677 if not self.initShortcutsOnly: 677 if not self.initShortcutsOnly:
678 if self.fromEric: 678 if self.fromEric:
679 self.exitAct.triggered[()].connect(self.close) 679 self.exitAct.triggered[()].connect(self.close)
680 else: 680 else:
688 QKeySequence(self.trUtf8("Alt+Left", "Go|Backward")), 688 QKeySequence(self.trUtf8("Alt+Left", "Go|Backward")),
689 QKeySequence(self.trUtf8("Backspace", "Go|Backward")), 689 QKeySequence(self.trUtf8("Backspace", "Go|Backward")),
690 self, 'help_go_backward') 690 self, 'help_go_backward')
691 self.backAct.setStatusTip(self.trUtf8('Move one help screen backward')) 691 self.backAct.setStatusTip(self.trUtf8('Move one help screen backward'))
692 self.backAct.setWhatsThis(self.trUtf8( 692 self.backAct.setWhatsThis(self.trUtf8(
693 """<b>Backward</b>""" 693 """<b>Backward</b>"""
694 """<p>Moves one help screen backward. If none is""" 694 """<p>Moves one help screen backward. If none is"""
695 """ available, this action is disabled.</p>""" 695 """ available, this action is disabled.</p>"""
696 )) 696 ))
697 if not self.initShortcutsOnly: 697 if not self.initShortcutsOnly:
698 self.backAct.triggered[()].connect(self.__backward) 698 self.backAct.triggered[()].connect(self.__backward)
699 self.__actions.append(self.backAct) 699 self.__actions.append(self.backAct)
700 700
756 QKeySequence(self.trUtf8("Ctrl+.", "Go|Stop")), 756 QKeySequence(self.trUtf8("Ctrl+.", "Go|Stop")),
757 QKeySequence(self.trUtf8("Esc", "Go|Stop")), 757 QKeySequence(self.trUtf8("Esc", "Go|Stop")),
758 self, 'help_go_stop') 758 self, 'help_go_stop')
759 self.stopAct.setStatusTip(self.trUtf8('Stop loading')) 759 self.stopAct.setStatusTip(self.trUtf8('Stop loading'))
760 self.stopAct.setWhatsThis(self.trUtf8( 760 self.stopAct.setWhatsThis(self.trUtf8(
761 """<b>Stop</b>""" 761 """<b>Stop</b>"""
762 """<p>Stops loading of the current tab.</p>""" 762 """<p>Stops loading of the current tab.</p>"""
763 )) 763 ))
764 if not self.initShortcutsOnly: 764 if not self.initShortcutsOnly:
765 self.stopAct.triggered[()].connect(self.__stopLoading) 765 self.stopAct.triggered[()].connect(self.__stopLoading)
766 self.__actions.append(self.stopAct) 766 self.__actions.append(self.stopAct)
767 767
771 self.trUtf8('&Copy'), 771 self.trUtf8('&Copy'),
772 QKeySequence(self.trUtf8("Ctrl+C", "Edit|Copy")), 772 QKeySequence(self.trUtf8("Ctrl+C", "Edit|Copy")),
773 0, self, 'help_edit_copy') 773 0, self, 'help_edit_copy')
774 self.copyAct.setStatusTip(self.trUtf8('Copy the selected text')) 774 self.copyAct.setStatusTip(self.trUtf8('Copy the selected text'))
775 self.copyAct.setWhatsThis(self.trUtf8( 775 self.copyAct.setWhatsThis(self.trUtf8(
776 """<b>Copy</b>""" 776 """<b>Copy</b>"""
777 """<p>Copy the selected text to the clipboard.</p>""" 777 """<p>Copy the selected text to the clipboard.</p>"""
778 )) 778 ))
779 if not self.initShortcutsOnly: 779 if not self.initShortcutsOnly:
780 self.copyAct.triggered[()].connect(self.__copy) 780 self.copyAct.triggered[()].connect(self.__copy)
781 self.__actions.append(self.copyAct) 781 self.__actions.append(self.copyAct)
782 782
786 self.trUtf8('&Find...'), 786 self.trUtf8('&Find...'),
787 QKeySequence(self.trUtf8("Ctrl+F", "Edit|Find")), 787 QKeySequence(self.trUtf8("Ctrl+F", "Edit|Find")),
788 0, self, 'help_edit_find') 788 0, self, 'help_edit_find')
789 self.findAct.setStatusTip(self.trUtf8('Find text in page')) 789 self.findAct.setStatusTip(self.trUtf8('Find text in page'))
790 self.findAct.setWhatsThis(self.trUtf8( 790 self.findAct.setWhatsThis(self.trUtf8(
791 """<b>Find</b>""" 791 """<b>Find</b>"""
792 """<p>Find text in the current page.</p>""" 792 """<p>Find text in the current page.</p>"""
793 )) 793 ))
794 if not self.initShortcutsOnly: 794 if not self.initShortcutsOnly:
795 self.findAct.triggered[()].connect(self.__find) 795 self.findAct.triggered[()].connect(self.__find)
796 self.__actions.append(self.findAct) 796 self.__actions.append(self.findAct)
797 797
832 self.trUtf8('Manage Bookmarks'), 832 self.trUtf8('Manage Bookmarks'),
833 self.trUtf8('&Manage Bookmarks...'), 833 self.trUtf8('&Manage Bookmarks...'),
834 QKeySequence(self.trUtf8("Ctrl+Shift+B", "Help|Manage bookmarks")), 834 QKeySequence(self.trUtf8("Ctrl+Shift+B", "Help|Manage bookmarks")),
835 0, self, 'help_bookmarks_manage') 835 0, self, 'help_bookmarks_manage')
836 self.bookmarksManageAct.setStatusTip(self.trUtf8( 836 self.bookmarksManageAct.setStatusTip(self.trUtf8(
837 'Open a dialog to manage the bookmarks.')) 837 'Open a dialog to manage the bookmarks.'))
838 self.bookmarksManageAct.setWhatsThis(self.trUtf8( 838 self.bookmarksManageAct.setWhatsThis(self.trUtf8(
839 """<b>Manage Bookmarks...</b>""" 839 """<b>Manage Bookmarks...</b>"""
840 """<p>Open a dialog to manage the bookmarks.</p>""" 840 """<p>Open a dialog to manage the bookmarks.</p>"""
841 )) 841 ))
842 if not self.initShortcutsOnly: 842 if not self.initShortcutsOnly:
843 self.bookmarksManageAct.triggered[()].connect( 843 self.bookmarksManageAct.triggered[()].connect(
844 self.__showBookmarksDialog) 844 self.__showBookmarksDialog)
845 self.__actions.append(self.bookmarksManageAct) 845 self.__actions.append(self.bookmarksManageAct)
864 self.bookmarksAddFolderAct = E5Action( 864 self.bookmarksAddFolderAct = E5Action(
865 self.trUtf8('Add Folder'), 865 self.trUtf8('Add Folder'),
866 self.trUtf8('Add &Folder...'), 866 self.trUtf8('Add &Folder...'),
867 0, 0, self, 'help_bookmark_show_all') 867 0, 0, self, 'help_bookmark_show_all')
868 self.bookmarksAddFolderAct.setStatusTip(self.trUtf8( 868 self.bookmarksAddFolderAct.setStatusTip(self.trUtf8(
869 'Open a dialog to add a new bookmarks folder.')) 869 'Open a dialog to add a new bookmarks folder.'))
870 self.bookmarksAddFolderAct.setWhatsThis(self.trUtf8( 870 self.bookmarksAddFolderAct.setWhatsThis(self.trUtf8(
871 """<b>Add Folder...</b>""" 871 """<b>Add Folder...</b>"""
872 """<p>Open a dialog to add a new bookmarks folder.</p>""" 872 """<p>Open a dialog to add a new bookmarks folder.</p>"""
873 )) 873 ))
874 if not self.initShortcutsOnly: 874 if not self.initShortcutsOnly:
875 self.bookmarksAddFolderAct.triggered[()].connect( 875 self.bookmarksAddFolderAct.triggered[()].connect(
876 self.__addBookmarkFolder) 876 self.__addBookmarkFolder)
877 self.__actions.append(self.bookmarksAddFolderAct) 877 self.__actions.append(self.bookmarksAddFolderAct)
879 self.bookmarksAllTabsAct = E5Action( 879 self.bookmarksAllTabsAct = E5Action(
880 self.trUtf8('Bookmark All Tabs'), 880 self.trUtf8('Bookmark All Tabs'),
881 self.trUtf8('Bookmark All Tabs...'), 881 self.trUtf8('Bookmark All Tabs...'),
882 0, 0, self, 'help_bookmark_all_tabs') 882 0, 0, self, 'help_bookmark_all_tabs')
883 self.bookmarksAllTabsAct.setStatusTip(self.trUtf8( 883 self.bookmarksAllTabsAct.setStatusTip(self.trUtf8(
884 'Bookmark all open tabs.')) 884 'Bookmark all open tabs.'))
885 self.bookmarksAllTabsAct.setWhatsThis(self.trUtf8( 885 self.bookmarksAllTabsAct.setWhatsThis(self.trUtf8(
886 """<b>Bookmark All Tabs...</b>""" 886 """<b>Bookmark All Tabs...</b>"""
887 """<p>Open a dialog to add a new bookmarks folder for""" 887 """<p>Open a dialog to add a new bookmarks folder for"""
888 """ all open tabs.</p>""" 888 """ all open tabs.</p>"""
889 )) 889 ))
890 if not self.initShortcutsOnly: 890 if not self.initShortcutsOnly:
891 self.bookmarksAllTabsAct.triggered[()].connect(self.bookmarkAll) 891 self.bookmarksAllTabsAct.triggered[()].connect(self.bookmarkAll)
892 self.__actions.append(self.bookmarksAllTabsAct) 892 self.__actions.append(self.bookmarksAllTabsAct)
893 893
929 self.trUtf8('About &Qt'), 929 self.trUtf8('About &Qt'),
930 0, 0, self, 'help_help_about_qt') 930 0, 0, self, 'help_help_about_qt')
931 self.aboutQtAct.setStatusTip( 931 self.aboutQtAct.setStatusTip(
932 self.trUtf8('Display information about the Qt toolkit')) 932 self.trUtf8('Display information about the Qt toolkit'))
933 self.aboutQtAct.setWhatsThis(self.trUtf8( 933 self.aboutQtAct.setWhatsThis(self.trUtf8(
934 """<b>About Qt</b>""" 934 """<b>About Qt</b>"""
935 """<p>Display some information about the Qt toolkit.</p>""" 935 """<p>Display some information about the Qt toolkit.</p>"""
936 )) 936 ))
937 if not self.initShortcutsOnly: 937 if not self.initShortcutsOnly:
938 self.aboutQtAct.triggered[()].connect(self.__aboutQt) 938 self.aboutQtAct.triggered[()].connect(self.__aboutQt)
939 self.__actions.append(self.aboutQtAct) 939 self.__actions.append(self.aboutQtAct)
940 940
945 QKeySequence(self.trUtf8("Ctrl++", "View|Zoom in")), 945 QKeySequence(self.trUtf8("Ctrl++", "View|Zoom in")),
946 QKeySequence(self.trUtf8("Zoom In", "View|Zoom in")), 946 QKeySequence(self.trUtf8("Zoom In", "View|Zoom in")),
947 self, 'help_view_zoom_in') 947 self, 'help_view_zoom_in')
948 self.zoomInAct.setStatusTip(self.trUtf8('Zoom in on the text')) 948 self.zoomInAct.setStatusTip(self.trUtf8('Zoom in on the text'))
949 self.zoomInAct.setWhatsThis(self.trUtf8( 949 self.zoomInAct.setWhatsThis(self.trUtf8(
950 """<b>Zoom in</b>""" 950 """<b>Zoom in</b>"""
951 """<p>Zoom in on the text. This makes the text bigger.</p>""" 951 """<p>Zoom in on the text. This makes the text bigger.</p>"""
952 )) 952 ))
953 if not self.initShortcutsOnly: 953 if not self.initShortcutsOnly:
954 self.zoomInAct.triggered[()].connect(self.__zoomIn) 954 self.zoomInAct.triggered[()].connect(self.__zoomIn)
955 self.__actions.append(self.zoomInAct) 955 self.__actions.append(self.zoomInAct)
956 956
961 QKeySequence(self.trUtf8("Ctrl+-", "View|Zoom out")), 961 QKeySequence(self.trUtf8("Ctrl+-", "View|Zoom out")),
962 QKeySequence(self.trUtf8("Zoom Out", "View|Zoom out")), 962 QKeySequence(self.trUtf8("Zoom Out", "View|Zoom out")),
963 self, 'help_view_zoom_out') 963 self, 'help_view_zoom_out')
964 self.zoomOutAct.setStatusTip(self.trUtf8('Zoom out on the text')) 964 self.zoomOutAct.setStatusTip(self.trUtf8('Zoom out on the text'))
965 self.zoomOutAct.setWhatsThis(self.trUtf8( 965 self.zoomOutAct.setWhatsThis(self.trUtf8(
966 """<b>Zoom out</b>""" 966 """<b>Zoom out</b>"""
967 """<p>Zoom out on the text. This makes the text smaller.</p>""" 967 """<p>Zoom out on the text. This makes the text smaller.</p>"""
968 )) 968 ))
969 if not self.initShortcutsOnly: 969 if not self.initShortcutsOnly:
970 self.zoomOutAct.triggered[()].connect(self.__zoomOut) 970 self.zoomOutAct.triggered[()].connect(self.__zoomOut)
971 self.__actions.append(self.zoomOutAct) 971 self.__actions.append(self.zoomOutAct)
972 972
992 self.trUtf8('Zoom text only'), 992 self.trUtf8('Zoom text only'),
993 self.trUtf8('Zoom &text only'), 993 self.trUtf8('Zoom &text only'),
994 0, 0, self, 'help_view_zoom_text_only') 994 0, 0, self, 'help_view_zoom_text_only')
995 self.zoomTextOnlyAct.setCheckable(True) 995 self.zoomTextOnlyAct.setCheckable(True)
996 self.zoomTextOnlyAct.setStatusTip(self.trUtf8( 996 self.zoomTextOnlyAct.setStatusTip(self.trUtf8(
997 'Zoom text only; pictures remain constant')) 997 'Zoom text only; pictures remain constant'))
998 self.zoomTextOnlyAct.setWhatsThis(self.trUtf8( 998 self.zoomTextOnlyAct.setWhatsThis(self.trUtf8(
999 """<b>Zoom text only</b>""" 999 """<b>Zoom text only</b>"""
1000 """<p>Zoom text only; pictures remain constant.</p>""" 1000 """<p>Zoom text only; pictures remain constant.</p>"""
1001 )) 1001 ))
1002 if not self.initShortcutsOnly: 1002 if not self.initShortcutsOnly:
1003 self.zoomTextOnlyAct.triggered[bool].connect( 1003 self.zoomTextOnlyAct.triggered[bool].connect(
1004 self.__zoomTextOnly) 1004 self.__zoomTextOnly)
1005 self.__actions.append(self.zoomTextOnlyAct) 1005 self.__actions.append(self.zoomTextOnlyAct)
1184 self.trUtf8('Sync with Table of Contents'), 1184 self.trUtf8('Sync with Table of Contents'),
1185 UI.PixmapCache.getIcon("syncToc.png"), 1185 UI.PixmapCache.getIcon("syncToc.png"),
1186 self.trUtf8('Sync with Table of Contents'), 1186 self.trUtf8('Sync with Table of Contents'),
1187 0, 0, self, 'help_sync_toc') 1187 0, 0, self, 'help_sync_toc')
1188 self.syncTocAct.setStatusTip(self.trUtf8( 1188 self.syncTocAct.setStatusTip(self.trUtf8(
1189 'Synchronizes the table of contents with current page')) 1189 'Synchronizes the table of contents with current page'))
1190 self.syncTocAct.setWhatsThis(self.trUtf8( 1190 self.syncTocAct.setWhatsThis(self.trUtf8(
1191 """<b>Sync with Table of Contents</b>""" 1191 """<b>Sync with Table of Contents</b>"""
1192 """<p>Synchronizes the table of contents with current""" 1192 """<p>Synchronizes the table of contents with current"""
1193 """ page.</p>""" 1193 """ page.</p>"""
1194 )) 1194 ))
1199 self.showTocAct = E5Action( 1199 self.showTocAct = E5Action(
1200 self.trUtf8('Table of Contents'), 1200 self.trUtf8('Table of Contents'),
1201 self.trUtf8('Table of Contents'), 1201 self.trUtf8('Table of Contents'),
1202 0, 0, self, 'help_show_toc') 1202 0, 0, self, 'help_show_toc')
1203 self.showTocAct.setStatusTip(self.trUtf8( 1203 self.showTocAct.setStatusTip(self.trUtf8(
1204 'Shows the table of contents window')) 1204 'Shows the table of contents window'))
1205 self.showTocAct.setWhatsThis(self.trUtf8( 1205 self.showTocAct.setWhatsThis(self.trUtf8(
1206 """<b>Table of Contents</b>""" 1206 """<b>Table of Contents</b>"""
1207 """<p>Shows the table of contents window.</p>""" 1207 """<p>Shows the table of contents window.</p>"""
1208 )) 1208 ))
1209 if not self.initShortcutsOnly: 1209 if not self.initShortcutsOnly:
1210 self.showTocAct.triggered[()].connect(self.__showTocWindow) 1210 self.showTocAct.triggered[()].connect(self.__showTocWindow)
1211 self.__actions.append(self.showTocAct) 1211 self.__actions.append(self.showTocAct)
1212 1212
1213 self.showIndexAct = E5Action( 1213 self.showIndexAct = E5Action(
1214 self.trUtf8('Index'), 1214 self.trUtf8('Index'),
1215 self.trUtf8('Index'), 1215 self.trUtf8('Index'),
1216 0, 0, self, 'help_show_index') 1216 0, 0, self, 'help_show_index')
1217 self.showIndexAct.setStatusTip(self.trUtf8( 1217 self.showIndexAct.setStatusTip(self.trUtf8(
1218 'Shows the index window')) 1218 'Shows the index window'))
1219 self.showIndexAct.setWhatsThis(self.trUtf8( 1219 self.showIndexAct.setWhatsThis(self.trUtf8(
1220 """<b>Index</b>""" 1220 """<b>Index</b>"""
1221 """<p>Shows the index window.</p>""" 1221 """<p>Shows the index window.</p>"""
1222 )) 1222 ))
1223 if not self.initShortcutsOnly: 1223 if not self.initShortcutsOnly:
1224 self.showIndexAct.triggered[()].connect(self.__showIndexWindow) 1224 self.showIndexAct.triggered[()].connect(self.__showIndexWindow)
1225 self.__actions.append(self.showIndexAct) 1225 self.__actions.append(self.showIndexAct)
1226 1226
1227 self.showSearchAct = E5Action( 1227 self.showSearchAct = E5Action(
1228 self.trUtf8('Search'), 1228 self.trUtf8('Search'),
1229 self.trUtf8('Search'), 1229 self.trUtf8('Search'),
1230 0, 0, self, 'help_show_search') 1230 0, 0, self, 'help_show_search')
1231 self.showSearchAct.setStatusTip(self.trUtf8( 1231 self.showSearchAct.setStatusTip(self.trUtf8(
1232 'Shows the search window')) 1232 'Shows the search window'))
1233 self.showSearchAct.setWhatsThis(self.trUtf8( 1233 self.showSearchAct.setWhatsThis(self.trUtf8(
1234 """<b>Search</b>""" 1234 """<b>Search</b>"""
1235 """<p>Shows the search window.</p>""" 1235 """<p>Shows the search window.</p>"""
1236 )) 1236 ))
1237 if not self.initShortcutsOnly: 1237 if not self.initShortcutsOnly:
1238 self.showSearchAct.triggered[()].connect( 1238 self.showSearchAct.triggered[()].connect(
1239 self.__showSearchWindow) 1239 self.__showSearchWindow)
1240 self.__actions.append(self.showSearchAct) 1240 self.__actions.append(self.showSearchAct)
1258 self.manageQtHelpFiltersAct = E5Action( 1258 self.manageQtHelpFiltersAct = E5Action(
1259 self.trUtf8('Manage QtHelp Filters'), 1259 self.trUtf8('Manage QtHelp Filters'),
1260 self.trUtf8('Manage QtHelp &Filters'), 1260 self.trUtf8('Manage QtHelp &Filters'),
1261 0, 0, self, 'help_qthelp_filters') 1261 0, 0, self, 'help_qthelp_filters')
1262 self.manageQtHelpFiltersAct.setStatusTip(self.trUtf8( 1262 self.manageQtHelpFiltersAct.setStatusTip(self.trUtf8(
1263 'Shows a dialog to manage the QtHelp filters')) 1263 'Shows a dialog to manage the QtHelp filters'))
1264 self.manageQtHelpFiltersAct.setWhatsThis(self.trUtf8( 1264 self.manageQtHelpFiltersAct.setWhatsThis(self.trUtf8(
1265 """<b>Manage QtHelp Filters</b>""" 1265 """<b>Manage QtHelp Filters</b>"""
1266 """<p>Shows a dialog to manage the QtHelp filters.</p>""" 1266 """<p>Shows a dialog to manage the QtHelp filters.</p>"""
1267 )) 1267 ))
1268 if not self.initShortcutsOnly: 1268 if not self.initShortcutsOnly:
1269 self.manageQtHelpFiltersAct.triggered[()].connect( 1269 self.manageQtHelpFiltersAct.triggered[()].connect(
1270 self.__manageQtHelpFilters) 1270 self.__manageQtHelpFilters)
1271 self.__actions.append(self.manageQtHelpFiltersAct) 1271 self.__actions.append(self.manageQtHelpFiltersAct)
1273 self.reindexDocumentationAct = E5Action( 1273 self.reindexDocumentationAct = E5Action(
1274 self.trUtf8('Reindex Documentation'), 1274 self.trUtf8('Reindex Documentation'),
1275 self.trUtf8('&Reindex Documentation'), 1275 self.trUtf8('&Reindex Documentation'),
1276 0, 0, self, 'help_qthelp_reindex') 1276 0, 0, self, 'help_qthelp_reindex')
1277 self.reindexDocumentationAct.setStatusTip(self.trUtf8( 1277 self.reindexDocumentationAct.setStatusTip(self.trUtf8(
1278 'Reindexes the documentation set')) 1278 'Reindexes the documentation set'))
1279 self.reindexDocumentationAct.setWhatsThis(self.trUtf8( 1279 self.reindexDocumentationAct.setWhatsThis(self.trUtf8(
1280 """<b>Reindex Documentation</b>""" 1280 """<b>Reindex Documentation</b>"""
1281 """<p>Reindexes the documentation set.</p>""" 1281 """<p>Reindexes the documentation set.</p>"""
1282 )) 1282 ))
1283 if not self.initShortcutsOnly: 1283 if not self.initShortcutsOnly:
1284 self.reindexDocumentationAct.triggered[()].connect( 1284 self.reindexDocumentationAct.triggered[()].connect(
1285 self.__searchEngine.reindexDocumentation) 1285 self.__searchEngine.reindexDocumentation)
1286 self.__actions.append(self.reindexDocumentationAct) 1286 self.__actions.append(self.reindexDocumentationAct)
1340 UI.PixmapCache.getIcon("passwords.png"), 1340 UI.PixmapCache.getIcon("passwords.png"),
1341 self.trUtf8('Manage Saved Passwords...'), 1341 self.trUtf8('Manage Saved Passwords...'),
1342 0, 0, 1342 0, 0,
1343 self, 'help_manage_passwords') 1343 self, 'help_manage_passwords')
1344 self.passwordsAct.setStatusTip(self.trUtf8( 1344 self.passwordsAct.setStatusTip(self.trUtf8(
1345 'Manage the saved passwords')) 1345 'Manage the saved passwords'))
1346 self.passwordsAct.setWhatsThis(self.trUtf8( 1346 self.passwordsAct.setWhatsThis(self.trUtf8(
1347 """<b>Manage Saved Passwords...</b>""" 1347 """<b>Manage Saved Passwords...</b>"""
1348 """<p>Opens a dialog to manage the saved passwords.</p>""" 1348 """<p>Opens a dialog to manage the saved passwords.</p>"""
1349 )) 1349 ))
1350 if not self.initShortcutsOnly: 1350 if not self.initShortcutsOnly:
1351 self.passwordsAct.triggered[()].connect(self.__showPasswordsDialog) 1351 self.passwordsAct.triggered[()].connect(self.__showPasswordsDialog)
1352 self.__actions.append(self.passwordsAct) 1352 self.__actions.append(self.passwordsAct)
1353 1353
1424 self.showDownloadManagerAct = E5Action( 1424 self.showDownloadManagerAct = E5Action(
1425 self.trUtf8('Downloads'), 1425 self.trUtf8('Downloads'),
1426 self.trUtf8('Downloads'), 1426 self.trUtf8('Downloads'),
1427 0, 0, self, 'help_show_downloads') 1427 0, 0, self, 'help_show_downloads')
1428 self.showDownloadManagerAct.setStatusTip(self.trUtf8( 1428 self.showDownloadManagerAct.setStatusTip(self.trUtf8(
1429 'Shows the downloads window')) 1429 'Shows the downloads window'))
1430 self.showDownloadManagerAct.setWhatsThis(self.trUtf8( 1430 self.showDownloadManagerAct.setWhatsThis(self.trUtf8(
1431 """<b>Downloads</b>""" 1431 """<b>Downloads</b>"""
1432 """<p>Shows the downloads window.</p>""" 1432 """<p>Shows the downloads window.</p>"""
1433 )) 1433 ))
1434 if not self.initShortcutsOnly: 1434 if not self.initShortcutsOnly:
1435 self.showDownloadManagerAct.triggered[()].connect( 1435 self.showDownloadManagerAct.triggered[()].connect(
1436 self.__showDownloadsWindow) 1436 self.__showDownloadsWindow)
1437 self.__actions.append(self.showDownloadManagerAct) 1437 self.__actions.append(self.showDownloadManagerAct)
1474 self.userAgentManagerAct = E5Action( 1474 self.userAgentManagerAct = E5Action(
1475 self.trUtf8('Manage User Agent Settings'), 1475 self.trUtf8('Manage User Agent Settings'),
1476 self.trUtf8('Manage &User Agent Settings'), 1476 self.trUtf8('Manage &User Agent Settings'),
1477 0, 0, self, 'help_user_agent_settings') 1477 0, 0, self, 'help_user_agent_settings')
1478 self.userAgentManagerAct.setStatusTip(self.trUtf8( 1478 self.userAgentManagerAct.setStatusTip(self.trUtf8(
1479 'Shows a dialog to manage the User Agent settings')) 1479 'Shows a dialog to manage the User Agent settings'))
1480 self.userAgentManagerAct.setWhatsThis(self.trUtf8( 1480 self.userAgentManagerAct.setWhatsThis(self.trUtf8(
1481 """<b>Manage User Agent Settings</b>""" 1481 """<b>Manage User Agent Settings</b>"""
1482 """<p>Shows a dialog to manage the User Agent settings.</p>""" 1482 """<p>Shows a dialog to manage the User Agent settings.</p>"""
1483 )) 1483 ))
1484 if not self.initShortcutsOnly: 1484 if not self.initShortcutsOnly:
1485 self.userAgentManagerAct.triggered[()].connect( 1485 self.userAgentManagerAct.triggered[()].connect(
1486 self.__showUserAgentsDialog) 1486 self.__showUserAgentsDialog)
1487 self.__actions.append(self.userAgentManagerAct) 1487 self.__actions.append(self.userAgentManagerAct)
1989 "", 1989 "",
1990 self.trUtf8("Help Files (*.html *.htm);;" 1990 self.trUtf8("Help Files (*.html *.htm);;"
1991 "PDF Files (*.pdf);;" 1991 "PDF Files (*.pdf);;"
1992 "CHM Files (*.chm);;" 1992 "CHM Files (*.chm);;"
1993 "All Files (*)" 1993 "All Files (*)"
1994 )) 1994 ))
1995 if fn: 1995 if fn:
1996 if Utilities.isWindowsPlatform(): 1996 if Utilities.isWindowsPlatform():
1997 url = "file:///" + Utilities.fromNativeSeparators(fn) 1997 url = "file:///" + Utilities.fromNativeSeparators(fn)
1998 else: 1998 else:
1999 url = "file://" + fn 1999 url = "file://" + fn
2009 "", 2009 "",
2010 self.trUtf8("Help Files (*.html *.htm);;" 2010 self.trUtf8("Help Files (*.html *.htm);;"
2011 "PDF Files (*.pdf);;" 2011 "PDF Files (*.pdf);;"
2012 "CHM Files (*.chm);;" 2012 "CHM Files (*.chm);;"
2013 "All Files (*)" 2013 "All Files (*)"
2014 )) 2014 ))
2015 if fn: 2015 if fn:
2016 if Utilities.isWindowsPlatform(): 2016 if Utilities.isWindowsPlatform():
2017 url = "file:///" + Utilities.fromNativeSeparators(fn) 2017 url = "file:///" + Utilities.fromNativeSeparators(fn)
2018 else: 2018 else:
2019 url = "file://" + fn 2019 url = "file://" + fn
3571 Private slot to react upon changes of the VirusTotal search text. 3571 Private slot to react upon changes of the VirusTotal search text.
3572 3572
3573 @param txt contents of the search (string) 3573 @param txt contents of the search (string)
3574 """ 3574 """
3575 self.virustotalSearchAct.setEnabled( 3575 self.virustotalSearchAct.setEnabled(
3576 txt != "" and \ 3576 txt != "" and
3577 Preferences.getHelp("VirusTotalEnabled") and \ 3577 Preferences.getHelp("VirusTotalEnabled") and
3578 Preferences.getHelp("VirusTotalServiceKey") != "") 3578 Preferences.getHelp("VirusTotalServiceKey") != "")
3579 3579
3580 def __virusTotalSearch(self): 3580 def __virusTotalSearch(self):
3581 """ 3581 """
3582 Private slot to search VirusTotal for a given entry. 3582 Private slot to search VirusTotal for a given entry.
3648 3648
3649 @param styleSheetFile name of the user style sheet file (string) 3649 @param styleSheetFile name of the user style sheet file (string)
3650 @return style sheet (QUrl) 3650 @return style sheet (QUrl)
3651 """ 3651 """
3652 userStyle = self.adBlockManager().elementHidingRules() + \ 3652 userStyle = self.adBlockManager().elementHidingRules() + \
3653 "{display:none !important;}" 3653 "{display:none !important;}"
3654 3654
3655 if styleSheetFile: 3655 if styleSheetFile:
3656 try: 3656 try:
3657 f = open(styleSheetFile, "r") 3657 f = open(styleSheetFile, "r")
3658 fileData = f.read() 3658 fileData = f.read()

eric ide

mercurial