comparison Preferences.py @ 61:db35ab7753f0

add a preference to hide read feed entries
author Dirk Olmes <dirk@xanthippe.ping.de>
date Sat, 24 Jul 2010 03:11:06 +0200
parents 03358c113170
children e8c2730eb444
comparison
equal deleted inserted replaced
60:d063e4814357 61:db35ab7753f0
1 1
2 from Preference import Preference 2 from Preference import Preference
3 import util 3 import util
4 4
5 START_MAXIMIZED = "START_MAXIMIZED" 5 START_MAXIMIZED = "START_MAXIMIZED"
6 HIDE_READ_ENTRIES = "HIDE_READ_FEED_ENTRIES"
6 7
7 class Preferences(object): 8 class Preferences(object):
8 def __init__(self, session): 9 def __init__(self, session):
9 self.session = session 10 self.session = session
10 self.cache = {} 11 self.cache = {}
25 return util.str2bool(pref.value) 26 return util.str2bool(pref.value)
26 27
27 def setStartMaximized(self, flag): 28 def setStartMaximized(self, flag):
28 pref = self._cachedPreference(START_MAXIMIZED) 29 pref = self._cachedPreference(START_MAXIMIZED)
29 pref.value = util.bool2str(flag) 30 pref.value = util.bool2str(flag)
31
32 def hideReadFeedEntries(self):
33 pref = self._cachedPreference(HIDE_READ_ENTRIES, False)
34 return util.str2bool(pref.value)
35
36 def setHideReadFeedEntries(self, flag):
37 pref = self._cachedPreference(HIDE_READ_ENTRIES)
38 pref.value = util.bool2str(flag)