Helpviewer/HelpWindow.py

changeset 2697
1cd7fa670b05
parent 2411
aec0a8a6e548
child 2791
a9577f248f04
child 2804
a331371462a3
equal deleted inserted replaced
2696:c25359355787 2697:1cd7fa670b05
28 from .data import icons_rc # __IGNORE_WARNING__ 28 from .data import icons_rc # __IGNORE_WARNING__
29 from .data import html_rc # __IGNORE_WARNING__ 29 from .data import html_rc # __IGNORE_WARNING__
30 from .data import javascript_rc # __IGNORE_WARNING__ 30 from .data import javascript_rc # __IGNORE_WARNING__
31 31
32 from E5Gui.E5Action import E5Action 32 from E5Gui.E5Action import E5Action
33 from E5Gui import E5MessageBox, E5FileDialog 33 from E5Gui import E5MessageBox, E5FileDialog, E5ErrorMessage
34 from E5Gui.E5MainWindow import E5MainWindow 34 from E5Gui.E5MainWindow import E5MainWindow
35 from E5Gui.E5Application import e5App 35 from E5Gui.E5Application import e5App
36 from E5Gui.E5ZoomWidget import E5ZoomWidget 36 from E5Gui.E5ZoomWidget import E5ZoomWidget
37 37
38 import Preferences 38 import Preferences
1023 if not self.initShortcutsOnly: 1023 if not self.initShortcutsOnly:
1024 self.greaseMonkeyAct.triggered[()].connect( 1024 self.greaseMonkeyAct.triggered[()].connect(
1025 self.__showGreaseMonkeyConfigDialog) 1025 self.__showGreaseMonkeyConfigDialog)
1026 self.__actions.append(self.greaseMonkeyAct) 1026 self.__actions.append(self.greaseMonkeyAct)
1027 1027
1028 self.editMessageFilterAct = E5Action(self.trUtf8('Edit Message Filters'),
1029 UI.PixmapCache.getIcon("warning.png"),
1030 self.trUtf8('Edit Message Filters...'), 0, 0, self,
1031 'help_manage_message_filters')
1032 self.editMessageFilterAct.setStatusTip(self.trUtf8(
1033 'Edit the message filters used to suppress unwanted messages'))
1034 self.editMessageFilterAct.setWhatsThis(self.trUtf8(
1035 """<b>Edit Message Filters</b>"""
1036 """<p>Opens a dialog to edit the message filters used to suppress"""
1037 """ unwanted messages been shown in an error window.</p>"""
1038 ))
1039 if not self.initShortcutsOnly:
1040 self.editMessageFilterAct.triggered[()].connect(
1041 E5ErrorMessage.editMessageFilters)
1042 self.__actions.append(self.editMessageFilterAct)
1043
1028 if self.useQtHelp or self.initShortcutsOnly: 1044 if self.useQtHelp or self.initShortcutsOnly:
1029 self.syncTocAct = E5Action(self.trUtf8('Sync with Table of Contents'), 1045 self.syncTocAct = E5Action(self.trUtf8('Sync with Table of Contents'),
1030 UI.PixmapCache.getIcon("syncToc.png"), 1046 UI.PixmapCache.getIcon("syncToc.png"),
1031 self.trUtf8('Sync with Table of Contents'), 1047 self.trUtf8('Sync with Table of Contents'),
1032 0, 0, self, 'help_sync_toc') 1048 0, 0, self, 'help_sync_toc')
1421 menu.addAction(self.cookiesAct) 1437 menu.addAction(self.cookiesAct)
1422 menu.addAction(self.offlineStorageAct) 1438 menu.addAction(self.offlineStorageAct)
1423 menu.addAction(self.personalDataAct) 1439 menu.addAction(self.personalDataAct)
1424 menu.addAction(self.greaseMonkeyAct) 1440 menu.addAction(self.greaseMonkeyAct)
1425 menu.addSeparator() 1441 menu.addSeparator()
1442 menu.addAction(self.editMessageFilterAct)
1443 menu.addSeparator()
1426 menu.addAction(self.searchEnginesAct) 1444 menu.addAction(self.searchEnginesAct)
1427 menu.addSeparator() 1445 menu.addSeparator()
1428 menu.addAction(self.passwordsAct) 1446 menu.addAction(self.passwordsAct)
1429 if SSL_AVAILABLE: 1447 if SSL_AVAILABLE:
1430 menu.addAction(self.certificatesAct) 1448 menu.addAction(self.certificatesAct)
1431 menu.addSeparator() 1449 menu.addSeparator()
1432 menu.addAction(self.adblockAct) 1450 menu.addAction(self.adblockAct)
1433 menu.addAction(self.flashblockAct) 1451 menu.addAction(self.flashblockAct)
1434 menu.addSeparator() 1452 menu.addSeparator()
1453 self.__settingsMenu = menu
1454 self.__settingsMenu.aboutToShow.connect(
1455 self.__aboutToShowSettingsMenu)
1435 1456
1436 from .UserAgent.UserAgentMenu import UserAgentMenu 1457 from .UserAgent.UserAgentMenu import UserAgentMenu
1437 self.__userAgentMenu = UserAgentMenu(self.trUtf8("Global User Agent")) 1458 self.__userAgentMenu = UserAgentMenu(self.trUtf8("Global User Agent"))
1438 menu.addMenu(self.__userAgentMenu) 1459 menu.addMenu(self.__userAgentMenu)
1439 menu.addAction(self.userAgentManagerAct) 1460 menu.addAction(self.userAgentManagerAct)
2638 @param msg message sent by the help engine (string) 2659 @param msg message sent by the help engine (string)
2639 """ 2660 """
2640 E5MessageBox.warning(self, 2661 E5MessageBox.warning(self,
2641 self.trUtf8("Help Engine"), msg) 2662 self.trUtf8("Help Engine"), msg)
2642 2663
2664 def __aboutToShowSettingsMenu(self):
2665 """
2666 Private slot to show the Settings menu.
2667 """
2668 self.editMessageFilterAct.setEnabled(E5ErrorMessage.messageHandlerInstalled())
2669
2643 def __showBackMenu(self): 2670 def __showBackMenu(self):
2644 """ 2671 """
2645 Private slot showing the backwards navigation menu. 2672 Private slot showing the backwards navigation menu.
2646 """ 2673 """
2647 self.backMenu.clear() 2674 self.backMenu.clear()

eric ide

mercurial