SOURCES: rtorrent-colors.patch (NEW) - added colors
charles
charles at pld-linux.org
Sat Jul 2 22:48:14 CEST 2005
Author: charles Date: Sat Jul 2 20:48:14 2005 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- added colors
---- Files affected:
SOURCES:
rtorrent-colors.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: SOURCES/rtorrent-colors.patch
diff -u /dev/null SOURCES/rtorrent-colors.patch:1.1
--- /dev/null Sat Jul 2 22:48:14 2005
+++ SOURCES/rtorrent-colors.patch Sat Jul 2 22:48:09 2005
@@ -0,0 +1,124 @@
+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 @@
+ nodelay(stdscr, TRUE);
+ keypad(stdscr, TRUE);
+ curs_set(0);
++ start_color();
+ }
+
+ 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;
+
+ 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();
++
++ m_canvas->print(0, pos, "%c %s",
+ range.first == m_list->get_focus() ? '*' : ' ',
+ d.get_name().c_str());
+-
++
++ if (ratio >= 1.0)
++ col = 1;
++ else if (ratio >= 0.5)
++ 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);
++
++ 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);
++ }
++ 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 @@
+ m_download->get_download().is_tracker_busy() ? 'C' : ' ',
+ (int)(m_download->get_download().get_tracker_timeout() / 1000000),
+ print_download_status(m_download).c_str());
++ 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.4.orig/src/display/window_statusbar.cc 2005-06-07 21:58:18.000000000 +0200
++++ rtorrent-0.2.4/src/display/window_statusbar.cc 2005-06-10 20:50:45.000000000 +0200
+@@ -62,6 +62,7 @@
+ (int)torrent::get_listen_port(),
+ !torrent::get_bind().empty() ? (" Bind: " + torrent::get_bind()).c_str() : "",
+ torrent::get_total_handshakes());
++ m_canvas->set_attr(0, 0, 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_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 @@
+
+ m_canvas->print(std::max(0, (m_canvas->get_width() - (int)m_title.size()) / 2 - 4), 0,
+ "*** %s ***", m_title.c_str());
++ m_canvas->set_attr(0, 0, m_canvas->get_screen_width(), A_REVERSE, 0);
+ }
+
+ }
================================================================
More information about the pld-cvs-commit
mailing list