SOURCES: rtorrent-colors.patch - updated to 0.3.0
charles
charles at pld-linux.org
Fri Jul 29 20:20:06 CEST 2005
Author: charles Date: Fri Jul 29 18:20:06 2005 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- updated to 0.3.0
---- Files affected:
SOURCES:
rtorrent-colors.patch (1.2 -> 1.3)
---- Diffs:
================================================================
Index: SOURCES/rtorrent-colors.patch
diff -u SOURCES/rtorrent-colors.patch:1.2 SOURCES/rtorrent-colors.patch:1.3
--- SOURCES/rtorrent-colors.patch:1.2 Fri Jul 15 13:16:32 2005
+++ SOURCES/rtorrent-colors.patch Fri Jul 29 20:20:01 2005
@@ -1,7 +1,7 @@
-diff -ru -x Makefile -x '*.avi*' -x 'config.*' -x .deps -x stamp-h1 rtorrent-0.2.4.orig/src/display/canvas.cc rtorrent-0.2.4/src/display/canvas.cc
---- rtorrent-0.2.4.orig/src/display/canvas.cc 2005-03-16 21:35:55.000000000 +0100
-+++ rtorrent-0.2.4/src/display/canvas.cc 2005-06-10 19:35:43.000000000 +0200
-@@ -40,6 +40,7 @@
+diff -U 3 -H -d -r -N -- rtorrent-0.3.0.orig/src/display/canvas.cc rtorrent-0.3.0/src/display/canvas.cc
+--- rtorrent-0.3.0.orig/src/display/canvas.cc 2005-07-01 22:45:24.000000000 +0200
++++ rtorrent-0.3.0/src/display/canvas.cc 2005-07-29 18:09:37.000000000 +0200
+@@ -54,6 +54,7 @@
nodelay(stdscr, TRUE);
keypad(stdscr, TRUE);
curs_set(0);
@@ -9,101 +9,170 @@
}
void
-diff -ru -x Makefile -x '*.avi*' -x 'config.*' -x .deps -x stamp-h1 rtorrent-0.2.4.orig/src/display/window_download_list.cc rtorrent-0.2.4/src/display/window_download_list.cc
---- rtorrent-0.2.4.orig/src/display/window_download_list.cc 2005-03-18 17:03:05.000000000 +0100
-+++ rtorrent-0.2.4/src/display/window_download_list.cc 2005-06-12 18:43:01.000000000 +0200
-@@ -65,29 +65,68 @@
- ++range.second;
+diff -U 3 -H -d -r -N -- rtorrent-0.3.0.orig/src/display/utils.cc rtorrent-0.3.0/src/display/utils.cc
+--- rtorrent-0.3.0.orig/src/display/utils.cc 2005-07-13 14:04:47.000000000 +0200
++++ rtorrent-0.3.0/src/display/utils.cc 2005-07-29 19:22:16.000000000 +0200
+@@ -54,7 +54,7 @@
+ }
+
+ char*
+-print_download_info(char* buf, unsigned int length, core::Download* d) {
++print_download_info(char* buf, unsigned int length, core::Download* d, double ratio) {
+ char* last = buf + length;
+
+ buf += std::max(0, snprintf(buf, last - buf, "Torrent: "));
+@@ -68,11 +68,12 @@
+ buf += std::max(0, snprintf(buf, last - buf, "%6.1f / %6.1f MB",
+ (double)d->get_download().get_bytes_done() / (double)(1 << 20),
+ (double)d->get_download().get_bytes_total() / (double)(1 << 20)));
+-
+- buf += std::max(0, snprintf(buf, last - buf, " Rate: %5.1f / %5.1f KiB Uploaded: %.1f MiB",
++
++ buf += std::max(0, snprintf(buf, last - buf, " Rate: %5.1f / %5.1f KiB Uploaded: %6.1f MiB Ratio: %5.2f",
+ (double)d->get_download().get_write_rate().rate() / (1 << 10),
+ (double)d->get_download().get_read_rate().rate() / (1 << 10),
+- (double)d->get_download().get_write_rate().total() / (1 << 20)));
++ (double)d->get_download().get_write_rate().total() / (1 << 20),
++ ratio));
+
+ return buf;
+ }
+diff -U 3 -H -d -r -N -- rtorrent-0.3.0.orig/src/display/utils.h rtorrent-0.3.0/src/display/utils.h
+--- rtorrent-0.3.0.orig/src/display/utils.h 2005-07-13 13:59:51.000000000 +0200
++++ rtorrent-0.3.0/src/display/utils.h 2005-07-29 18:09:37.000000000 +0200
+@@ -51,7 +51,7 @@
+ namespace display {
+
+ char* print_download_title(char* buf, unsigned int length, core::Download* d);
+-char* print_download_info(char* buf, unsigned int length, core::Download* d);
++char* print_download_info(char* buf, unsigned int length, core::Download* d, double ratio);
+ char* print_download_status(char* buf, unsigned int length, core::Download* d);
+
+ std::string print_hhmmss(utils::Timer t);
+diff -U 3 -H -d -r -N -- rtorrent-0.3.0.orig/src/display/window_download_list.cc rtorrent-0.3.0/src/display/window_download_list.cc
+--- rtorrent-0.3.0.orig/src/display/window_download_list.cc 2005-07-13 14:04:39.000000000 +0200
++++ rtorrent-0.3.0/src/display/window_download_list.cc 2005-07-29 19:51:23.000000000 +0200
+@@ -36,6 +36,8 @@
+
+ #include "config.h"
+
++#include <torrent/rate.h>
++
+ #include "core/download.h"
+ #include "rak/algorithm.h"
+
+@@ -80,22 +82,59 @@
int pos = 0;
-+ double ratio = 0;
-+ int col = 0;
+ init_pair(1, COLOR_GREEN, COLOR_BLACK);
+ init_pair(2, COLOR_YELLOW, COLOR_BLACK);
+ init_pair(3, COLOR_RED, COLOR_BLACK);
+ init_pair(4, COLOR_BLUE, COLOR_BLACK);
-+
++
while (range.first != range.second) {
- torrent::Download& d = (*range.first)->get_download();
-
-- m_canvas->print(0, pos++, "%c %s",
-+ if (d.get_bytes_done()==0)
-+ ratio = 0;
-+ else
-+ ratio = (double)d.get_bytes_up() / (double)d.get_bytes_done();
+ char buffer[m_canvas->get_width() - 2];
+ char* position;
+ char* last = buffer + m_canvas->get_width() - 2;
++ int col = 0;
++ double ratio = 0;
++ core::Download* d = *range.first;
++
++ if (d->get_download().get_bytes_done())
++ ratio = (double)d->get_download().get_write_rate().total() / (double)d->get_download().get_bytes_done();
+
-+ m_canvas->print(0, pos, "%c %s",
- range.first == m_list->get_focus() ? '*' : ' ',
- d.get_name().c_str());
--
-+
+ if (ratio >= 1.0)
-+ col = 1;
++ col = 1;
+ else if (ratio >= 0.5)
-+ col = 2;
++ col = 2;
+ else
-+ col = 3;
-+ if (d.is_active())
-+ m_canvas->set_attr(0, pos++, m_canvas->get_screen_width(), ((*range.first)->is_done())?0:A_BOLD, ((*range.first)->is_done())?col:4);
-+ else pos++;
-+
- if ((*range.first)->is_open() && (*range.first)->is_done())
-- m_canvas->print(0, pos++, "%c Torrent: Done %10.1f MiB Rate: %5.1f / %5.1f KiB Uploaded: %.1f MiB",
-+ m_canvas->print(0, pos, "%c Torrent: Done %10.1f MiB Rate: %5.1f / %5.1f KiB Uploaded: %6.1f MiB Ratio: %5.2f",
- range.first == m_list->get_focus() ? '*' : ' ',
- (double)d.get_bytes_total() / (double)(1 << 20),
- (double)d.get_rate_up() / 1024.0,
- (double)d.get_rate_down() / 1024.0,
-- (double)d.get_bytes_up() / (double)(1 << 20));
-+ (double)d.get_bytes_up() / (double)(1 << 20),
-+ ratio);
- else
-- m_canvas->print(0, pos++, "%c Torrent: %6.1f / %6.1f MiB Rate: %5.1f / %5.1f KiB Uploaded: %.1f MiB",
-+ m_canvas->print(0, pos, "%c Torrent: %6.1f / %6.1f MiB Rate: %5.1f / %5.1f KiB Uploaded: %6.1f MiB Ratio: %5.2f",
- range.first == m_list->get_focus() ? '*' : ' ',
- (double)d.get_bytes_done() / (double)(1 << 20),
- (double)d.get_bytes_total() / (double)(1 << 20),
- (double)d.get_rate_up() / 1024.0,
- (double)d.get_rate_down() / 1024.0,
-- (double)d.get_bytes_up() / (double)(1 << 20));
-+ (double)d.get_bytes_up() / (double)(1 << 20),
-+ ratio);
-+
++ col = 3;
+
+ position = print_download_title(buffer, last - buffer, *range.first);
+- m_canvas->print(0, pos++, "%c %s", range.first == m_list->get_focus() ? '*' : ' ', buffer);
+-
+- position = print_download_info(buffer, last - buffer, *range.first);
+- m_canvas->print(0, pos++, "%c %s", range.first == m_list->get_focus() ? '*' : ' ', buffer);
++ m_canvas->print(0, pos, "%c %s", range.first == m_list->get_focus() ? '*' : ' ', buffer);
++
++ if (d->get_download().is_open())
++ m_canvas->set_attr(0, pos, m_canvas->get_screen_width(), (d->is_done())?0:A_BOLD, (d->is_done())?col:4);
++ pos++;
++
++ position = print_download_info(buffer, last - buffer, *range.first, ratio);
++ m_canvas->print(0, pos, "%c %s", range.first == m_list->get_focus() ? '*' : ' ', buffer);
++
+ if (col > 0)
-+ m_canvas->set_attr(83, pos, 5, 0, col);
-+
-+ if (d.get_bytes_total() > 0) {
-+ double per = (double)d.get_bytes_done() / (double)d.get_bytes_total();
-+ if (per >= 1.0)
-+ col = 1;
-+ else if (per>=0.5)
-+ col = 2;
-+ else
-+ col = 3;
-+ m_canvas->set_attr(11, pos++, 6, 0, col);
++ m_canvas->set_attr(83, pos, 5, 0, col);
++
++ if (d->get_download().get_bytes_total() > 0) {
++ double per = (double)d->get_download().get_bytes_done() / (double)d->get_download().get_bytes_total();
++ if (per >= 1.0)
++ col = 1;
++ else if (per >= 0.5)
++ col = 2;
++ else
++ col = 3;
++ m_canvas->set_attr(11, pos, 6, 0, col);
+ }
-+ else pos++;
-
- m_canvas->print(0, pos++, "%c %s",
- range.first == m_list->get_focus() ? '*' : ' ',
-diff -ru -x Makefile -x '*.avi*' -x 'config.*' -x .deps -x stamp-h1 rtorrent-0.2.4.orig/src/display/window_download_statusbar.cc rtorrent-0.2.4/src/display/window_download_statusbar.cc
---- rtorrent-0.2.4.orig/src/display/window_download_statusbar.cc 2005-03-16 21:35:55.000000000 +0100
-+++ rtorrent-0.2.4/src/display/window_download_statusbar.cc 2005-06-10 21:06:28.000000000 +0200
-@@ -67,6 +67,9 @@
++ pos++;
+
+ position = print_download_status(buffer, last - buffer, *range.first);
+ m_canvas->print(0, pos++, "%c %s", range.first == m_list->get_focus() ? '*' : ' ', buffer);
+
+ ++range.first;
+- }
++ }
+ }
+
+ }
+diff -U 3 -H -d -r -N -- rtorrent-0.3.0.orig/src/display/window_download_list.h rtorrent-0.3.0/src/display/window_download_list.h
+--- rtorrent-0.3.0.orig/src/display/window_download_list.h 2005-07-13 13:58:23.000000000 +0200
++++ rtorrent-0.3.0/src/display/window_download_list.h 2005-07-29 19:39:40.000000000 +0200
+@@ -44,6 +44,11 @@
+ #include "core/download_list.h"
+ #include "utils/list_focus.h"
+
++
++namespace core {
++ class Download;
++}
++
+ namespace display {
+
+ class WindowDownloadList : public Window {
+diff -U 3 -H -d -r -N -- rtorrent-0.3.0.orig/src/display/window_download_statusbar.cc rtorrent-0.3.0/src/display/window_download_statusbar.cc
+--- rtorrent-0.3.0.orig/src/display/window_download_statusbar.cc 2005-07-13 14:03:51.000000000 +0200
++++ rtorrent-0.3.0/src/display/window_download_statusbar.cc 2005-07-29 19:29:40.000000000 +0200
+@@ -60,8 +60,13 @@
+ char buffer[m_canvas->get_width() - 2];
+ char* position;
+ char* last = buffer + m_canvas->get_width() - 2;
++ double ratio = 0;
++ core::Download* d = m_download;
+
+- position = print_download_info(buffer, last - buffer, m_download);
++ if (d->get_download().get_bytes_done())
++ ratio = (double)d->get_download().get_write_rate().total() / (double)d->get_download().get_bytes_done();
++
++ position = print_download_info(buffer, last - buffer, m_download, ratio);
+ m_canvas->print(0, 0, "%s", buffer);
+
+ // if (m_download->get_download().get_chunks_done() != m_download->get_download().get_chunks_total() || !m_download->get_download().is_open())
+@@ -91,6 +96,9 @@
m_download->get_download().is_tracker_busy() ? 'C' : ' ',
(int)(m_download->get_download().get_tracker_timeout() / 1000000),
- print_download_status(m_download).c_str());
+ buffer);
+ m_canvas->set_attr(0, 0, m_canvas->get_screen_width(), A_REVERSE, 0);
+ m_canvas->set_attr(0, 1, m_canvas->get_screen_width(), A_REVERSE, 0);
+ m_canvas->set_attr(0, 2, m_canvas->get_screen_width(), A_REVERSE, 0);
}
}
-diff -ru -x Makefile -x '*.avi*' -x 'config.*' -x .deps -x stamp-h1 rtorrent-0.2.4.orig/src/display/window_statusbar.cc rtorrent-0.2.4/src/display/window_statusbar.cc
---- rtorrent-0.2.7/src/display/window_statusbar.cc.orig 2005-07-06 12:34:37.000000000 +0200
-+++ rtorrent-0.2.7/src/display/window_statusbar.cc 2005-07-15 13:11:22.000000000 +0200
-@@ -85,6 +85,7 @@
+diff -U 3 -H -d -r -N -- rtorrent-0.3.0.orig/src/display/window_statusbar.cc rtorrent-0.3.0/src/display/window_statusbar.cc
+--- rtorrent-0.3.0.orig/src/display/window_statusbar.cc 2005-07-18 21:10:24.000000000 +0200
++++ rtorrent-0.3.0/src/display/window_statusbar.cc 2005-07-29 18:09:37.000000000 +0200
+@@ -86,6 +86,7 @@
torrent::get_max_open_sockets());
m_canvas->print(m_canvas->get_width() - pos, 0, "%s", buf);
@@ -111,10 +180,10 @@
}
}
-diff -ru -x Makefile -x '*.avi*' -x 'config.*' -x .deps -x stamp-h1 rtorrent-0.2.4.orig/src/display/window_title.cc rtorrent-0.2.4/src/display/window_title.cc
---- rtorrent-0.2.4.orig/src/display/window_title.cc 2005-03-16 21:35:55.000000000 +0100
-+++ rtorrent-0.2.4/src/display/window_title.cc 2005-06-10 20:57:15.000000000 +0200
-@@ -39,6 +39,7 @@
+diff -U 3 -H -d -r -N -- rtorrent-0.3.0.orig/src/display/window_title.cc rtorrent-0.3.0/src/display/window_title.cc
+--- rtorrent-0.3.0.orig/src/display/window_title.cc 2005-07-01 22:45:24.000000000 +0200
++++ rtorrent-0.3.0/src/display/window_title.cc 2005-07-29 18:09:37.000000000 +0200
+@@ -53,6 +53,7 @@
m_canvas->print(std::max(0, (m_canvas->get_width() - (int)m_title.size()) / 2 - 4), 0,
"*** %s ***", m_title.c_str());
================================================================
---- CVS-web:
http://cvs.pld-linux.org/SOURCES/rtorrent-colors.patch?r1=1.2&r2=1.3&f=u
More information about the pld-cvs-commit
mailing list