Created a root ui.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@321 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-03-03 21:27:27 +00:00
parent fd0c10d962
commit 8d36f7c374
5 changed files with 90 additions and 35 deletions
+37
View File
@@ -0,0 +1,37 @@
#include "config.h"
#include <sigc++/bind.h>
#include "control.h"
#include "download_list.h"
#include "root.h"
namespace ui {
void
Root::init() {
setup_keys();
m_downloadList = new DownloadList(m_control);
m_downloadList->activate();
m_downloadList->slot_open_uri(sigc::mem_fun(m_control->get_core(), &core::Manager::insert));
}
void
Root::cleanup() {
delete m_downloadList;
m_control->get_input().erase(&m_bindings);
}
void
Root::setup_keys() {
m_control->get_input().push_back(&m_bindings);
m_bindings[KEY_RESIZE] = sigc::mem_fun(m_control->get_display(), &display::Manager::adjust_layout);
m_bindings['\x11'] = sigc::bind(sigc::mem_fun(*this, &Root::set_shutdown_received), true);
}
}