* 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:
rakshasa
2006-07-26 21:41:09 +00:00
parent ef90f0f51e
commit fc76a11d71
41 changed files with 889 additions and 471 deletions
+16 -10
View File
@@ -36,7 +36,7 @@
#include "config.h"
#include <stdexcept>
#include <torrent/exceptions.h>
#include "display/window_download_chunks_seen.h"
#include "input/manager.h"
@@ -60,26 +60,32 @@ ElementChunksSeen::ElementChunksSeen(core::Download* d) :
}
void
ElementChunksSeen::activate(Control* c, MItr mItr) {
if (m_window != NULL)
throw std::logic_error("ui::ElementChunksSeen::activate(...) called on an object in the wrong state");
ElementChunksSeen::activate(display::Frame* frame) {
if (is_active())
throw torrent::client_error("ui::ElementChunksSeen::activate(...) is_active().");
c->input()->push_front(&m_bindings);
control->input()->push_front(&m_bindings);
*mItr = m_window = new WChunksSeen(m_download, &m_focus);
m_window = new WChunksSeen(m_download, &m_focus);
m_frame = frame;
}
void
ElementChunksSeen::disable(Control* c) {
if (m_window == NULL)
throw std::logic_error("ui::ElementChunksSeen::disable(...) called on an object in the wrong state");
ElementChunksSeen::disable() {
if (!is_active())
throw torrent::client_error("ui::ElementChunksSeen::disable(...) !is_active().");
c->input()->erase(&m_bindings);
control->input()->erase(&m_bindings);
delete m_window;
m_window = NULL;
}
display::Window*
ElementChunksSeen::window() {
return m_window;
}
// void
// ElementChunksSeen::receive_disable() {
// if (m_window == NULL)