fileHandle = open("config", "w")
- for x in self.configElements:
+ keys = self.configElements.keys()
+ keys.sort()
+ for x in keys:
wstr = x + "=" + self.configElements[x]
if wstr[len(wstr) - 1] != '\n':
self.markedPos = 0
def checkValues(self):
- maxPos = len(self.parent.value) * self.parent.vals[1]
- print maxPos
+ maxPos = len(self.parent.value) * len(self.parent.vals[1]) + len(self.parent.value)
if self.markedPos >= maxPos:
self.markedPos = maxPos - 1
#is this right? activate settings after load/cancel and use default
self.change()
- def __init__(self, configPath, control, defaultValue, vals, shouldSave = True):
+ def __init__(self, configPath, control, defaultValue, vals):
self.configPath = configPath
self.defaultValue = defaultValue
self.controlType = control
self.vals = vals
self.notifierList = [ ]
self.enabled = True
- self.shouldSave = shouldSave
self.loadData()
def addNotifier(self, notifier):
self.notifierList.append(notifier);
def reload(self):
self.loadData()
def save(self):
- if (self.shouldSave == True):
- configfile.setKey(self.configPath, self.datatoFile(self.controlType,self.value))
+ configfile.setKey(self.configPath, self.datatoFile(self.controlType,self.value))
+class configElement_nonSave(configElement):
+ def __init__(self, configPath, control, defaultValue, vals):
+ configElement.__init__(self, configPath, control, defaultValue, vals)
+
+ def save(self):
+ pass
+
def getConfigListEntry(description, element):
b = element
item = b.controlType(b)