* Added "d_delete_tied" command.

* Moved CommandScheduler into src/rpc.

* Fixed a bug in the "download_list" command.

* Partial cleanup of the tracker list.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@924 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2007-06-24 20:25:44 +00:00
parent 9f11a5ad92
commit e6e7e8a384
23 changed files with 147 additions and 155 deletions
+1 -1
View File
@@ -165,7 +165,7 @@ print_download_info(char* first, char* last, core::Download* d) {
d->download()->bytes_done() > 0 ? (double)(100 * d->download()->up_rate()->total() / d->download()->bytes_done()) / 100 : 0.0);
if (d->priority() != 2)
first = print_buffer(first, last, " %s]", core::Download::priority_to_string(d->priority()));
first = print_buffer(first, last, " %s]", rpc::call_command_d_string("get_d_priority_str", d).c_str());
else
first = print_buffer(first, last, "]");
+26 -18
View File
@@ -36,9 +36,9 @@
#include "config.h"
#include <stdexcept>
#include <rak/algorithm.h>
#include <rak/string_manip.h>
#include <torrent/exceptions.h>
#include <torrent/tracker.h>
#include <torrent/tracker_list.h>
@@ -66,34 +66,42 @@ WindowTrackerList::redraw() {
m_canvas->print(2, pos, "Trackers: [Key: %08x]", tl->key());
++pos;
if (tl->size() == 0)
if (tl->size() == 0 || *m_focus >= tl->size())
return;
if (*m_focus >= tl->size())
throw std::logic_error("WindowTrackerList::redraw() called on an object with a bad focus value.");
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);
while (range.first != range.second) {
torrent::Tracker t = tl->get(range.first);
torrent::Tracker tracker = tl->get(range.first);
m_canvas->print(0, pos++, "%c %s",
range.first == *m_focus ? '*' : ' ',
t.url().c_str());
// m_canvas->print(0, pos, "[%c] [S/L %5i/%5i] %s",
// tracker.is_enabled() ? (tracker.is_open() ? '*' : ' ') : '-',
// tracker.scrape_complete(), tracker.scrape_incomplete(),
// tracker.url().c_str());
m_canvas->print(0, pos++, "%c Group: %2i Id: %s Focus: %s Enabled: %s Open: %s S/L: %u/%u",
range.first == *m_focus ? '*' : ' ',
t.group(),
rak::copy_escape_html(t.tracker_id()).c_str(),
if (tracker.group() == group)
m_canvas->print(0, pos, "%2i:", group++);
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() ? "yes" : " no",
t.is_enabled() ? "yes" : " no",
t.is_open() ? "yes" : " no",
t.scrape_complete(),
t.scrape_incomplete());
tracker.is_enabled() ? "yes" : " no",
tracker.is_open() ? "yes" : " no",
tracker.scrape_complete(),
tracker.scrape_incomplete());
++range.first;
if (range.first == *m_focus) {
m_canvas->set_attr(0, pos - 2, m_canvas->width(), is_focused() ? A_REVERSE : A_BOLD, COLOR_PAIR(0));
m_canvas->set_attr(0, pos - 1, m_canvas->width(), is_focused() ? A_REVERSE : A_BOLD, COLOR_PAIR(0));
}
range.first++;
}
}
-6
View File
@@ -37,14 +37,8 @@
#ifndef RTORRENT_DISPLAY_TRACKER_LIST_H
#define RTORRENT_DISPLAY_TRACKER_LIST_H
#include <list>
#include "window.h"
namespace torrent {
class Tracker;
}
namespace core {
class Download;
}