mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-09 23:59:22 +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,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)
|
||||
|
||||
Reference in New Issue
Block a user