comparison backend/couchdb/Preferences.py @ 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 8ec20377bcb0
children e8bb107a74e1
comparison
equal deleted inserted replaced
155:a05719a6175e 156:2d159eb2a91b
10 row = iter(resultsForKey).next() 10 row = iter(resultsForKey).next()
11 return row.value["value"] 11 return row.value["value"]
12 except StopIteration: 12 except StopIteration:
13 return None 13 return None
14 14
15 def _booleanValueForKey(self, key):
16 value = self._valueForKey(key)
17 if value is None:
18 return False
19 else:
20 return value
21
15 def isProxyConfigured(self): 22 def isProxyConfigured(self):
16 return self.proxyHost() is not None 23 return self.proxyHost() is not None
17 24
18 def proxyHost(self): 25 def proxyHost(self):
19 return self._valueForKey("proxyHost") 26 return self._valueForKey("proxyHost")
20 27
21 def proxyPort(self): 28 def proxyPort(self):
22 return self._valueForKey("proxyPort") 29 return self._valueForKey("proxyPort")
23 30
24 def showOnlyUnreadFeeds(self): 31 def showOnlyUnreadFeeds(self):
25 return self._valueForKey("showOnlyUnreadFeeds") 32 return self._booleanValueForKey("showOnlyUnreadFeeds")
26 33
27 def startMaximized(self): 34 def startMaximized(self):
28 return self._valueForKey("startMaximized") 35 return self._booleanValueForKey("startMaximized")
29 36
30 def hideReadFeedEntries(self): 37 def hideReadFeedEntries(self):
31 return self._valueForKey("hideReadFeedEntries") 38 return self._booleanValueForKey("hideReadFeedEntries")
39
40 def daysToKeepFeedEntries(self):
41 days = self._valueForKey("daysToKeepFeedEntries")
42 if days is not None:
43 return days
44 else:
45 return 60
46
47 def rollback(self):
48 # this method does nothing
49 pass