* Added TextElementBranch that uses a slot as the conditional.

* Added timeout to WindowText and updated download and peer info.

* Moved default http agent string to rtorrent/configure.ac.

* Periodic syncing of chunks now tries to only sync tightly packed
  ranges of chunks unless timeout_sync has been reached.

* ChunkManager now checks if max memory is set to RLIM_INFINITY, if so
  use 2^32.

* Added safe_sync option that forces MS_SYNC to be used before
  unmapping chunks.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@757 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2006-08-13 23:02:13 +00:00
parent 34258bcfb2
commit 4d988fccb9
15 changed files with 172 additions and 23 deletions
+3
View File
@@ -50,6 +50,7 @@
#include "display/window_title.h"
#include "display/window_download_statusbar.h"
#include "display/text_element_lambda.h"
#include "display/text_element_helpers.h"
#include "control.h"
@@ -136,6 +137,7 @@ Download::create_info() {
ElementText* element = new ElementText(m_download);
element->set_column(1);
element->set_interval(1);
// Get these bindings with some kind of string map.
@@ -161,6 +163,7 @@ Download::create_info() {
element->push_column("Safe diskspace:", te_value(&torrent::ChunkManager::safe_free_diskspace, value_base::flag_mb), " MB");
element->push_back("");
element->push_column("Safe sync:", display::text_element_branch_void(rak::make_mem_fun(torrent::chunk_manager(), &torrent::ChunkManager::safe_sync), te_string("yes"), te_string("no")));
element->push_column("Send buffer:", te_value(&torrent::ConnectionManager::send_buffer_size, value_base::flag_kb), " KB");
element->push_column("Receive buffer:", te_value(&torrent::ConnectionManager::receive_buffer_size, value_base::flag_kb), " KB");
+8 -4
View File
@@ -44,6 +44,7 @@
#include "display/frame.h"
#include "display/manager.h"
#include "display/text_element_helpers.h"
#include "display/text_element_lambda.h"
#include "display/window_peer_list.h"
#include "input/manager.h"
@@ -92,6 +93,7 @@ ElementPeerList::create_info() {
ElementText* element = new ElementText(NULL);
element->set_column(1);
element->set_interval(1);
// Get these bindings with some kind of string map.
@@ -102,12 +104,14 @@ ElementPeerList::create_info() {
display::text_element_string_slot(rak::on(std::mem_fun(&torrent::Peer::address), std::ptr_fun(&te_address))), ":",
display::text_element_value_slot(rak::on(std::mem_fun(&torrent::Peer::address), std::ptr_fun(&te_port))));
element->push_column("Id:", display::text_element_string_slot(std::mem_fun(&torrent::Peer::id), string_base::flag_escape_html));
element->push_column("Client:", display::text_element_string_slot(rak::on(std::mem_fun(&torrent::Peer::id), rak::make_mem_fun(control->client_info(), &display::ClientInfo::str_str))));
element->push_column("Options:", display::text_element_string_slot(std::mem_fun(&torrent::Peer::options), string_base::flag_escape_hex | string_base::flag_fixed_width, 0, 8));
element->push_column("Id:", display::text_element_string_slot(std::mem_fun(&torrent::Peer::id), string_base::flag_escape_html));
element->push_column("Client:", display::text_element_string_slot(rak::on(std::mem_fun(&torrent::Peer::id), rak::make_mem_fun(control->client_info(), &display::ClientInfo::str_str))));
element->push_column("Options:", display::text_element_string_slot(std::mem_fun(&torrent::Peer::options), string_base::flag_escape_hex | string_base::flag_fixed_width, 0, 8));
element->push_column("Connected:", display::text_element_branch(std::mem_fun(&torrent::Peer::is_incoming), te_string("incoming"), te_string("outgoing")));
element->push_back("");
element->push_column("Done:", display::text_element_value_slot(rak::on(std::mem_fun(&torrent::Peer::bitfield), std::ptr_fun(&te_bitfield_percentage))));
element->push_column("Snubbed:", display::text_element_branch(std::mem_fun(&torrent::Peer::is_snubbed), te_string("yes"), te_string("no")));
element->push_column("Done:", display::text_element_value_slot(rak::on(std::mem_fun(&torrent::Peer::bitfield), std::ptr_fun(&te_bitfield_percentage))));
element->push_column("Rate:",
display::text_element_value_slot(rak::on(std::mem_fun(&torrent::Peer::up_rate), std::mem_fun(&torrent::Rate::rate)), value_base::flag_kb), " / ",
display::text_element_value_slot(rak::on(std::mem_fun(&torrent::Peer::down_rate), std::mem_fun(&torrent::Rate::rate)), value_base::flag_kb), " KB");
+3
View File
@@ -66,6 +66,9 @@ public:
void* object() const { return m_window->object(); }
void set_object(void* object) { m_window->set_object(object); m_window->mark_dirty(); }
uint32_t interval() const { return m_window->interval(); }
void set_interval(uint32_t i) { m_window->set_interval(i); m_window->mark_dirty(); }
void activate(display::Frame* frame, bool focus = false);
void disable();