summaryrefslogtreecommitdiff
path: root/src/ui.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui.py')
-rw-r--r--src/ui.py33
1 files changed, 24 insertions, 9 deletions
diff --git a/src/ui.py b/src/ui.py
index 9327bd1..6106e2a 100644
--- a/src/ui.py
+++ b/src/ui.py
@@ -751,18 +751,31 @@ class KPMainWindow(QtGui.QMainWindow):
loaded = mapfile.load(data)
file.close()
+ print loaded
settings = KP.app.settings
+ presetList = []
+ presets = []
+
if settings.contains('AnimationPresets'):
- presetList = list(settings.value('AnimationPresets').toPyObject())
- presets = list(settings.value('AnimationPresetData').toPyObject())
+ presetList = mapfile.load(str(settings.value('AnimationPresets').toPyObject()))
+ presets = mapfile.load(str(settings.value('AnimationPresetData').toPyObject()))
- else:
+ if presetList == None:
presetList = []
presets = []
+
+ print presetList, presets
+ print dir(presetList)
+
+ presetList.extend(loaded[0])
+ presets.extend(loaded[1])
- settings.setValue('AnimationPresets', presetList.extend(loaded[0]))
- settings.setValue('AnimationPresetData', presets.extend(loaded[1]))
+ print presetList
+ print presets
+
+ settings.setValue('AnimationPresets', mapfile.dump(presetList))
+ settings.setValue('AnimationPresetData', mapfile.dump(presets))
@@ -770,13 +783,14 @@ class KPMainWindow(QtGui.QMainWindow):
def saveAnimPresets(self):
settings = KP.app.settings
+ import mapfile
msg = QtGui.QMessageBox()
msg.setText("No Animation Presets Found.")
if settings.contains('AnimationPresets'):
- presetList = list(settings.value('AnimationPresets').toPyObject())
- presets = list(settings.value('AnimationPresetData').toPyObject())
+ presetList = mapfile.load(str(settings.value('AnimationPresets').toPyObject()))
+ presets = mapfile.load(str(settings.value('AnimationPresetData').toPyObject()))
else:
msg._exec()
return
@@ -802,9 +816,10 @@ class KPMainWindow(QtGui.QMainWindow):
@QtCore.pyqtSlot()
def clearAnimPresets(self):
settings = KP.app.settings
+ import mapfile
- settings.setValue('AnimationPresets', [])
- settings.setValue('AnimationPresetData', [])
+ settings.setValue('AnimationPresets', mapfile.dump([]))
+ settings.setValue('AnimationPresetData', mapfile.dump([]))
# Window