psa: implemented settings
[feedingit] / psa_harmattan / feedingit / deb_dist / feedingit-0.1.0 / debian / feedingit / usr / share / feedingit / config.py
index 9f7ec81..47ceaca 100644 (file)
@@ -226,6 +226,10 @@ class Config():
             self.config["feedsort"] = configParser.get(section, "feedsort")
         except:
             self.config["feedsort"] = "Manual"
+        try:
+            self.config["theme"] = configParser.get(section, "theme")
+        except:
+            self.config["theme"] = True
         
     def saveConfig(self):
         configParser = RawConfigParser()
@@ -242,6 +246,7 @@ class Config():
         configParser.set(section, 'hidereadarticles', str(self.config["hidereadarticles"]))
         configParser.set(section, 'extBrowser', str(self.config["extBrowser"]))
         configParser.set(section, 'feedsort', str(self.config["feedsort"]))
+        configParser.set(section, 'theme', str(self.config["theme"]))
 
         # Writing our configuration file
         file = open(self.configFilename, 'wb')
@@ -271,6 +276,8 @@ class Config():
         return self.config["artFontSize"]
     def getExpiry(self):
         return self.config["expiry"]
+    def setExpiry(self, expiry):
+        self.config["expiry"] = expiry
     def isAutoUpdateEnabled(self):
         return self.config["autoupdate"]
     def getUpdateInterval(self):
@@ -279,10 +286,16 @@ class Config():
         return "sans italic %s" % self.config["fontSize"]
     def getUnreadFont(self):
         return "sans %s" % self.config["fontSize"]
-    def getOrientation(self):
+    def getOrientation(self, index):
         return ranges["orientation"].index(self.config["orientation"])
+    def getOrientationChoices(self):
+        return ranges["orientation"]
+    def setOrientation(self, choice):
+        self.config["orientation"] = index 
     def getImageCache(self):
         return self.config["imageCache"]
+    def setImageCache(self, cache):
+        self.config["imageCache"] = bool(cache) 
     @mainthread
     def getProxy(self):
         if self.config["proxy"] == False:
@@ -295,9 +308,21 @@ class Config():
         return (False, None)
     def getHideReadFeeds(self):
         return self.config["hidereadfeeds"]
+    def setHideReadFeeds(self, setting):
+        self.config["hidereadfeeds"] = bool(setting)
     def getHideReadArticles(self):
         return self.config["hidereadarticles"]
+    def setHideReadArticles(self, setting):
+        self.config["hidereadarticles"] = bool(setting)
     def getOpenInExternalBrowser(self):
         return self.config["extBrowser"]
     def getFeedSortOrder(self):
         return self.config["feedsort"]
+    def getFeedSortOrderChoices(self):
+        return ranges["feedsort"]
+    def setFeedSortOrder(self, setting):
+        self.config["feedsort"] = setting
+    def getTheme(self):
+        return self.config["theme"]
+    def setTheme(self, theme):
+        self.config["theme"] = bool(theme)