diff PreferencesDialog.py @ 158:e8bb107a74e1

all preferences are stored in a single JSON document in the couchdb backend. PreferencesDialog converts QString to a proper Python datatybe before sending it to the backend.
author dirk
date Mon, 29 Aug 2011 02:33:51 +0200
parents e830fa1cc7a2
children 2c91b5653878
line wrap: on
line diff
--- a/PreferencesDialog.py	Sat Aug 27 10:17:46 2011 +0200
+++ b/PreferencesDialog.py	Mon Aug 29 02:33:51 2011 +0200
@@ -33,7 +33,9 @@
     def fillProxySettings(self):
         if self.preferences.isProxyConfigured():
             self.ui.proxyHost.setText(self.preferences.proxyHost())
-            self.ui.proxyPort.setText(str(self.preferences.proxyPort()))
+            port = self.preferences.proxyPort()
+            if port is not None:
+                self.ui.proxyPort.setText(str(port))
 
     def fillDaysToKeepFeedEntries(self):
         days = self.preferences.daysToKeepFeedEntries()
@@ -60,13 +62,15 @@
     def storeProxySettings(self):
         proxyHost = self.ui.proxyHost.text()
         if proxyHost.isEmpty():
-            proxyHost = None
-        self.preferences.setProxyHost(proxyHost)
+            self.preferences.setProxyHost(None)
+        else:
+            self.preferences.setProxyHost(str(proxyHost))
 
         proxyPort = self.ui.proxyPort.text()
         if proxyPort.isEmpty():
-            proxyPort = None
-        self.preferences.setProxyPort(proxyPort)
+            self.preferences.setProxyPort(None)
+        else:
+            self.preferences.setProxyPort(int(proxyPort))
 
     def daysToKeepFeedEntriesFinishedEditing(self):
         text = self.ui.daysToKeepFeedEntries.text()