diff --git a/src/command_download.cc b/src/command_download.cc index b8d0eea5..6fc92701 100644 --- a/src/command_download.cc +++ b/src/command_download.cc @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -551,9 +552,8 @@ d_list_remove(core::Download* download, const torrent::Object& rawArgs, const ch return torrent::Object(); } -#define CMD_ON_INFO(func) rak::on(std::mem_fun(&core::Download::info), std::mem_fun(&torrent::DownloadInfo::func)) - #define CMD2_ON_INFO(func) std::bind(&torrent::DownloadInfo::func, std::bind(&core::Download::info, std::placeholders::_1)) +#define CMD2_ON_DATA(func) std::bind(&torrent::download_data::func, std::bind(&core::Download::data, std::placeholders::_1)) #define CMD2_ON_DL(func) std::bind(&torrent::Download::func, std::bind(&core::Download::download, std::placeholders::_1)) #define CMD2_ON_FL(func) std::bind(&torrent::FileList::func, std::bind(&core::Download::file_list, std::placeholders::_1)) @@ -780,6 +780,8 @@ initialize_command_download() { CMD2_DL ("d.completed_chunks", CMD2_ON_FL(completed_chunks)); CMD2_DL ("d.left_bytes", CMD2_ON_FL(left_bytes)); + CMD2_DL ("d.wanted_chunks", CMD2_ON_DATA(wanted_chunks)); + CMD2_DL_V ("d.tracker_announce", std::bind(&torrent::TrackerList::manual_request, CMD2_BIND_TL, false)); CMD2_DL ("d.tracker_numwant", std::bind(&torrent::TrackerList::numwant, CMD2_BIND_TL)); CMD2_DL_VALUE_V ("d.tracker_numwant.set", std::bind(&torrent::TrackerList::set_numwant, CMD2_BIND_TL, std::placeholders::_2)); diff --git a/src/core/download.h b/src/core/download.h index 80498cf1..9f5b28d5 100644 --- a/src/core/download.h +++ b/src/core/download.h @@ -71,7 +71,8 @@ public: Download(download_type d); ~Download(); - const torrent::DownloadInfo* info() const { return m_download.info(); } + const torrent::DownloadInfo* info() const { return m_download.info(); } + const torrent::download_data* data() const { return m_download.data(); } torrent::DownloadMain* main() { return m_download.main(); } diff --git a/src/ui/download.cc b/src/ui/download.cc index ac703e74..08c9b9f7 100644 --- a/src/ui/download.cc +++ b/src/ui/download.cc @@ -161,7 +161,7 @@ Download::create_info() { element->push_column("File stats:", te_command("cat=$if=$d.is_multi_file=\\,multi\\,single,\" \",$d.size_files=,\" files\"")); element->push_back(""); - element->push_column("Chunks:", te_command("cat=$d.completed_chunks=,\" / \",$d.size_chunks=,\" * \",$d.chunk_size=")); + element->push_column("Chunks:", te_command("cat=(d.completed_chunks),\" / \",(d.size_chunks),\" * \",(d.chunk_size),\" (\",(d.wanted_chunks),\")\"")); element->push_column("Priority:", te_command("d.priority=")); element->push_column("Peer exchange:", te_command("cat=$if=$d.peer_exchange=\\,enabled\\,disabled,\\ ," "$if=$d.is_pex_active=\\,active\\,$d.is_private=\\,private\\,inactive,"