* Last of the commands converted, cleanup remaining.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1154 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2010-03-27 16:35:15 +00:00
parent bc96dbfa2d
commit 10f665e9c6
24 changed files with 640 additions and 455 deletions
+15 -15
View File
@@ -155,39 +155,39 @@ Download::create_info() {
element->push_column("Created:", te_command("cat=$to_date=$d.creation_date=,\" \",$to_time=$d.creation_date="));
element->push_back("");
element->push_column("Directory:", te_command("d.get_directory="));
element->push_column("Directory:", te_command("d.directory="));
element->push_column("Base Path:", te_command("d.base_path="));
element->push_column("Tied to file:", te_command("d.get_tied_to_file="));
element->push_column("File stats:", te_command("cat=$if=$d.is_multi_file=\\,multi\\,single,\" \",$d.get_size_files=,\" files\""));
element->push_column("Tied to file:", te_command("d.tied_to_file="));
element->push_column("File stats:", te_command("cat=$if=$d.is_multi_file=\\,multi\\,single,\" \",$d.size_files=,\" files\""));
element->push_back("");
element->push_column("Chunks:", te_command("cat=$d.get_completed_chunks=,\" / \",$d.get_size_chunks=,\" * \",$d.get_chunk_size="));
element->push_column("Priority:", te_command("d.get_priority="));
element->push_column("Chunks:", te_command("cat=$d.completed_chunks=,\" / \",$d.size_chunks=,\" * \",$d.chunk_size="));
element->push_column("Priority:", te_command("d.priority="));
element->push_column("Peer exchange:", te_command("cat=$if=$d.peer_exchange=\\,enabled\\,disabled,\\ ,"
"$if=$d.is_pex_active=\\,active\\,$d.is_private=\\,private\\,inactive,"
"\\ (,$d.get_size_pex=,/,$d.get_max_size_pex=,)"));
"\\ (,$d.size_pex=,/,$d.max_size_pex=,)"));
element->push_column("State changed:", te_command("to_elapsed_time=$d.get_state_changed="));
element->push_column("State changed:", te_command("to_elapsed_time=$d.state_changed="));
element->push_back("");
element->push_column("Memory usage:", te_command("cat=$to_mb=$pieces.memory.current=,\" MB\""));
element->push_column("Max memory usage:", te_command("cat=$to_mb=$pieces.memory.max=,\" MB\""));
element->push_column("Free diskspace:", te_command("cat=$to_mb=$d.get_free_diskspace=,\" MB\""));
element->push_column("Free diskspace:", te_command("cat=$to_mb=$d.free_diskspace=,\" MB\""));
element->push_column("Safe diskspace:", te_command("cat=$to_mb=$pieces.sync.safe_free_diskspace=,\" MB\""));
element->push_back("");
element->push_column("Connection type:", te_command("d.get_connection_current="));
element->push_column("Connection type:", te_command("d.connection_current="));
element->push_column("Safe sync:", te_command("if=$pieces.sync.always_safe=,yes,no"));
element->push_column("Send buffer:", te_command("cat=$to_kb=$network.send_buffer.size=,\" KB\""));
element->push_column("Receive buffer:", te_command("cat=$to_kb=$network.receive_buffer.size=,\" KB\""));
// TODO: Define a custom command for this and use $argument.0 instead of looking up the name multiple times?
element->push_column("Throttle:", te_command("branch=d.get_throttle_name=,\""
"cat=$d.get_throttle_name=,\\\" [Max \\\","
"$to_throttle=$get_throttle_up_max=$d.get_throttle_name=,\\\"/\\\","
"$to_throttle=$get_throttle_down_max=$d.get_throttle_name=,\\\" KB] [Rate \\\","
"$to_kb=$get_throttle_up_rate=$d.get_throttle_name=,\\\"/\\\","
"$to_kb=$get_throttle_down_rate=$d.get_throttle_name=,\\\" KB]\\\"\","
element->push_column("Throttle:", te_command("branch=d.throttle_name=,\""
"cat=$d.throttle_name=,\\\" [Max \\\","
"$to_throttle=$get_throttle_up_max=$d.throttle_name=,\\\"/\\\","
"$to_throttle=$get_throttle_down_max=$d.throttle_name=,\\\" KB] [Rate \\\","
"$to_kb=$get_throttle_up_rate=$d.throttle_name=,\\\"/\\\","
"$to_kb=$get_throttle_down_rate=$d.throttle_name=,\\\" KB]\\\"\","
"cat=\"global\""));
element->push_back("");
+2 -2
View File
@@ -313,8 +313,8 @@ DownloadList::receive_exit_input(Input type) {
if ((*current_view()->focus())->is_open())
throw torrent::input_error("Cannot change root directory on an open download.");
rpc::call_command("d.set_directory", rak::trim(input->str()), rpc::make_target(*current_view()->focus()));
control->core()->push_log_std("New root directory \"" + rpc::call_command_string("d.get_directory", rpc::make_target(*current_view()->focus())) + "\" for torrent.");
rpc::call_command("d.directory.set", rak::trim(input->str()), rpc::make_target(*current_view()->focus()));
control->core()->push_log_std("New root directory \"" + rpc::call_command_string("d.directory", rpc::make_target(*current_view()->focus())) + "\" for torrent.");
break;
case INPUT_COMMAND:
+6 -6
View File
@@ -64,8 +64,8 @@ ElementDownloadList::ElementDownloadList() :
throw torrent::internal_error("View \"main\" must be present to initialize the main display.");
m_bindings['\x13'] = sigc::bind(sigc::mem_fun(*this, &ElementDownloadList::receive_command), "d.start=");
m_bindings['\x04'] = sigc::bind(sigc::mem_fun(*this, &ElementDownloadList::receive_command), "branch=d.get_state=,d.stop=,d.erase=");
m_bindings['\x0B'] = sigc::bind(sigc::mem_fun(*this, &ElementDownloadList::receive_command), "d.set_ignore_commands=1; d.stop=; d.close=");
m_bindings['\x04'] = sigc::bind(sigc::mem_fun(*this, &ElementDownloadList::receive_command), "branch=d.state=,d.stop=,d.erase=");
m_bindings['\x0B'] = sigc::bind(sigc::mem_fun(*this, &ElementDownloadList::receive_command), "d.ignore_commands.set=1; d.stop=; d.close=");
m_bindings['\x12'] = sigc::bind(sigc::mem_fun(*this, &ElementDownloadList::receive_command), "d.check_hash=");
m_bindings['\x05'] = sigc::bind(sigc::mem_fun(*this, &ElementDownloadList::receive_command),
"f.multicall=,f.set_create_queued=,f.set_resize_queued=; print=\"Queued create/resize of files in torrent.\"");
@@ -74,13 +74,13 @@ ElementDownloadList::ElementDownloadList() :
m_bindings['-'] = sigc::mem_fun(*this, &ElementDownloadList::receive_prev_priority);
m_bindings['T'-'@']= sigc::mem_fun(*this, &ElementDownloadList::receive_cycle_throttle);
m_bindings['I'] = sigc::bind(sigc::mem_fun(*this, &ElementDownloadList::receive_command),
"branch=d.get_ignore_commands=,"
"{d.set_ignore_commands=0, print=\"Torrent set to heed commands.\"},"
"{d.set_ignore_commands=1, print=\"Torrent set to ignore commands.\"}");
"branch=d.ignore_commands=,"
"{d.ignore_commands.set=0, print=\"Torrent set to heed commands.\"},"
"{d.ignore_commands.set=1, print=\"Torrent set to ignore commands.\"}");
m_bindings['B'-'@']= sigc::bind(sigc::mem_fun(*this, &ElementDownloadList::receive_command),
"branch=d.is_active=,"
"{print=\"Cannot enable initial seeding on an active download.\"},"
"{d.set_connection_seed=initial_seed, print=\"Enabled initial seeding for the selected download.\"}");
"{d.connection_seed.set=initial_seed, print=\"Enabled initial seeding for the selected download.\"}");
m_bindings['U'] = sigc::bind(sigc::mem_fun(*this, &ElementDownloadList::receive_command), "d.delete_tied=; print=\"Cleared tied to file association for the selected download.\"");
+7 -7
View File
@@ -103,18 +103,18 @@ ElementPeerList::create_info() {
element->push_back("Peer info:");
element->push_back("");
element->push_column("Address:", te_command("cat=$p.get_address=,:,$p.get_port="));
element->push_column("Id:", te_command("p.get_id_html="));
element->push_column("Client:", te_command("p.get_client_version="));
element->push_column("Options:", te_command("p.get_options_str="));
element->push_column("Address:", te_command("cat=$p.address=,:,$p.port="));
element->push_column("Id:", te_command("p.id_html="));
element->push_column("Client:", te_command("p.client_version="));
element->push_column("Options:", te_command("p.options_str="));
element->push_column("Connected:", te_command("if=$p.is_incoming=,incoming,outgoing"));
element->push_column("Encrypted:", te_command("if=$p.is_encrypted=,yes,$p.is_obfuscated=,handshake,no"));
element->push_back("");
element->push_column("Snubbed:", te_command("if=$p.is_snubbed=,yes,no"));
element->push_column("Done:", te_command("p.get_completed_percent="));
element->push_column("Rate:", te_command("cat=$to_kb=$p.get_up_rate=,\\ KB\\ ,$to_kb=$p.get_down_rate=,\\ KB"));
element->push_column("Total:", te_command("cat=$to_kb=$p.get_up_total=,\\ KB\\ ,$to_kb=$p.get_down_total=,\\ KB"));
element->push_column("Done:", te_command("p.completed_percent="));
element->push_column("Rate:", te_command("cat=$to_kb=$p.up_rate=,\\ KB\\ ,$to_kb=$p.down_rate=,\\ KB"));
element->push_column("Total:", te_command("cat=$to_kb=$p.up_total=,\\ KB\\ ,$to_kb=$p.down_total=,\\ KB"));
element->set_column_width(element->column_width() + 1);
element->set_error_handler(new display::TextElementCString("No peer selected."));
+1 -1
View File
@@ -122,7 +122,7 @@ Root::cleanup() {
const char*
Root::get_throttle_keys() {
const std::string& keyLayout = rpc::call_command_string("get_key_layout");
const std::string& keyLayout = rpc::call_command_string("key_layout");
if (strcasecmp(keyLayout.c_str(), "azerty") == 0)
return "qwQWsxSXdcDC";