diff options
author | Andreas Krennmair <ak@synflood.at> | 2006-12-17 18:05:03 +0000 |
---|---|---|
committer | Andreas Krennmair <ak@synflood.at> | 2006-12-17 18:05:03 +0000 |
commit | 7047ed7c73c785704230778187dab5d5fc0b4c76 (patch) | |
tree | c4d784f4f7cf03421753b68e0f0169e26c9d2d2c | |
parent | 5e2fd67a74088624b5e72da7d378299935084311 (diff) |
Andreas Krennmair:
added information about feed unread status to feedlist head.
-rw-r--r-- | src/view.cpp | 9 | ||||
-rw-r--r-- | stfl/feedlist.stfl | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/view.cpp b/src/view.cpp index a96025cc..3999a99d 100644 --- a/src/view.cpp +++ b/src/view.cpp @@ -881,6 +881,7 @@ void view::set_feedlist(std::vector<rss_feed>& feeds) { unsigned int i = 0; unsigned short feedlist_number = 1; + unsigned int unread_feeds = 0; for (std::vector<rss_feed>::iterator it = feeds.begin(); it != feeds.end(); ++it, ++i, ++feedlist_number) { rss_feed feed = *it; std::string title = it->title(); @@ -901,6 +902,8 @@ void view::set_feedlist(std::vector<rss_feed>& feeds) { ++unread_count; } } + if (unread_count > 0) + ++unread_feeds; if (show_read_feeds || unread_count > 0) { snprintf(buf,sizeof(buf),"(%u/%u) ",unread_count,static_cast<unsigned int>(it->items().size())); @@ -924,6 +927,12 @@ void view::set_feedlist(std::vector<rss_feed>& feeds) { code.append("}"); stfl_modify(feedlist_form,"feeds","replace_inner",code.c_str()); + + std::ostringstream titleos; + + titleos << "Your feeds (" << unread_feeds << " unread, " << i << " total)"; + + stfl_set(feedlist_form, "head", titleos.str().c_str()); } void view::mark_all_read(std::vector<rss_item>& items) { diff --git a/stfl/feedlist.stfl b/stfl/feedlist.stfl index 3cd1d21d..2679013d 100644 --- a/stfl/feedlist.stfl +++ b/stfl/feedlist.stfl @@ -2,7 +2,7 @@ vbox @style_normal:bg=black,fg=white @info#style_normal:bg=blue,fg=yellow,attr=bold label#info - text:"Your feeds" + text[head]:"Your feeds" .expand:h !list[feeds] style_focus:fg=yellow,bg=blue,attr=bold |