mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-11 20:52:30 +00:00
* 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:
@@ -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)));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user