void select_formaction::init() { std::string title; do_redraw = true; quit = false; value = ""; std::string viewwidth = f->get("taglist:w"); unsigned int width = utils::to_u(viewwidth, 80); set_keymap_hints(); fmtstr_formatter fmt; fmt.register_fmt('N', PROGRAM_NAME); fmt.register_fmt('V', PROGRAM_VERSION); switch (type) { case SELECTTAG: title = fmt.do_format(v->get_cfg()->get_configvalue("selecttag-title-format"), width); break; case SELECTFILTER: title = fmt.do_format(v->get_cfg()->get_configvalue("selectfilter-title-format"), width); break; default: assert(0); // should never happen } f->set("head", title); }
void dialogs_formaction::init() { set_keymap_hints(); unsigned int width = utils::to_u(f->get("dialogs:w")); std::string title_format = v->get_cfg()->get_configvalue("dialogs-title-format"); fmtstr_formatter fmt; fmt.register_fmt('N', PROGRAM_NAME); fmt.register_fmt('V', PROGRAM_VERSION); f->set("head", fmt.do_format(title_format, width)); }
void itemview_formaction::init() { f->set("msg",""); do_redraw = true; quit = false; links.clear(); num_lines = 0; if (!v->get_cfg()->get_configvalue_as_bool("display-article-progress")) { f->set("percentwidth", "0"); } else { f->set("percentwidth", utils::to_string<unsigned int>(utils::max(6, utils::max(strlen(_("Top")), strlen(_("Bottom")))))); update_percent(); } set_keymap_hints(); }
void urlview_formaction::init() { v->set_status(""); std::string viewwidth = f->get("urls:w"); unsigned int width = utils::to_u(viewwidth, 80); fmtstr_formatter fmt; fmt.register_fmt('N', PROGRAM_NAME); fmt.register_fmt('V', PROGRAM_VERSION); f->set("head", fmt.do_format(v->get_cfg()->get_configvalue("urlview-title-format"), width)); do_redraw = true; quit = false; set_keymap_hints(); }
void feedlist_formaction::init() { set_keymap_hints(); f->run(-3); // compute all widget dimensions if(v->get_ctrl()->get_refresh_on_start()) { v->get_ctrl()->start_reload_all_thread(); } v->get_ctrl()->update_feedlist(); /* * This is kind of a hack. * The feedlist_formaction is responsible for starting up the reloadthread, which is responsible * for regularly spawning downloadthreads. */ reloadthread * rt = new reloadthread(v->get_ctrl(), v->get_cfg()); rt->start(); apply_filter = !(v->get_cfg()->get_configvalue_as_bool("show-read-feeds")); }