summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Roman Vasin <rvasin@gmail.com> 2018-03-17 18:26:40 +0200
committerGravatar Alexander Batischev <eual.jp@gmail.com> 2018-03-17 19:26:40 +0300
commitba03e35b0b0f7da8aa3fe236492c5e9c3f1f2ad3 (patch)
treefe7152e845f246fbda9ed8b2327263da8ce0ad68 /src
parentc17a8fd8831e3b5c1ab242b8d9261b59ff685510 (diff)
downloadnewsboat-ba03e35b0b0f7da8aa3fe236492c5e9c3f1f2ad3.tar.gz
newsboat-ba03e35b0b0f7da8aa3fe236492c5e9c3f1f2ad3.tar.zst
newsboat-ba03e35b0b0f7da8aa3fe236492c5e9c3f1f2ad3.zip
Implemented new command: Mark feed read until current article (#144)
New command: Mark all above as read
Diffstat (limited to '')
-rw-r--r--src/itemlist_formaction.cpp17
-rw-r--r--src/keymap.cpp5
2 files changed, 22 insertions, 0 deletions
diff --git a/src/itemlist_formaction.cpp b/src/itemlist_formaction.cpp
index edada713..f0557dc4 100644
--- a/src/itemlist_formaction.cpp
+++ b/src/itemlist_formaction.cpp
@@ -361,6 +361,23 @@ void itemlist_formaction::process_operation(operation op, bool automatic, std::v
v->show_error(strprintf::fmt(_("Error: couldn't mark feed read: %s"), e.what()));
}
break;
+ case OP_MARKALLABOVEASREAD:
+ LOG(level::INFO, "itemlist_formaction: marking all above as read");
+ v->set_status(_("Marking all above as read..."));
+ if (itemposname.length() > 0 && itempos < visible_items.size()) {
+ for (unsigned int i=0; i<itempos; ++i) {
+ if (visible_items[i].first->unread()) {
+ visible_items[i].first->set_unread(false);
+ v->get_ctrl()->mark_article_read(visible_items[i].first->guid(), true);
+ }
+ }
+ if (!v->get_cfg()->get_configvalue_as_bool("show-read-articles")) {
+ f->set("itempos","0");
+ }
+ invalidate(InvalidationMode::COMPLETE);
+ }
+ v->set_status("");
+ break;
case OP_TOGGLESHOWREAD:
m.parse(FILTER_UNREAD_ITEMS);
LOG(level::DEBUG, "itemlist_formaction: toggling show-read-articles");
diff --git a/src/keymap.cpp b/src/keymap.cpp
index efd0a11a..b73fd807 100644
--- a/src/keymap.cpp
+++ b/src/keymap.cpp
@@ -58,6 +58,11 @@ static op_desc opdescs[] = {
KM_FEEDLIST
},
{
+ OP_MARKALLABOVEASREAD, "mark-all-above-as-read", "",
+ _("Mark all above as read"),
+ KM_ARTICLELIST
+ },
+ {
OP_SAVE, "save", "s",
_("Save article"),
KM_ARTICLELIST | KM_ARTICLE