* Added blocks to transfer list view.

* Minor modifications to the Block API.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@718 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2006-06-12 19:20:51 +00:00
parent 1e54882da4
commit 38f0cdbce2
4 changed files with 22 additions and 8 deletions
+1 -1
View File
@@ -97,7 +97,7 @@ WindowDownloadChunksSeen::redraw() {
std::vector<uint32_t>::const_iterator itrTransfer = transferChunks.begin();
for (int y = 1; y < m_canvas->get_height() && chunk < last; ++y) {
m_canvas->print(0, y, "%5d ", (int)(chunk - seen));
m_canvas->print(0, y, "%5u ", (int)(chunk - seen));
while (chunk < last) {
chtype attr;
+3 -3
View File
@@ -79,9 +79,9 @@ WindowDownloadList::redraw() {
typedef std::pair<core::View::iterator, core::View::iterator> Range;
Range range = rak::advance_bidirectional(m_view->begin_visible(),
m_view->focus() != m_view->end_visible() ? m_view->focus() : m_view->begin_visible(),
m_view->end_visible(),
m_canvas->get_height() / 3);
m_view->focus() != m_view->end_visible() ? m_view->focus() : m_view->begin_visible(),
m_view->end_visible(),
m_canvas->get_height() / 3);
// Make sure we properly fill out the last lines so it looks like
// there are more torrents, yet don't hide it if we got the last one
+15 -4
View File
@@ -74,10 +74,21 @@ WindowDownloadTransferList::redraw() {
// prettify this. (This is a very subtle hint)
for (int y = 1; y < m_canvas->get_height() && itr != transfers->end(); ++y, ++itr) {
m_canvas->print(0, y, "%5u %3u %s",
(*itr)->index(),
(*itr)->finished(),
(*itr)->is_all_finished() ? "done" : " ");
m_canvas->print(0, y, "%5u ", (*itr)->index());
// Handle window size.
for (torrent::BlockList::const_iterator bItr = (*itr)->begin(), bLast = (*itr)->end(); bItr != bLast; ++bItr) {
chtype attr;
// Add is_transfering.
if (bItr->is_finished())
attr = A_NORMAL;
else
attr = A_BOLD;
m_canvas->print_char(attr | 'X');
}
}
}
@@ -38,6 +38,7 @@
#define RTORRENT_DISPLAY_WINDOW_DOWNLOAD_TRANSFER_LIST_H
#include <list>
#include <torrent/block_transfer.h>
#include "window.h"
@@ -58,6 +59,8 @@ public:
unsigned int max_focus() const { return std::max<int>(rows() - get_height() + 1, 0); }
private:
char peer_id(torrent::BlockTransfer::key_type key);
core::Download* m_download;
unsigned int* m_focus;