Added file view.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@322 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-03-04 22:00:39 +00:00
parent 8d36f7c374
commit 9e0db66b58
14 changed files with 305 additions and 45 deletions
+6 -5
View File
@@ -2,13 +2,16 @@
#include <stdexcept>
#include "core/download.h"
#include "canvas.h"
#include "window_peer_list.h"
namespace display {
WindowPeerList::WindowPeerList(PList* l, PList::iterator* f) :
WindowPeerList::WindowPeerList(core::Download* d, PList* l, PList::iterator* f) :
Window(new Canvas, true),
m_download(d),
m_list(l),
m_focus(f) {
}
@@ -59,9 +62,7 @@ WindowPeerList::redraw() {
last = m_list->end();
}
uint32_t chunksTotal = m_slotChunksTotal();
if (chunksTotal <= 0)
if (m_download->get_download().get_chunks_total() <= 0)
throw std::logic_error("WindowPeerList::redraw() m_slotChunksTotal() returned invalid value");
while (itr != m_list->end() && y < m_canvas->get_height()) {
@@ -97,7 +98,7 @@ WindowPeerList::redraw() {
itr->get_incoming_queue_size());
x += 6;
m_canvas->print(x, y, "%3i", (itr->get_chunks_done() * 100) / chunksTotal);
m_canvas->print(x, y, "%3i", (itr->get_chunks_done() * 100) / m_download->get_download().get_chunks_total());
x += 6;
if (itr->get_incoming_queue_size())