New log window available through 'l'.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@343 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-03-12 19:16:30 +00:00
parent ab69ae3fe6
commit c36ee96550
13 changed files with 230 additions and 64 deletions
+3
View File
@@ -11,6 +11,9 @@ void
Log::push_front(const std::string& msg) {
Base::push_front(Type(utils::Timer::cache(), msg));
if (size() > 50)
Base::pop_back();
m_signalUpdate.emit();
}
+14 -3
View File
@@ -27,10 +27,15 @@ Manager::initialize() {
torrent::initialize();
torrent::listen_open(m_portFirst, m_portLast);
// Register log signals.
}
void
Manager::cleanup() {
// Need to disconnect log signals? Not really since we won't receive
// any more.
torrent::cleanup();
core::CurlStack::cleanup();
}
@@ -101,13 +106,15 @@ Manager::receive_http_done(CurlGet* http) {
} catch (torrent::local_error& e) {
// What to do? Keep in list for now.
m_log.push_front(e.what());
m_logImportant.push_front(e.what());
m_logComplete.push_front(e.what());
}
}
void
Manager::receive_http_failed(std::string msg) {
m_log.push_front("Http download error: \"" + msg + "\"");
m_logImportant.push_front("Http download error: \"" + msg + "\"");
m_logComplete.push_front("Http download error: \"" + msg + "\"");
}
void
@@ -119,7 +126,8 @@ Manager::create_file(const std::string& uri) {
} catch (torrent::local_error& e) {
// What to do? Keep in list for now.
m_log.push_front(e.what());
m_logImportant.push_front(e.what());
m_logComplete.push_front(e.what());
}
}
@@ -143,6 +151,9 @@ Manager::create_final(std::istream* s) {
if (m_debugTracker >= 0)
(*itr)->get_download().signal_tracker_dump(sigc::mem_fun(*this, &Manager::receive_debug_tracker));
// If we want to monitor network stuff.
(*itr)->get_download().signal_network_log(sigc::mem_fun(m_logComplete, &Log::push_front));
return itr;
}
+4 -2
View File
@@ -28,7 +28,8 @@ public:
HttpQueue& get_http_queue() { return m_httpQueue; }
Poll& get_poll() { return m_poll; }
Log& get_log() { return m_log; }
Log& get_log_important() { return m_logImportant; }
Log& get_log_complete() { return m_logComplete; }
void initialize();
void cleanup();
@@ -63,7 +64,8 @@ private:
HttpQueue m_httpQueue;
Poll m_poll;
Log m_log;
Log m_logImportant;
Log m_logComplete;
std::string m_dns;
int m_portFirst;