Mercurial > pidgin.yaz
diff finch/libgnt/pygnt/example/rss/gntrss-ui.py @ 18714:121d1560346c
A few updates to the rss reader.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Sun, 29 Jul 2007 10:37:10 +0000 |
parents | 254823d66aa5 |
children | 64a7b13d3b8d |
line wrap: on
line diff
--- a/finch/libgnt/pygnt/example/rss/gntrss-ui.py Sun Jul 29 07:59:10 2007 +0000 +++ b/finch/libgnt/pygnt/example/rss/gntrss-ui.py Sun Jul 29 10:37:10 2007 +0000 @@ -71,12 +71,15 @@ if property.name == 'unread': if feeds.active != item.parent: return + flag = 0 + if item == items.active: + flag = gnt.TEXT_FLAG_UNDERLINE if item.unread: item.parent.unread = item.parent.unread + 1 - items.set_row_flags(item, gnt.TEXT_FLAG_BOLD) + items.set_row_flags(item, flag | gnt.TEXT_FLAG_BOLD) else: item.parent.unread = item.parent.unread - 1 - items.set_row_flags(item, gnt.TEXT_FLAG_NORMAL) + items.set_row_flags(item, flag | gnt.TEXT_FLAG_NORMAL) item.parent.notify('unread') def add_feed_item(item): @@ -158,6 +161,8 @@ details.scroll(0) if item.unread: item.set_property('unread', False) + if old and old.unread: + old.set_property('unread', True) # # Look for action keys in the feed-item list. @@ -170,9 +175,13 @@ elif text == 'm': # Mark the current item 'read' if current.unread: current.set_property('unread', False) + tree.perform_action_key('j') elif text == 'U': # Mark the current item 'unread' if not current.unread: current.set_property('unread', True) + elif text == 'd': + current.remove() + tree.perform_action_key('j') else: return False return True