* Added the framework for a download scheduler.

* Added "state_changed" variable to downloads that returns the last
time the download called DownloadList::pause/resume.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@674 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2006-04-25 19:33:53 +00:00
parent 19179bd160
commit c5c9a1ddae
20 changed files with 339 additions and 45 deletions
+8
View File
@@ -53,6 +53,7 @@
#include "core/download.h"
#include "core/manager.h"
#include "core/scheduler.h"
#include "core/view_manager.h"
#include "ui/root.h"
#include "utils/directory.h"
@@ -224,6 +225,11 @@ apply_view_sort_new(Control* control, const std::string& arg) {
control->view_manager()->set_sort_new(name, sortArgs);
}
void
apply_download_scheduler(core::Scheduler* scheduler, __UNUSED const std::string& arg) {
scheduler->update();
}
void
initialize_option_handler(Control* c) {
utils::VariableMap* variables = control->variable();
@@ -284,6 +290,8 @@ initialize_option_handler(Control* c) {
variables->insert("schedule_remove", new utils::VariableStringSlot(rak::value_fn(std::string()),
rak::mem_fn<const std::string&>(c->command_scheduler(), &CommandScheduler::erase)));
variables->insert("download_scheduler", new utils::VariableStringSlot(rak::value_fn(std::string()), rak::bind_ptr_fn(&apply_download_scheduler, c->scheduler())));
variables->insert("send_buffer_size", new utils::VariableValueSlot(rak::mem_fn(torrent::connection_manager(), &torrent::ConnectionManager::send_buffer_size),
rak::mem_fn(torrent::connection_manager(), &torrent::ConnectionManager::set_send_buffer_size)));