Added support for saving/loading 'animate' option.
authorStefanos Harhalakis <v13@v13.gr>
Tue, 3 Aug 2010 21:03:02 +0000 (21:03 +0000)
committerStefanos Harhalakis <v13@v13.gr>
Tue, 3 Aug 2010 21:03:02 +0000 (21:03 +0000)
src/config.py

index 0ed4157..3234967 100755 (executable)
@@ -122,7 +122,7 @@ class Config:
 
        if dt==None:
            dt={
-               'version':  3,
+               'version':  4,
                'data': {},
                }
 
@@ -167,6 +167,14 @@ class Config:
 
        return(dt)
 
+    def parse_v3(self, dt):
+       dt['version']=4
+
+       for i in dt['data']:
+           dt['data'][i]['animate']=True
+
+       return(dt)
+
     def load_all(self):
        fn=get_config_fn()
 
@@ -184,6 +192,9 @@ class Config:
 
                if ret['version']==2:
                    ret=parse_v2(ret)
+
+               if ret['version']==3:
+                   ret=parse_v3(ret)
        except:
            ret=None
 
@@ -205,6 +216,7 @@ class Config:
        self.setApps(dt['apps'])
        self.setIndiv(dt['indiv'])
        self.setLongpress(dt['longpress'])
+       self.setAnimate(dt['animate'])
 
     def check_init(self):
        if self.id==None: