* Fixed some format upgrade issues
[feedingit] / src / config.py
index 5497b9e..2d361ac 100644 (file)
@@ -30,7 +30,7 @@ from gobject import idle_add
 from gconf import client_get_default
 from urllib2 import ProxyHandler
 
-VERSION = "0.6.1"
+VERSION = "48"
 
 section = "FeedingIt"
 ranges = { "updateInterval":[0.5, 1, 2, 4, 12, 24], "expiry":[24, 48, 72], "fontSize":range(12,24), "orientation":["Automatic", "Landscape", "Portrait"], "artFontSize":[10, 12, 14, 16, 18, 20], "feedsort":["Manual", "Most unread", "Least unread", "Most recent", "Least recent"] }
@@ -55,9 +55,11 @@ class Config():
     def createDialog(self):
         
         self.window = gtk.Dialog("Settings", self.parent)
+        self.window.set_geometry_hints(min_height=600)
+
         save_button = self.window.add_button(gtk.STOCK_SAVE, gtk.RESPONSE_OK)
         save_button.connect('clicked', self.on_save_button_clicked)
-        self.window.set_default_size(-1, 600)
+        #self.window.set_default_size(-1, 600)
         panArea = hildon.PannableArea()
         
         vbox = gtk.VBox(False, 2)
@@ -118,7 +120,7 @@ class Config():
         button.set_label('Cache images')
         button.set_active(self.config["imageCache"])
         button.connect("toggled", self.button_toggled, "imageCache")
-        vbox.pack_start(button, expand=False)      
+        vbox.pack_start(button, expand=False)
 
         button = hildon.CheckButton(gtk.HILDON_SIZE_FINGER_HEIGHT)
         button.set_label("Use HTTP proxy")
@@ -126,11 +128,18 @@ class Config():
         button.connect("toggled", self.button_toggled, "proxy")
         vbox.pack_start(button, expand=False)
         
+        button = hildon.CheckButton(gtk.HILDON_SIZE_FINGER_HEIGHT)
+        button.set_label('Open links in external browser')
+        button.set_active(self.config["extBrowser"])
+        button.connect("toggled", self.button_toggled, "extBrowser")
+        vbox.pack_start(button, expand=False)
+        
         panArea.add_with_viewport(vbox)
         
-        self.window.vbox.add(panArea)        
+        self.window.vbox.add(panArea)
         self.window.connect("destroy", self.onExit)
         #self.window.add(self.vbox)
+        self.window.set_default_size(-1, 600)
         self.window.show_all()
         return self.window
 
@@ -139,7 +148,7 @@ class Config():
         bus = dbus.SessionBus()
         proxy = bus.get_object("com.nokia.osso_browser", "/com/nokia/osso_browser/request")
         iface = dbus.Interface(proxy, 'com.nokia.osso_browser')
-        iface.open_new_window("http://feedingit.marcoz.org/%s.html" % VERSION)
+        iface.open_new_window("http://feedingit.marcoz.org/news/?page_id=%s" % VERSION)
 
     def onExit(self, *widget):
         # When the dialog is closed without hitting
@@ -201,6 +210,10 @@ class Config():
             self.config["hidereadfeeds"] = False
             self.config["hidereadarticles"] = False
         try:
+            self.config["extBrowser"] = configParser.getboolean(section, "extBrowser")
+        except:
+            self.config["extBrowser"] = False
+        try:
             self.config["feedsort"] = configParser.get(section, "feedsort")
         except:
             self.config["feedsort"] = "Manual"
@@ -218,6 +231,7 @@ class Config():
         configParser.set(section, 'proxy', str(self.config["proxy"]))
         configParser.set(section, 'hidereadfeeds', str(self.config["hidereadfeeds"]))
         configParser.set(section, 'hidereadarticles', str(self.config["hidereadarticles"]))
+        configParser.set(section, 'extBrowser', str(self.config["extBrowser"]))
         configParser.set(section, 'feedsort', str(self.config["feedsort"]))
 
         # Writing our configuration file
@@ -270,5 +284,7 @@ class Config():
         return self.config["hidereadfeeds"]
     def getHideReadArticles(self):
         return self.config["hidereadarticles"]
+    def getOpenInExternalBrowser(self):
+        return self.config["extBrowser"]
     def getFeedSortOrder(self):
         return self.config["feedsort"]