mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-16 15:12:30 +00:00
Created a root ui.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@321 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+3
-1
@@ -5,6 +5,8 @@ libsub_ui_a_SOURCES = \
|
||||
download.cc \
|
||||
download.h \
|
||||
download_list.cc \
|
||||
download_list.h
|
||||
download_list.h \
|
||||
root.cc \
|
||||
root.h
|
||||
|
||||
INCLUDES = -I$(srcdir) -I$(srcdir)/.. -I$(top_srcdir)
|
||||
|
||||
@@ -3,8 +3,13 @@
|
||||
|
||||
#include <sigc++/slot.h>
|
||||
|
||||
#include "core/download_list.h"
|
||||
#include "utils/task.h"
|
||||
|
||||
namespace input {
|
||||
class Bindings;
|
||||
}
|
||||
|
||||
namespace display {
|
||||
class WindowDownloadList;
|
||||
class WindowHttpQueue;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
#ifndef RTORRENT_UI_ROOT_H
|
||||
#define RTORRENT_UI_ROOT_H
|
||||
|
||||
#include "input/bindings.h"
|
||||
|
||||
namespace ui {
|
||||
|
||||
class DownloadList;
|
||||
|
||||
class Root {
|
||||
public:
|
||||
Root(Control* c) : m_shutdownReceived(false), m_control(c), m_downloadList(NULL) {}
|
||||
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
bool get_shutdown_received() { return m_shutdownReceived; }
|
||||
void set_shutdown_received(bool v) { m_shutdownReceived = v; }
|
||||
|
||||
private:
|
||||
void setup_keys();
|
||||
|
||||
bool m_shutdownReceived;
|
||||
|
||||
Control* m_control;
|
||||
DownloadList* m_downloadList;
|
||||
|
||||
input::Bindings m_bindings;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user