SOURCES: rtorrent-colors.patch - updated for 0.6.1

charles charles at pld-linux.org
Mon Aug 21 15:00:57 CEST 2006


Author: charles                      Date: Mon Aug 21 13:00:57 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- updated for 0.6.1

---- Files affected:
SOURCES:
   rtorrent-colors.patch (1.13 -> 1.14) 

---- Diffs:

================================================================
Index: SOURCES/rtorrent-colors.patch
diff -u SOURCES/rtorrent-colors.patch:1.13 SOURCES/rtorrent-colors.patch:1.14
--- SOURCES/rtorrent-colors.patch:1.13	Mon Jul 10 18:40:30 2006
+++ SOURCES/rtorrent-colors.patch	Mon Aug 21 15:00:52 2006
@@ -1,6 +1,6 @@
---- rtorrent-0.5.0/src/display/canvas.cc.orig	2006-02-11 17:12:24.000000000 +0100
-+++ rtorrent-0.5.0/src/display/canvas.cc	2006-05-04 14:40:32.000000000 +0200
-@@ -65,6 +65,7 @@
+--- rtorrent-0.6.1/src/display/canvas.cc.orig	2006-08-11 12:45:46.000000000 +0200
++++ rtorrent-0.6.1/src/display/canvas.cc	2006-08-20 16:33:39.528724000 +0200
+@@ -88,6 +88,7 @@
    nodelay(stdscr, TRUE);
    keypad(stdscr, TRUE);
    curs_set(0);
@@ -8,12 +8,12 @@
  }
  
  void
---- rtorrent-0.5.0/src/display/window_download_statusbar.cc.orig	2006-03-31 23:41:20.000000000 +0200
-+++ rtorrent-0.5.0/src/display/window_download_statusbar.cc	2006-05-04 14:34:05.000000000 +0200
-@@ -88,6 +88,11 @@
- 		  m_download->tracker_list()->is_busy() ? 'C' : ' ',
- 		  (int)(m_download->download()->tracker_list().timeout() / 1000000),
- 		  buffer);
+--- rtorrent-0.6.1/src/display/window_download_statusbar.cc.orig	2006-08-04 23:53:27.000000000 +0200
++++ rtorrent-0.6.1/src/display/window_download_statusbar.cc	2006-08-20 16:36:24.163013000 +0200
+@@ -86,6 +86,11 @@
+                   m_download->tracker_list()->is_busy() ? 'C' : ' ',
+                   (int)(m_download->download()->tracker_list().timeout() / 1000000),
+                   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);
@@ -22,97 +22,28 @@
  }
  
  }
---- rtorrent-0.5.0/src/display/window_statusbar.cc.orig	2006-02-09 17:23:36.000000000 +0100
-+++ rtorrent-0.5.0/src/display/window_statusbar.cc	2006-05-04 14:36:04.000000000 +0200
-@@ -103,6 +103,7 @@
+--- rtorrent-0.6.1/src/display/window_statusbar.cc.orig	2006-07-27 21:44:30.000000000 +0200
++++ rtorrent-0.6.1/src/display/window_statusbar.cc	2006-08-20 16:38:24.102508750 +0200
+@@ -97,6 +97,7 @@
    if (last > buffer) {
-     position = print_status_extra(buffer, last, m_control);
-     m_canvas->print(m_canvas->get_width() - (position - buffer), 0, "%s", buffer);
+     position = print_status_extra(buffer, last, control);
+     m_canvas->print(m_canvas->width() - (position - buffer), 0, "%s", buffer);
 +    m_canvas->set_attr(0, 0, m_canvas->get_screen_width(), A_REVERSE, 0);
    }
  
+   m_lastTick = control->tick();
+--- rtorrent-0.6.1/src/display/window_title.cc.orig	2006-08-04 15:52:16.000000000 +0200
++++ rtorrent-0.6.1/src/display/window_title.cc	2006-08-20 16:39:52.604039750 +0200
+@@ -48,6 +48,7 @@
  
