mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-09 15:49:20 +00:00
* UI refactoring, added display::Frame and started cleaning up the
code. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@747 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -36,8 +36,10 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdexcept>
|
||||
#include <torrent/exceptions.h>
|
||||
|
||||
#include "display/frame.h"
|
||||
#include "display/manager.h"
|
||||
#include "display/window_log_complete.h"
|
||||
#include "input/manager.h"
|
||||
|
||||
@@ -52,24 +54,37 @@ ElementLogComplete::ElementLogComplete(core::Log* l) :
|
||||
}
|
||||
|
||||
void
|
||||
ElementLogComplete::activate(Control* c, MItr mItr) {
|
||||
if (m_window != NULL)
|
||||
throw std::logic_error("ui::ElementLogComplete::activate(...) called on an object in the wrong state");
|
||||
ElementLogComplete::activate(display::Frame* frame) {
|
||||
if (is_active())
|
||||
throw torrent::client_error("ui::ElementLogComplete::activate(...) is_active().");
|
||||
|
||||
c->input()->push_front(&m_bindings);
|
||||
control->input()->push_front(&m_bindings);
|
||||
|
||||
*mItr = m_window = new WLogComplete(m_log);
|
||||
m_window = new WLogComplete(m_log);
|
||||
|
||||
m_frame = frame;
|
||||
m_frame->initialize_window(m_window);
|
||||
|
||||
control->display()->schedule(m_window, cachedTime);
|
||||
}
|
||||
|
||||
void
|
||||
ElementLogComplete::disable(Control* c) {
|
||||
if (m_window == NULL)
|
||||
throw std::logic_error("ui::ElementLogComplete::disable(...) called on an object in the wrong state");
|
||||
ElementLogComplete::disable() {
|
||||
if (!is_active())
|
||||
throw torrent::client_error("ui::ElementLogComplete::disable(...) !is_active().");
|
||||
|
||||
c->input()->erase(&m_bindings);
|
||||
control->input()->erase(&m_bindings);
|
||||
|
||||
m_frame->clear();
|
||||
m_frame = NULL;
|
||||
|
||||
delete m_window;
|
||||
m_window = NULL;
|
||||
}
|
||||
|
||||
display::Window*
|
||||
ElementLogComplete::window() {
|
||||
return m_window;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user