diff --git a/src/command_download.cc b/src/command_download.cc index 5bc7190b..e9afab7b 100644 --- a/src/command_download.cc +++ b/src/command_download.cc @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -742,6 +743,15 @@ initialize_command_download() { CMD2_DL ("d.priority_str", std::bind(&retrieve_d_priority_str, std::placeholders::_1)); CMD2_DL_VALUE_V ("d.priority.set", std::bind(&core::Download::set_priority, std::placeholders::_1, std::placeholders::_2)); + CMD2_DL ("d.group", std::bind(&torrent::resource_manager_entry::group, + std::bind(&torrent::ResourceManager::entry_at, torrent::resource_manager(), + std::bind(&core::Download::main, std::placeholders::_1)))); + CMD2_DL_VALUE_V ("d.group.set", std::bind(&torrent::ResourceManager::set_group, + torrent::resource_manager(), + std::bind(&torrent::ResourceManager::find_throw, torrent::resource_manager(), + std::bind(&core::Download::main, std::placeholders::_1)), + std::placeholders::_2)); + CMD2_DL ("d.initialize_logs", std::bind(&cmd_d_initialize_logs, std::placeholders::_1)); CMD2_DL_LIST ("f.multicall", std::bind(&f_multicall, std::placeholders::_1, std::placeholders::_2)); diff --git a/src/core/download.h b/src/core/download.h index d2f051f2..80498cf1 100644 --- a/src/core/download.h +++ b/src/core/download.h @@ -71,7 +71,9 @@ public: Download(download_type d); ~Download(); - const torrent::DownloadInfo* info() const { return m_download.info(); } + const torrent::DownloadInfo* info() const { return m_download.info(); } + + torrent::DownloadMain* main() { return m_download.main(); } bool is_open() const { return m_download.info()->is_open(); } bool is_active() const { return m_download.info()->is_active(); } diff --git a/src/ui/download.cc b/src/ui/download.cc index f09eeafb..ac703e74 100644 --- a/src/ui/download.cc +++ b/src/ui/download.cc @@ -177,7 +177,7 @@ Download::create_info() { element->push_back(""); element->push_column("Connection type:", te_command("d.connection_current=")); - element->push_column("Choke heuristic:", te_command("cat=$d.up.choke_heuristics=,\", \",$d.down.choke_heuristics=")); + element->push_column("Choke heuristic:", te_command("cat=(d.up.choke_heuristics),\", \",(d.down.choke_heuristics),\", \",(d.group)")); element->push_column("Safe sync:", te_command("if=$pieces.sync.always_safe=,yes,no")); element->push_column("Send buffer:", te_command("cat=$convert.kb=$network.send_buffer.size=,\" KB\"")); element->push_column("Receive buffer:", te_command("cat=$convert.kb=$network.receive_buffer.size=,\" KB\""));