---- rtorrent-0.5.0/src/display/window_title.cc.orig	2006-02-09 17:23:36.000000000 +0100
-+++ rtorrent-0.5.0/src/display/window_title.cc	2006-05-04 14:36:43.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());
+   m_canvas->print(std::max(0, ((int)m_canvas->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);
  }
  
  }
---- rtorrent-0.5.3/src/display/client_info.cc.orig	2006-07-08 14:41:54.355385750 +0200
-+++ rtorrent-0.5.3/src/display/client_info.cc	2006-07-08 14:43:45.662342000 +0200
-@@ -137,7 +137,7 @@
-       if (id[1] == 'l' && id[2] == 't' && !std::strncmp(id+16, "UDP0", 4))
- 	first = print_buffer(first, last, "BitSpirit (spoofed ID)");
-       else
--      first = print_buffer(first, last, "%s %hhu.%hhu.%hhu.%hhu", itr->second,
-+      first = print_buffer(first, last, "%-12s %hhu.%hhu.%hhu.%hhu", itr->second,
- 			   rak::hexchar_to_value(id[3]), rak::hexchar_to_value(id[4]),
- 			   rak::hexchar_to_value(id[5]), rak::hexchar_to_value(id[6]));
-     }
-@@ -147,7 +147,7 @@
- 			   rak::hexchar_to_value(id[3]), rak::hexchar_to_value(id[4]),
- 			   rak::hexchar_to_value(id[5]), rak::hexchar_to_value(id[6]));
- 
--  } else if (std::isalpha(id[0]) && id[4] == '-' &&
-+  } else if (std::isalpha(id[0]) && id[5] == '-' &&
- 	     std::isxdigit(id[1]) && std::isxdigit(id[2]) && std::isxdigit(id[3])) {
-     // TYPE_THREE_COMPACT.
- 
-@@ -155,7 +155,7 @@
- 				client_info_equal(id, sizeof_key(TYPE_COMPACT)));
- 
-     if (itr != m_containers[TYPE_COMPACT].end())
--      first = print_buffer(first, last, "%s %hhu.%hhu.%hhu", itr->second,
-+      first = print_buffer(first, last, "%-12s %hhu.%hhu.%hhu", itr->second,
- 			   rak::hexchar_to_value(id[1]), rak::hexchar_to_value(id[2]), rak::hexchar_to_value(id[3]));
-     
-     else
-@@ -170,7 +170,7 @@
- 				client_info_equal(id, sizeof_key(TYPE_MAINLINE)));
- 
-     if (itr != m_containers[TYPE_MAINLINE].end())
--      first = print_buffer(first, last, "%s %hhu.%hhu.%hhu", itr->second,
-+      first = print_buffer(first, last, "%-12s %hhu.%hhu.%hhu", itr->second,
- 			   rak::hexchar_to_value(id[1]), rak::hexchar_to_value(id[3]), rak::hexchar_to_value(id[5]));
-     
-     else
-@@ -187,13 +187,13 @@
-   } else {
-     if (std::strncmp(id, "exbc", 4) == 0) {
-       if (id[4] == 0)
--        first = print_buffer(first, last, "%s %hhu.%02hhu", "BitComet", id[4], id[5]);
-+        first = print_buffer(first, last, "%-12s %hhu.%02hhu", "BitComet", id[4], id[5]);
-       else
--	first = print_buffer(first, last, "%s %hhu.%hhu", "BitLord", id[4], id[5]);
-+	first = print_buffer(first, last, "%-12s %hhu.%hhu", "BitLord", id[4], id[5]);
-     } else if (id[2] == 'B' && id[3] == 'S') {
--      first = print_buffer(first, last, "BitSpirit %hhu.%hhu", id[1], id[0]);
-+      first = print_buffer(first, last, "%-12s %hhu.%hhu", "BitSpirit", id[1], id[0]);
-     } else if (id[0] == '-' && id[1] == 'M' && id[2] == 'L') {
--      first = print_buffer(first, last, "MLDonkey %hhu.%hhu.%hhu", 
-+      first = print_buffer(first, last, "%-12s %hhu.%hhu.%hhu", "MLDonkey",
- 		rak::hexchar_to_value(id[3]), rak::hexchar_to_value(id[5]), rak::hexchar_to_value(id[7]));
-     } else if (id[0] == '-' && id[1] == 'G' && id[2] == '3') {
-       first = print_buffer(first, last, "G3 Torrent");
-@@ -202,10 +202,10 @@
-     } else if (std::strncmp(id+16, "UDP0", 4) == 0) {
-       first = print_buffer(first, last, "BitSpirit (cloaked)");
-     } else if (std::strncmp(id+2, "Mbrst", 5) == 0) {
--      first = print_buffer(first, last, "burst! %hhu.%hhu.%hhu",
-+      first = print_buffer(first, last, "%-12s %hhu.%hhu.%hhu", "burst!",
- 		rak::hexchar_to_value(id[4]), rak::hexchar_to_value(id[6]), rak::hexchar_to_value(id[8]));
-     } else
--    first = print_buffer(first, last, "unknown");
-+    first = print_buffer(first, last, "");
-   }
- 
-   return first;
---- rtorrent-0.5.1/src/display/window_download_list.cc.orig	2006-05-01 18:30:08.000000000 +0200
-+++ rtorrent-0.5.1/src/display/window_download_list.cc	2006-05-07 18:14:05.000000000 +0200
+--- rtorrent-0.6.1/src/display/window_download_list.cc.orig	2006-08-04 15:38:24.000000000 +0200
++++ rtorrent-0.6.1/src/display/window_download_list.cc	2006-08-20 16:48:34.368648000 +0200
 @@ -38,6 +38,8 @@
  
  #include <rak/algorithm.h>
@@ -122,8 +53,8 @@
  #include "core/download.h"
  #include "core/view.h"
  
-@@ -89,21 +91,47 @@
-   if (range.second != m_view->end())
+@@ -89,21 +91,48 @@
+   if (range.second != m_view->end_visible())
      ++range.second;
  
 +  init_pair(1, COLOR_GREEN, COLOR_BLACK);
@@ -134,9 +65,9 @@
    int pos = 1;
  
    while (range.first != range.second) {
-     char buffer[m_canvas->get_width()];
+     char buffer[m_canvas->width() + 1];
      char* position;
-     char* last = buffer + m_canvas->get_width() - 2;
+     char* last = buffer + m_canvas->width() - 2 + 1;
 +    int col = 0;
 +    double ratio = 0;
 +    core::Download* d = *range.first;
@@ -153,7 +84,8 @@
 +    position = print_download_title(buffer, last, *range.first, ratio);
 +    m_canvas->print(0, pos, "%c %s", range.first == m_view->focus() ? '*' : ' ', buffer);
 +    if (d->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);
++      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_title(buffer, last, *range.first);
@@ -212,3 +144,77 @@
  
    if (d->priority() != 2)
      first = print_buffer(first, last, " %s]", core::Download::priority_to_string(d->priority()));
+--- rtorrent-0.6.1/src/display/client_info.cc.orig	2006-08-20 16:49:57.813863000 +0200
++++ rtorrent-0.6.1/src/display/client_info.cc	2006-08-20 16:52:35.207699500 +0200
+@@ -140,7 +140,7 @@
+       if (id[1] == 'l' && id[2] == 't' && !std::strncmp(id+16, "UDP0", 4))
+         first = print_buffer(first, last, "BitSpirit (spoofed ID)");
+       else
+-        first = print_buffer(first, last, "%s %hhu.%hhu.%hhu.%hhu", itr->second,
++        first = print_buffer(first, last, "%-12s %hhu.%hhu.%hhu.%hhu", itr->second,
+           rak::hexchar_to_value(id[3]), rak::hexchar_to_value(id[4]),
+           rak::hexchar_to_value(id[5]), rak::hexchar_to_value(id[6]));
+     }
+@@ -150,7 +150,7 @@
+                            rak::hexchar_to_value(id[3]), rak::hexchar_to_value(id[4]),
+                            rak::hexchar_to_value(id[5]), rak::hexchar_to_value(id[6]));
+ 
+-  } else if (std::isalpha(id[0]) && id[4] == '-' &&
++  } else if (std::isalpha(id[0]) && id[5] == '-' &&
+              std::isxdigit(id[1]) && std::isxdigit(id[2]) && std::isxdigit(id[3])) {
+     // TYPE_THREE_COMPACT.
+ 
+@@ -158,7 +158,7 @@
+                                       client_info_equal(id, sizeof_key(TYPE_COMPACT)));
+ 
+     if (itr != m_containers[TYPE_COMPACT].end())
+-      first = print_buffer(first, last, "%s %hhu.%hhu.%hhu", itr->second,
++      first = print_buffer(first, last, "%-12s %hhu.%hhu.%hhu", itr->second,
+                            rak::hexchar_to_value(id[1]), rak::hexchar_to_value(id[2]), rak::hexchar_to_value(id[3]));
+     
+     else
+@@ -174,11 +174,11 @@
+ 
+     if (itr != m_containers[TYPE_MAINLINE].end())
+       if (id[4] == '-')
+-        first = print_buffer(first, last, "%s %hhu.%hhu.%hhu", itr->second,
++        first = print_buffer(first, last, "%-12s %hhu.%hhu.%hhu", itr->second,
+           rak::hexchar_to_value(id[1]), rak::hexchar_to_value(id[3]),
+           rak::hexchar_to_value(id[5]));
+       else
+-        first = print_buffer(first, last, "%s %hhu.%hhu%hhu.%hhu", itr->second,
++        first = print_buffer(first, last, "%-12s %hhu.%hhu%hhu.%hhu", itr->second,
+           rak::hexchar_to_value(id[1]), rak::hexchar_to_value(id[3]),
+           rak::hexchar_to_value(id[4]), rak::hexchar_to_value(id[6]));
+     
+@@ -196,13 +196,13 @@
+   } else {
+     if (std::strncmp(id, "exbc", 4) == 0) {
+       if (id[4] == 0)
+-        first = print_buffer(first, last, "%s %hhu.%02hhu", "BitComet", id[4], id[5]);
++        first = print_buffer(first, last, "%-12s %hhu.%02hhu", "BitComet", id[4], id[5]);
+       else
+-	first = print_buffer(first, last, "%s %hhu.%hhu", "BitLord", id[4], id[5]);
++	first = print_buffer(first, last, "%-12s %hhu.%hhu", "BitLord", id[4], id[5]);
+     } else if (id[2] == 'B' && id[3] == 'S') {
+-      first = print_buffer(first, last, "BitSpirit %hhu.%hhu", id[1], id[0]);
++      first = print_buffer(first, last, "%-12s %hhu.%hhu", "BitSpirit", id[1], id[0]);
+     } else if (id[0] == '-' && id[1] == 'M' && id[2] == 'L') {
+-      first = print_buffer(first, last, "MLDonkey %hhu.%hhu.%hhu", 
++      first = print_buffer(first, last, "%-12s %hhu.%hhu.%hhu", "MLDonkey",
+ 		rak::hexchar_to_value(id[3]), rak::hexchar_to_value(id[5]), rak::hexchar_to_value(id[7]));
+     } else if (id[0] == '-' && id[1] == 'G' && id[2] == '3') {
+       first = print_buffer(first, last, "G3 Torrent");
+@@ -211,10 +211,10 @@
+     } else if (std::strncmp(id+16, "UDP0", 4) == 0) {
+       first = print_buffer(first, last, "BitSpirit (cloaked)");
+     } else if (std::strncmp(id, "Mbrst", 5) == 0) {
+-      first = print_buffer(first, last, "burst! %hhu.%hhu.%hhu",
++      first = print_buffer(first, last, "%-12s %hhu.%hhu.%hhu", "burst!",
+ 		rak::hexchar_to_value(id[5]), rak::hexchar_to_value(id[7]), rak::hexchar_to_value(id[9]));
+     } else
+-    first = print_buffer(first, last, "unknown");
++    first = print_buffer(first, last, "");
+   }
+ 
+   return first;
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/rtorrent-colors.patch?r1=1.13&r2=1.14&f=u



More information about the pld-cvs-commit mailing list