mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-13 12:46:18 +00:00
* Added all the clients to the new ClientList and fixed it so that it
prints the version number. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@805 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -46,6 +46,7 @@
|
|||||||
#include <torrent/rate.h>
|
#include <torrent/rate.h>
|
||||||
#include <torrent/tracker.h>
|
#include <torrent/tracker.h>
|
||||||
#include <torrent/tracker_list.h>
|
#include <torrent/tracker_list.h>
|
||||||
|
#include <torrent/peer/client_info.h>
|
||||||
|
|
||||||
#include "core/download.h"
|
#include "core/download.h"
|
||||||
|
|
||||||
@@ -221,6 +222,14 @@ print_download_percentage_done(char* first, char* last, core::Download* d) {
|
|||||||
return print_buffer(first, last, "[%2u%%]", (d->download()->chunks_done() * 100) / d->download()->chunks_total());
|
return print_buffer(first, last, "[%2u%%]", (d->download()->chunks_done() * 100) / d->download()->chunks_total());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char*
|
||||||
|
print_client_version(char* first, char* last, const torrent::ClientInfo& clientInfo) {
|
||||||
|
return print_buffer(first, last, "%s %hhu.%hhu.%hhu.%hhu",
|
||||||
|
clientInfo.short_description(),
|
||||||
|
clientInfo.version()[0], clientInfo.version()[1],
|
||||||
|
clientInfo.version()[2], clientInfo.version()[3]);
|
||||||
|
}
|
||||||
|
|
||||||
char*
|
char*
|
||||||
print_status_info(char* first, char* last) {
|
print_status_info(char* first, char* last) {
|
||||||
if (torrent::up_throttle() == 0)
|
if (torrent::up_throttle() == 0)
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ namespace utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
namespace torrent {
|
namespace torrent {
|
||||||
|
class ClientInfo;
|
||||||
class Entry;
|
class Entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,6 +70,8 @@ char* print_download_status(char* first, char* last, core::Download* d);
|
|||||||
char* print_download_time_left(char* first, char* last, core::Download* d);
|
char* print_download_time_left(char* first, char* last, core::Download* d);
|
||||||
char* print_download_percentage_done(char* first, char* last, core::Download* d);
|
char* print_download_percentage_done(char* first, char* last, core::Download* d);
|
||||||
|
|
||||||
|
char* print_client_version(char* first, char* last, const torrent::ClientInfo& clientInfo);
|
||||||
|
|
||||||
char* print_entry_tags(char* first, char* last);
|
char* print_entry_tags(char* first, char* last);
|
||||||
char* print_entry_file(char* first, char* last, const torrent::Entry& entry);
|
char* print_entry_file(char* first, char* last, const torrent::Entry& entry);
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,7 @@
|
|||||||
|
|
||||||
#include "canvas.h"
|
#include "canvas.h"
|
||||||
#include "client_info.h"
|
#include "client_info.h"
|
||||||
|
#include "utils.h"
|
||||||
#include "window_peer_list.h"
|
#include "window_peer_list.h"
|
||||||
|
|
||||||
namespace display {
|
namespace display {
|
||||||
@@ -139,11 +140,10 @@ WindowPeerList::redraw() {
|
|||||||
x += 7;
|
x += 7;
|
||||||
|
|
||||||
char buf[128];
|
char buf[128];
|
||||||
torrent::ClientInfo clientInfo = torrent::client_list()->parse_id(p.id());
|
torrent::ClientInfo clientInfo;
|
||||||
|
torrent::client_list()->retrieve_id(&clientInfo, p.id());
|
||||||
|
|
||||||
std::strncpy(buf, clientInfo.short_description(), 128);
|
print_client_version(buf, buf + 128, clientInfo);
|
||||||
|
|
||||||
// control->client_info()->print(buf, buf + 128, p.id().data());
|
|
||||||
|
|
||||||
m_canvas->print(x, y, "%s", buf);
|
m_canvas->print(x, y, "%s", buf);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user