Added setting for session directory.

Added support for quotation in settings.

Added key for changing the priority of all files in a torrent.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@477 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-06-26 19:51:20 +00:00
parent 28b369dc83
commit 2c5ce1989a
15 changed files with 118 additions and 64 deletions
+14 -2
View File
@@ -26,6 +26,7 @@
#include <torrent/torrent.h>
#include <netinet/in.h>
#include "utils/directory.h"
#include "ui/control.h"
#include "option_handler_rules.h"
@@ -38,15 +39,18 @@ validate_ip(const std::string& arg) {
return inet_aton(arg.c_str(), &addr);
}
// We consider an empty string to be valid as this allows us to
// disable options.
bool
validate_directory(const std::string& arg) {
//return arg.empty() || utils::Directory(arg).is_valid();
return true;
}
bool
validate_port_range(const std::string& arg) {
int a, b;
return std::sscanf(arg.c_str(), "%i-%i", &a, &b) == 2 &&
a <= b && a > 0 && b < (1 << 16);
}
@@ -93,7 +97,10 @@ apply_download_max_uploads(ui::Control* m, int arg) {
void
apply_download_directory(ui::Control* m, const std::string& arg) {
m->get_core().get_download_list().slot_map_insert().insert("1_directory", sigc::bind(sigc::mem_fun(&core::Download::set_root_directory), arg));
if (!arg.empty())
m->get_core().get_download_list().slot_map_insert().insert("1_directory", sigc::bind(sigc::mem_fun(&core::Download::set_root_directory), arg));
else
m->get_core().get_download_list().slot_map_insert().erase("1_directory");
}
void
@@ -152,3 +159,8 @@ apply_check_hash(ui::Control* m, const std::string& arg) {
else
m->get_core().get_download_list().slot_map_finished().erase("1_check_hash");
}
void
apply_session_directory(ui::Control* m, const std::string& arg) {
m->get_core().get_download_store().use(arg);
}