Preferences/__init__.py

changeset 5968
c5112b5cb7a9
parent 5964
066e6c78a367
child 5970
411f7ba577d5
--- a/Preferences/__init__.py	Sat Nov 11 18:47:09 2017 +0100
+++ b/Preferences/__init__.py	Sun Nov 12 19:42:02 2017 +0100
@@ -53,7 +53,7 @@
 
 from Project.ProjectBrowserFlags import SourcesBrowserFlag, FormsBrowserFlag, \
     ResourcesBrowserFlag, TranslationsBrowserFlag, InterfacesBrowserFlag, \
-    OthersBrowserFlag, AllBrowsersFlag
+    OthersBrowserFlag, ProtocolsBrowserFlag, AllBrowsersFlag
 
 try:
     from Helpviewer.FlashCookieManager.FlashCookieUtilities import \
@@ -780,54 +780,63 @@
             ResourcesBrowserFlag |
             TranslationsBrowserFlag |
             InterfacesBrowserFlag |
-            OthersBrowserFlag),
+            OthersBrowserFlag |
+            ProtocolsBrowserFlag),
         "Qt4C": (
             SourcesBrowserFlag |
             ResourcesBrowserFlag |
             TranslationsBrowserFlag |
             InterfacesBrowserFlag |
-            OthersBrowserFlag),
+            OthersBrowserFlag |
+            ProtocolsBrowserFlag),
         "PyQt5": (
             SourcesBrowserFlag |
             FormsBrowserFlag |
             ResourcesBrowserFlag |
             TranslationsBrowserFlag |
             InterfacesBrowserFlag |
-            OthersBrowserFlag),
+            OthersBrowserFlag |
+            ProtocolsBrowserFlag),
         "PyQt5C": (
             SourcesBrowserFlag |
             ResourcesBrowserFlag |
             TranslationsBrowserFlag |
             InterfacesBrowserFlag |
-            OthersBrowserFlag),
+            OthersBrowserFlag |
+            ProtocolsBrowserFlag),
         "E6Plugin": (
             SourcesBrowserFlag |
             FormsBrowserFlag |
             ResourcesBrowserFlag |
             TranslationsBrowserFlag |
             InterfacesBrowserFlag |
-            OthersBrowserFlag),
+            OthersBrowserFlag |
+            ProtocolsBrowserFlag),
         "Console": (
             SourcesBrowserFlag |
             InterfacesBrowserFlag |
-            OthersBrowserFlag),
+            OthersBrowserFlag |
+            ProtocolsBrowserFlag),
         "Other": (
             SourcesBrowserFlag |
             InterfacesBrowserFlag |
-            OthersBrowserFlag),
+            OthersBrowserFlag |
+            ProtocolsBrowserFlag),
         "PySide": (
             SourcesBrowserFlag |
             FormsBrowserFlag |
             ResourcesBrowserFlag |
             TranslationsBrowserFlag |
             InterfacesBrowserFlag |
-            OthersBrowserFlag),
+            OthersBrowserFlag |
+            ProtocolsBrowserFlag),
         "PySideC": (
             SourcesBrowserFlag |
             ResourcesBrowserFlag |
             TranslationsBrowserFlag |
             InterfacesBrowserFlag |
-            OthersBrowserFlag),
+            OthersBrowserFlag |
+            ProtocolsBrowserFlag),
     }
     
     # defaults for the project browser colour settings
@@ -1270,7 +1279,12 @@
     
     # defaults for corba related stuff
     corbaDefaults = {
-        "omniidl": "omniidl"
+        "omniidl": ""
+    }
+    
+    # defaults for protobuf related stuff
+    protobufDefaults = {
+        "protoc": ""
     }
     
     # defaults for user related stuff
@@ -3139,7 +3153,7 @@
 
 def getCorba(key, prefClass=Prefs):
     """
-    Module function to retrieve the various corba settings.
+    Module function to retrieve the various Corba settings.
     
     @param key the key of the value to get
     @param prefClass preferences class used as the storage area
@@ -3151,7 +3165,7 @@
 
 def setCorba(key, value, prefClass=Prefs):
     """
-    Module function to store the various corba settings.
+    Module function to store the various Corba settings.
     
     @param key the key of the setting to be set
     @param value the value to be set
@@ -3160,6 +3174,35 @@
     prefClass.settings.setValue("Corba/" + key, value)
     
 
+def getProtobuf(key, prefClass=Prefs):
+    """
+    Module function to retrieve the various protobuf settings.
+    
+    @param key the key of the value to get
+    @type str
+    @param prefClass preferences class used as the storage area
+    @type Prefs
+    @return the requested protobuf setting
+    @rtype any
+    """
+    return prefClass.settings.value(
+        "Protobuf/" + key, prefClass.protobufDefaults[key])
+    
+
+def setProtobuf(key, value, prefClass=Prefs):
+    """
+    Module function to store the various protobuf settings.
+    
+    @param key the key of the setting to be set
+    @type str
+    @param value the value to be set
+    @type any
+    @param prefClass preferences class used as the storage area
+    @type Prefs
+    """
+    prefClass.settings.setValue("Protobuf/" + key, value)
+    
+
 def getUser(key, prefClass=Prefs):
     """
     Module function to retrieve the various user settings.

eric ide

mercurial