Preferences/__init__.py

changeset 4655
f2f0abd5bc94
parent 4650
b1ca3bcde70b
child 4658
d760763dcc4a
diff -r 9dafe6905667 -r f2f0abd5bc94 Preferences/__init__.py
--- a/Preferences/__init__.py	Sun Jan 10 17:16:20 2016 +0100
+++ b/Preferences/__init__.py	Sun Jan 10 18:03:35 2016 +0100
@@ -1188,6 +1188,11 @@
         
         "AskOnShutdown": True,
     }
+    
+    # defaults for Hex Editor
+    hexEditorDefaults = {
+        "HexEditorState": QByteArray(),
+    }
 
 
 def readToolGroups(prefClass=Prefs):
@@ -2942,6 +2947,29 @@
     @param prefClass preferences class used as the storage area
     """
     prefClass.settings.setValue("IRC/" + key, value)
+    
+
+def getHexEditor(key, prefClass=Prefs):
+    """
+    Module function to retrieve the Hex Editor related settings.
+    
+    @param key the key of the value to get
+    @param prefClass preferences class used as the storage area
+    @return the requested user setting
+    """
+    return prefClass.settings.value(
+        "HexEditor/" + key, prefClass.hexEditorDefaults[key])
+    
+
+def setHexEditor(key, value, prefClass=Prefs):
+    """
+    Module function to store the Hex Editor related settings.
+    
+    @param key the key of the setting to be set
+    @param value the value to be set
+    @param prefClass preferences class used as the storage area
+    """
+    prefClass.settings.setValue("HexEditor/" + key, value)
 
 
 def getGeometry(key, prefClass=Prefs):

eric ide

mercurial