mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-13 05:32:31 +00:00
* Show "Hashing:" for torrents that are queued for hashing.
* Allow different min/max peers setting for seeding. Patch by Josef Drexler. * Man page entry for "safe_sync" and "max/min_peers_seed". * The p,o,i,u keys are now bound so they change ElementMenu directly. * Bound ^P and ^N for moving up/down. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@758 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -72,6 +72,23 @@ TextElementValueBase::print(char* first, char* last, Canvas::attributes_list* at
|
||||
if (first == last) {
|
||||
// Do nothing, but ensure that the last attributes are set.
|
||||
|
||||
} else if (m_flags & flag_kb) {
|
||||
// Just use a default width of 5 for now.
|
||||
first += std::max(snprintf(first, last - first + 1, "%5.1f", (double)val / (1 << 10)), 0);
|
||||
|
||||
} else if (m_flags & flag_mb) {
|
||||
// Just use a default width of 8 for now.
|
||||
first += std::max(snprintf(first, last - first + 1, "%8.1f", (double)val / (1 << 20)), 0);
|
||||
|
||||
} else if (m_flags & flag_xb) {
|
||||
|
||||
if (val < (int64_t(1) << 30))
|
||||
first += std::max(snprintf(first, last - first + 1, "%5.1f MB", (double)val / (int64_t(1) << 20)), 0);
|
||||
else if (val < (int64_t(1) << 40))
|
||||
first += std::max(snprintf(first, last - first + 1, "%5.1f GB", (double)val / (int64_t(1) << 30)), 0);
|
||||
else
|
||||
first += std::max(snprintf(first, last - first + 1, "%5.1f TB", (double)val / (int64_t(1) << 40)), 0);
|
||||
|
||||
} else if (m_flags & flag_timer) {
|
||||
if (val == 0)
|
||||
first += std::max(snprintf(first, last - first + 1, "--:--:--"), 0);
|
||||
@@ -96,14 +113,6 @@ TextElementValueBase::print(char* first, char* last, Canvas::attributes_list* at
|
||||
|
||||
first += std::max(snprintf(first, last - first + 1, "%2d:%02d:%02d", u->tm_hour, u->tm_min, u->tm_sec), 0);
|
||||
|
||||
} else if (m_flags & flag_kb) {
|
||||
// Just use a default width of 5 for now.
|
||||
first += std::max(snprintf(first, last - first + 1, "%5.1f", (double)val / (1 << 10)), 0);
|
||||
|
||||
} else if (m_flags & flag_mb) {
|
||||
// Just use a default width of 5 for now.
|
||||
first += std::max(snprintf(first, last - first + 1, "%8.1f", (double)val / (1 << 20)), 0);
|
||||
|
||||
} else {
|
||||
first += std::max(snprintf(first, last - first + 1, "%lld", val), 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user