mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-08 11:12:31 +00:00
Task Scheduler, log viewer pops up and disapperes. good good
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@308 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
+14
-20
@@ -72,20 +72,6 @@ do_shutdown(ui::Control* c) {
|
||||
start_shutdown = false;
|
||||
}
|
||||
|
||||
void
|
||||
test_dir(const std::string& s) {
|
||||
utils::Directory d(s);
|
||||
|
||||
d.update();
|
||||
|
||||
std::cout << "Listing dir \"" << s << '"' << std::endl;
|
||||
|
||||
for (utils::Directory::iterator itr = d.begin(); itr != d.end(); ++itr)
|
||||
std::cout << '"' << *itr << '"' << std::endl;
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
int
|
||||
parse_options(ui::Control* c, int argc, char** argv) {
|
||||
OptionParser optionParser;
|
||||
@@ -126,11 +112,21 @@ register_main_keys(ui::Control* c, input::Bindings* b) {
|
||||
(*b)['\x11'] = sigc::ptr_fun(&set_shutdown);
|
||||
}
|
||||
|
||||
void
|
||||
initialize_core(ui::Control* c) {
|
||||
c->get_core().get_poll().slot_read_stdin(sigc::mem_fun(c->get_input(), &input::Manager::pressed));
|
||||
c->get_core().get_poll().slot_select_interrupted(sigc::ptr_fun(display::Canvas::do_update));
|
||||
|
||||
c->get_core().initialize();
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char** argv) {
|
||||
ui::Control uiControl;
|
||||
input::Bindings inputMain;
|
||||
|
||||
utils::Timer::update();
|
||||
|
||||
try {
|
||||
|
||||
register_signals(&uiControl);
|
||||
@@ -147,10 +143,7 @@ main(int argc, char** argv) {
|
||||
|
||||
register_main_keys(&uiControl, &inputMain);
|
||||
|
||||
uiControl.get_core().get_poll().slot_read_stdin(sigc::mem_fun(uiControl.get_input(), &input::Manager::pressed));
|
||||
uiControl.get_core().get_poll().slot_select_interrupted(sigc::ptr_fun(display::Canvas::do_update));
|
||||
|
||||
uiControl.get_core().initialize();
|
||||
initialize_core(&uiControl);
|
||||
|
||||
load_session_torrents(&uiControl);
|
||||
load_arg_torrents(&uiControl, argv + firstArg, argv + argc);
|
||||
@@ -162,10 +155,11 @@ main(int argc, char** argv) {
|
||||
do_shutdown(&uiControl);
|
||||
|
||||
utils::Timer::update();
|
||||
|
||||
utils::TaskSchedule::perform(utils::Timer::cache());
|
||||
|
||||
uiControl.get_display().do_update();
|
||||
|
||||
uiControl.get_core().get_poll().poll();
|
||||
uiControl.get_core().get_poll().poll(utils::TaskSchedule::get_timeout());
|
||||
}
|
||||
|
||||
display::Canvas::cleanup();
|
||||
|
||||
Reference in New Issue
Block a user