Mercurial > hg > Feedworm
comparison Preferences.py @ 72:e8c2730eb444
control the display of unread feeds/all feeds via Preferences
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Wed, 11 Aug 2010 03:23:02 +0200 |
parents | db35ab7753f0 |
children | b8bfd1bd6c55 |
comparison
equal
deleted
inserted
replaced
71:228da10cc98b | 72:e8c2730eb444 |
---|---|
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 HIDE_READ_ENTRIES = "HIDE_READ_FEED_ENTRIES" |
7 SHOW_ONLY_UNREAD_FEEDS = "SHOW_ONLY_UNREAD_FEEDS" | |
7 | 8 |
8 class Preferences(object): | 9 class Preferences(object): |
9 def __init__(self, session): | 10 def __init__(self, session): |
10 self.session = session | 11 self.session = session |
11 self.cache = {} | 12 self.cache = {} |
34 return util.str2bool(pref.value) | 35 return util.str2bool(pref.value) |
35 | 36 |
36 def setHideReadFeedEntries(self, flag): | 37 def setHideReadFeedEntries(self, flag): |
37 pref = self._cachedPreference(HIDE_READ_ENTRIES) | 38 pref = self._cachedPreference(HIDE_READ_ENTRIES) |
38 pref.value = util.bool2str(flag) | 39 pref.value = util.bool2str(flag) |
40 | |
41 def showOnlyUnreadFeeds(self): | |
42 pref = self._cachedPreference(SHOW_ONLY_UNREAD_FEEDS, False) | |
43 return util.str2bool(pref.value) | |
44 | |
45 def setShowOnlyUnreadFeeds(self, flag): | |
46 pref = self._cachedPreference(SHOW_ONLY_UNREAD_FEEDS) | |
47 pref.value = util.bool2str(flag) |