diff options
author | 2006-11-18 18:45:44 +0000 | |
---|---|---|
committer | 2006-11-18 18:45:44 +0000 | |
commit | 802fe52c86786f741514e4801f026c7315798429 (patch) | |
tree | ac8aa345b051bfa57f60cc5846b12733230d14ab | |
parent | 4176358cf896b213503f613baae56218bb405db8 (diff) | |
download | newsboat-802fe52c86786f741514e4801f026c7315798429.tar.gz newsboat-802fe52c86786f741514e4801f026c7315798429.tar.zst newsboat-802fe52c86786f741514e4801f026c7315798429.zip |
Andreas Krennmair:
added "open in browser" feature.
-rw-r--r-- | include/view.h | 1 | ||||
-rw-r--r-- | src/view.cpp | 11 | ||||
-rw-r--r-- | stfl/itemview.stfl | 2 |
3 files changed, 13 insertions, 1 deletions
diff --git a/include/view.h b/include/view.h index 22b2dd5f..e3f88531 100644 --- a/include/view.h +++ b/include/view.h @@ -27,6 +27,7 @@ namespace noos { private: void jump_to_next_unread_item(std::vector<rss_item>& items); void mark_all_read(std::vector<rss_item>& items); + void open_in_browser(const std::string& url); controller * ctrl; stfl_form * feedlist_form; diff --git a/src/view.cpp b/src/view.cpp index 2f803957..566b3f4c 100644 --- a/src/view.cpp +++ b/src/view.cpp @@ -275,6 +275,9 @@ void view::run_itemview(rss_item& item) { case 's': // TODO: save currently selected article break; + case 'o': + open_in_browser(item.link()); + break; case 'q': quit = true; break; @@ -285,6 +288,14 @@ void view::run_itemview(rss_item& item) { } while (!quit); } +void view::open_in_browser(const std::string& url) { + std::string cmdline = "links '"; + stfl_reset(); + cmdline.append(url); + cmdline.append("'"); + system(cmdline.c_str()); +} + void view::set_feedlist(std::vector<rss_feed>& feeds) { std::string code = "{list"; diff --git a/stfl/itemview.stfl b/stfl/itemview.stfl index 47405aa7..2df3b6d0 100644 --- a/stfl/itemview.stfl +++ b/stfl/itemview.stfl @@ -9,7 +9,7 @@ vbox .expand:vh .offset:0 label#info - text[help]:"q:Quit s:Save" + text[help]:"q:Quit s:Save o:Open in Browser" .expand:h label text[msg]:"" |