Merge pull request #405 from pyroscope/cmd-ui-current-view

added ui.current_view command
This commit is contained in:
Jari Sundell
2016-03-09 07:07:31 +09:00
+6
View File
@@ -466,6 +466,11 @@ cmd_ui_set_view(const torrent::Object::string_type& args) {
return torrent::Object();
}
torrent::Object
cmd_ui_current_view() {
return control->ui()->download_list()->current_view()->name();
}
torrent::Object
cmd_ui_unfocus_download(core::Download* download) {
control->ui()->download_list()->unfocus_download(download);
@@ -547,6 +552,7 @@ initialize_command_ui() {
// Commands that affect the default rtorrent UI.
CMD2_DL ("ui.unfocus_download", std::bind(&cmd_ui_unfocus_download, std::placeholders::_1));
CMD2_ANY ("ui.current_view", std::bind(&cmd_ui_current_view));
CMD2_ANY_STRING("ui.current_view.set", std::bind(&cmd_ui_set_view, std::placeholders::_2));
// Move.