* Fixed minor bugs in the display of tracker groups. Patch by Josef

Drexler.

* Cleanup of the CommandMap class.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1041 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2008-03-13 14:28:17 +00:00
parent b21f465969
commit 8cc7c8430d
12 changed files with 169 additions and 180 deletions
+16 -10
View File
@@ -60,7 +60,7 @@ WindowTrackerList::redraw() {
m_slotSchedule(this, (cachedTime + rak::timer::from_seconds(10)).round_seconds());
m_canvas->erase();
int pos = 0;
unsigned int pos = 0;
torrent::TrackerList* tl = m_download->tracker_list();
m_canvas->print(2, pos, "Trackers: [Key: %08x]", tl->key());
@@ -71,8 +71,8 @@ WindowTrackerList::redraw() {
typedef std::pair<unsigned int, unsigned int> Range;
unsigned int group = 0;
Range range = rak::advance_bidirectional<unsigned int>(0, *m_focus, tl->size(), (m_canvas->height() + 1) / 2);
Range range = rak::advance_bidirectional<unsigned int>(0, *m_focus, tl->size(), (m_canvas->height() - 1) / 2);
unsigned int group = tl->at(range.first)->group();
while (range.first != range.second) {
torrent::Tracker* tracker = tl->at(range.first);
@@ -88,13 +88,14 @@ WindowTrackerList::redraw() {
m_canvas->print(4, pos++, "%s",
tracker->url().c_str());
m_canvas->print(4, pos++, "Id: %s Focus: %s Enabled: %s Open: %s S/L: %u/%u",
rak::copy_escape_html(tracker->tracker_id()).c_str(),
range.first == tl->focus_index() ? "yes" : " no",
tracker->is_usable() ? "yes" : tracker->is_enabled() ? "off" : " no",
tracker->is_busy() ? "yes" : " no",
tracker->scrape_complete(),
tracker->scrape_incomplete());
if (pos < m_canvas->height())
m_canvas->print(4, pos++, "Id: %s Focus: %s Enabled: %s Open: %s S/L: %u/%u",
rak::copy_escape_html(tracker->tracker_id()).c_str(),
range.first == tl->focus_index() ? "yes" : " no",
tracker->is_usable() ? "yes" : tracker->is_enabled() ? "off" : " no",
tracker->is_busy() ? "yes" : " no",
tracker->scrape_complete(),
tracker->scrape_incomplete());
// m_canvas->print(4, pos++, "Id: %s Focus: %s Enabled: %s Open: %s Timer: %u/%u",
// rak::copy_escape_html(tracker->tracker_id()).c_str(),
@@ -110,6 +111,11 @@ WindowTrackerList::redraw() {
}
range.first++;
// If we're at the end of the range, check if we can
// show one more line for the following tracker.
if (range.first == range.second && pos < m_canvas->height() && range.first < tl->size())
range.second++;
}
}