Mercurial > hg > Feedworm
changeset 156:2d159eb2a91b
displaying the preferences dialog works, saving prefs doesn't yet
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Sat, 27 Aug 2011 10:17:07 +0200 |
parents | a05719a6175e |
children | 7dd9ae9556fd |
files | backend/couchdb/Preferences.py |
diffstat | 1 files changed, 21 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/backend/couchdb/Preferences.py Sat Aug 27 08:52:03 2011 +0200 +++ b/backend/couchdb/Preferences.py Sat Aug 27 10:17:07 2011 +0200 @@ -12,6 +12,13 @@ except StopIteration: return None + def _booleanValueForKey(self, key): + value = self._valueForKey(key) + if value is None: + return False + else: + return value + def isProxyConfigured(self): return self.proxyHost() is not None @@ -22,10 +29,21 @@ return self._valueForKey("proxyPort") def showOnlyUnreadFeeds(self): - return self._valueForKey("showOnlyUnreadFeeds") + return self._booleanValueForKey("showOnlyUnreadFeeds") def startMaximized(self): - return self._valueForKey("startMaximized") + return self._booleanValueForKey("startMaximized") def hideReadFeedEntries(self): - return self._valueForKey("hideReadFeedEntries") \ No newline at end of file + return self._booleanValueForKey("hideReadFeedEntries") + + def daysToKeepFeedEntries(self): + days = self._valueForKey("daysToKeepFeedEntries") + if days is not None: + return days + else: + return 60 + + def rollback(self): + # this method does nothing + pass