Use new logging buffer for complete log view.

This commit is contained in:
rakshasa
2012-03-12 20:41:19 +09:00
parent a186932c03
commit 7e0d5956b5
9 changed files with 58 additions and 50 deletions
+1 -1
View File
@@ -74,7 +74,7 @@ DownloadList::DownloadList() :
m_uiArray[DISPLAY_DOWNLOAD] = NULL;
m_uiArray[DISPLAY_DOWNLOAD_LIST] = new ElementDownloadList();
m_uiArray[DISPLAY_LOG] = new ElementLogComplete(&control->core()->get_log_complete());
m_uiArray[DISPLAY_LOG] = new ElementLogComplete(control->core()->log_complete());
m_uiArray[DISPLAY_STRING_LIST] = new ElementStringList();
m_windowLog = new WLog(control->core()->log_important());
+13 -1
View File
@@ -37,6 +37,8 @@
#include "config.h"
#include <torrent/exceptions.h>
#include <torrent/torrent.h>
#include <torrent/utils/thread_base.h>
#include "display/frame.h"
#include "display/manager.h"
@@ -48,9 +50,13 @@
namespace ui {
ElementLogComplete::ElementLogComplete(core::Log* l) :
ElementLogComplete::ElementLogComplete(torrent::log_buffer* l) :
m_window(NULL),
m_log(l) {
unsigned int signal_index = torrent::main_thread()->signal_bitfield()->add_signal(std::tr1::bind(&ElementLogComplete::received_update, this));
m_log->lock_and_set_update_slot(std::tr1::bind(&torrent::thread_base::send_event_signal, torrent::main_thread(), signal_index, false));
}
void
@@ -86,4 +92,10 @@ ElementLogComplete::window() {
return m_window;
}
void
ElementLogComplete::received_update() {
if (m_window != NULL)
m_window->mark_dirty();
}
}
+5 -3
View File
@@ -37,7 +37,7 @@
#ifndef RTORRENT_UI_ELEMENT_LOG_COMPLETE_H
#define RTORRENT_UI_ELEMENT_LOG_COMPLETE_H
#include "core/log.h"
#include <torrent/utils/log_buffer.h>
#include "element_base.h"
@@ -53,7 +53,7 @@ class ElementLogComplete : public ElementBase {
public:
typedef display::WindowLogComplete WLogComplete;
ElementLogComplete(core::Log* l);
ElementLogComplete(torrent::log_buffer* l);
void activate(display::Frame* frame, bool focus = true);
void disable();
@@ -61,9 +61,11 @@ public:
display::Window* window();
private:
void received_update();
WLogComplete* m_window;
core::Log* m_log;
torrent::log_buffer* m_log;
};
}