Adding tracker group cycle.

Adding creation date display.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@468 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-06-19 20:44:56 +00:00
parent 7b1e0ec085
commit 9a3d75490f
9 changed files with 52 additions and 19 deletions
+17 -1
View File
@@ -22,7 +22,6 @@
#include "config.h"
#include <ctime>
#include <sstream>
#include <iomanip>
@@ -68,4 +67,21 @@ print_hhmmss(utils::Timer t) {
return str.str();
}
std::string
print_ddmmyyyy(time_t t) {
std::tm *u = std::gmtime(&t);
if (u == NULL)
return "inv_time";
std::stringstream str;
str.fill('0');
str << std::setw(2) << u->tm_mday << '/'
<< std::setw(2) << u->tm_mon << '/'
<< std::setw(4) << (1900 + u->tm_year);
return str.str();
}
}
+2
View File
@@ -23,6 +23,7 @@
#ifndef RTORRENT_DISPLAY_UTILS_H
#define RTORRENT_DISPLAY_UTILS_H
#include <ctime>
#include <string>
namespace core {
@@ -38,6 +39,7 @@ namespace display {
std::string print_download_status(core::Download* d);
std::string print_hhmmss(utils::Timer t);
std::string print_ddmmyyyy(time_t t);
}
+6 -3
View File
@@ -28,6 +28,7 @@
#include "utils/parse.h"
#include "canvas.h"
#include "utils.h"
#include "window_peer_info.h"
namespace display {
@@ -47,12 +48,14 @@ WindowPeerInfo::redraw() {
int y = 0;
torrent::Download d = m_download->get_download();
m_canvas->print(0, y++, "Hash: %s", utils::string_to_hex(d.get_hash()).c_str());
m_canvas->print(0, y++, "Id: %s", utils::escape_string(d.get_id()).c_str());
m_canvas->print(0, y++, "Chunks: %u / %u * %u",
m_canvas->print(0, y++, "Hash: %s", utils::string_to_hex(d.get_hash()).c_str());
m_canvas->print(0, y++, "Id: %s", utils::escape_string(d.get_id()).c_str());
m_canvas->print(0, y++, "Chunks: %u / %u * %u",
d.get_chunks_done(),
d.get_chunks_total(),
d.get_chunks_size());
m_canvas->print(0, y++, "Created: %s",
print_ddmmyyyy(static_cast<time_t>(d.get_creation_date())).c_str());
y++;