Helpviewer/HelpWindow.py

changeset 4355
40ec6bef4c22
parent 4341
1ff0929aab09
child 4359
ac1dda9f3f19
diff -r bc2b247a75df -r 40ec6bef4c22 Helpviewer/HelpWindow.py
--- a/Helpviewer/HelpWindow.py	Wed Aug 05 19:52:39 2015 +0200
+++ b/Helpviewer/HelpWindow.py	Thu Aug 06 19:01:39 2015 +0200
@@ -88,6 +88,7 @@
     _personalInformationManager = None
     _greaseMonkeyManager = None
     _notification = None
+    _featurePermissionManager = None
     
     def __init__(self, home, path, parent, name, fromEric=False,
                  initShortcutsOnly=False, searchWord=None):
@@ -1195,6 +1196,23 @@
                 E5ErrorMessage.editMessageFilters)
         self.__actions.append(self.editMessageFilterAct)
 
+        self.featurePermissionAct = E5Action(
+            self.tr('Edit HTML5 Feature Permissions'),
+            UI.PixmapCache.getIcon("featurePermission.png"),
+            self.tr('Edit HTML5 Feature Permissions...'), 0, 0, self,
+            'help_edit_feature_permissions')
+        self.featurePermissionAct.setStatusTip(self.tr(
+            'Edit the remembered HTML5 feature permissions'))
+        self.featurePermissionAct.setWhatsThis(self.tr(
+            """<b>Edit HTML5 Feature Permissions</b>"""
+            """<p>Opens a dialog to edit the remembered HTML5"""
+            """ feature permissions.</p>"""
+        ))
+        if not self.initShortcutsOnly:
+            self.featurePermissionAct.triggered.connect(
+                self.__showFeaturePermissionDialog)
+        self.__actions.append(self.featurePermissionAct)
+
         if self.useQtHelp or self.initShortcutsOnly:
             self.syncTocAct = E5Action(
                 self.tr('Sync with Table of Contents'),
@@ -1632,6 +1650,7 @@
         menu.addAction(self.offlineStorageAct)
         menu.addAction(self.personalDataAct)
         menu.addAction(self.greaseMonkeyAct)
+        menu.addAction(self.featurePermissionAct)
         menu.addSeparator()
         menu.addAction(self.editMessageFilterAct)
         menu.addSeparator()
@@ -1761,6 +1780,7 @@
         settingstb.addAction(self.offlineStorageAct)
         settingstb.addAction(self.personalDataAct)
         settingstb.addAction(self.greaseMonkeyAct)
+        settingstb.addAction(self.featurePermissionAct)
         
         toolstb = self.addToolBar(self.tr("Tools"))
         toolstb.setObjectName("ToolsToolBar")
@@ -3051,6 +3071,12 @@
         """
         self.greaseMonkeyManager().showConfigurationDialog()
         
+    def __showFeaturePermissionDialog(self):
+        """
+        Private slot to show the feature permission dialog.
+        """
+        self.featurePermissionManager().showFeaturePermissionsDialog()
+        
     def __showNetworkMonitor(self):
         """
         Private slot to show the network monitor dialog.
@@ -3260,6 +3286,21 @@
         return cls._greaseMonkeyManager
         
     @classmethod
+    def featurePermissionManager(cls):
+        """
+        Class method to get a reference to the feature permission manager.
+        
+        @return reference to the feature permission manager
+        @rtype FeaturePermissionManager
+        """
+        if cls._featurePermissionManager is None:
+            from .FeaturePermissions.FeaturePermissionManager import \
+                FeaturePermissionManager
+            cls._featurePermissionManager = FeaturePermissionManager()
+        
+        return cls._featurePermissionManager
+        
+    @classmethod
     def mainWindow(cls):
         """
         Class method to get a reference to the main window.

eric ide

mercurial