updated on Sun Jan 15 16:02:00 UTC 2012
[aur-mirror.git] / rtorrent-mod / rtorrent-mod-v3.patch
blob789eaefbba51178306bc2f6b0422b67f7a40b3d0
1 diff -rupN src-old/command_download.cc src/command_download.cc
2 --- src-old/command_download.cc 2011-06-04 07:01:19.000000000 +0300
3 +++ src/command_download.cc 2011-10-29 11:10:41.258332501 +0300
4 @@ -5,12 +5,12 @@
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation; either version 2 of the License, or
7 // (at your option) any later version.
8 -//
9 +//
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 -//
15 +//
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 @@ -99,7 +99,7 @@ apply_d_change_link(core::Download* down
20 const std::string& type = (itr++)->as_string();
21 const std::string& prefix = (itr++)->as_string();
22 const std::string& postfix = (itr++)->as_string();
25 if (type.empty())
26 throw torrent::input_error("Invalid arguments.");
28 @@ -213,7 +213,7 @@ retrieve_d_priority_str(core::Download*
29 case 2:
30 return "normal";
31 case 3:
32 - return "high";
33 + return "hig";
34 default:
35 throw torrent::input_error("Priority out of range.");
37 @@ -752,7 +752,7 @@ initialize_command_download() {
38 CMD2_DL ("d.completed_chunks", CMD2_ON_FL(completed_chunks));
39 CMD2_DL ("d.left_bytes", CMD2_ON_FL(left_bytes));
41 - CMD2_DL_V ("d.tracker_announce", std::bind(&torrent::TrackerList::manual_request, CMD2_BIND_TL, false));
42 + CMD2_DL_V ("d.tracker_announce", std::bind(&torrent::TrackerList::manual_request, CMD2_BIND_TL, false));
43 CMD2_DL ("d.tracker_numwant", std::bind(&torrent::TrackerList::numwant, CMD2_BIND_TL));
44 CMD2_DL_VALUE_V ("d.tracker_numwant.set", std::bind(&torrent::TrackerList::set_numwant, CMD2_BIND_TL, std::placeholders::_2));
45 CMD2_DL ("d.tracker_focus", std::bind(&torrent::TrackerList::focus_index, CMD2_BIND_TL));
46 diff -rupN src-old/display/canvas.cc src/display/canvas.cc
47 --- src-old/display/canvas.cc 2011-04-07 15:36:51.000000000 +0300
48 +++ src/display/canvas.cc 2011-10-29 11:41:04.001593888 +0300
49 @@ -5,12 +5,12 @@
50 // it under the terms of the GNU General Public License as published by
51 // the Free Software Foundation; either version 2 of the License, or
52 // (at your option) any later version.
53 -//
54 +//
55 // This program is distributed in the hope that it will be useful,
56 // but WITHOUT ANY WARRANTY; without even the implied warranty of
57 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
58 // GNU General Public License for more details.
59 -//
60 +//
61 // You should have received a copy of the GNU General Public License
62 // along with this program; if not, write to the Free Software
63 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
64 @@ -95,10 +95,18 @@ void
65 Canvas::initialize() {
66 if (m_isInitialized)
67 return;
70 m_isInitialized = true;
72 initscr();
74 + /* colors */
75 + start_color();
76 + use_default_colors();
77 + init_pair(1, COLOR_RED, -1);
78 + init_pair(2, COLOR_YELLOW, -1);
79 + init_pair(3, COLOR_GREEN, -1);
81 raw();
82 noecho();
83 nodelay(stdscr, TRUE);
84 @@ -110,7 +118,7 @@ void
85 Canvas::cleanup() {
86 if (!m_isInitialized)
87 return;
90 m_isInitialized = false;
92 noraw();
93 diff -rupN src-old/display/canvas.h src/display/canvas.h
94 --- src-old/display/canvas.h 2011-04-07 15:36:10.000000000 +0300
95 +++ src/display/canvas.h 2011-10-29 11:10:16.721666801 +0300
96 @@ -5,12 +5,12 @@
97 // it under the terms of the GNU General Public License as published by
98 // the Free Software Foundation; either version 2 of the License, or
99 // (at your option) any later version.
100 -//
102 // This program is distributed in the hope that it will be useful,
103 // but WITHOUT ANY WARRANTY; without even the implied warranty of
104 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
105 // GNU General Public License for more details.
106 -//
108 // You should have received a copy of the GNU General Public License
109 // along with this program; if not, write to the Free Software
110 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
111 @@ -48,7 +48,7 @@ class Canvas {
112 public:
113 typedef std::vector<Attributes> attributes_list;
115 - Canvas(int x = 0, int y = 0, int width = 0, int height = 0);
116 + Canvas(int x = 0, int y = 0, int width = 1, int height = 1);
117 ~Canvas() { delwin(m_window); }
119 void refresh() { wnoutrefresh(m_window); }
120 diff -rupN src-old/display/utils.cc src/display/utils.cc
121 --- src-old/display/utils.cc 2011-04-23 15:28:07.000000000 +0300
122 +++ src/display/utils.cc 2011-10-29 11:38:33.504933162 +0300
123 @@ -5,12 +5,12 @@
124 // it under the terms of the GNU General Public License as published by
125 // the Free Software Foundation; either version 2 of the License, or
126 // (at your option) any later version.
127 -//
129 // This program is distributed in the hope that it will be useful,
130 // but WITHOUT ANY WARRANTY; without even the implied warranty of
131 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
132 // GNU General Public License for more details.
133 -//
135 // You should have received a copy of the GNU General Public License
136 // along with this program; if not, write to the Free Software
137 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
138 @@ -53,6 +53,8 @@
139 #include <torrent/data/file_manager.h>
140 #include <torrent/download/resource_manager.h>
141 #include <torrent/peer/client_info.h>
142 +#include <torrent/peer/connection_list.h>
143 +#include <torrent/peer/peer_list.h>
145 #include "core/download.h"
146 #include "core/manager.h"
147 @@ -87,7 +89,7 @@ print_hhmmss(char* first, char* last, ti
148 char*
149 print_hhmmss_local(char* first, char* last, time_t t) {
150 std::tm *u = std::localtime(&t);
153 if (u == NULL)
154 //return "inv_time";
155 throw torrent::internal_error("print_hhmmss_local(...) failed.");
156 @@ -98,15 +100,15 @@ print_hhmmss_local(char* first, char* la
157 char*
158 print_ddhhmm(char* first, char* last, time_t t) {
159 if (t / (24 * 3600) < 100)
160 - return print_buffer(first, last, "%2id %2i:%02i", (int)t / (24 * 3600), ((int)t / 3600) % 24, ((int)t / 60) % 60);
161 + return print_buffer(first, last, "%id:%ih:%im", (int)t / (24 * 3600), ((int)t / 3600) % 24, ((int)t / 60) % 60);
162 else
163 - return print_buffer(first, last, "--d --:--");
164 + return print_buffer(first, last, "--d:--h:--m");
167 char*
168 print_ddmmyyyy(char* first, char* last, time_t t) {
169 std::tm *u = std::gmtime(&t);
172 if (u == NULL)
173 //return "inv_time";
174 throw torrent::internal_error("print_ddmmyyyy(...) failed.");
175 @@ -129,57 +131,109 @@ print_address(char* first, char* last, c
177 char*
178 print_download_title(char* first, char* last, core::Download* d) {
179 - return print_buffer(first, last, " %s", d->info()->name().c_str());
180 + first = print_buffer(first, last, " %s", d->info()->name().c_str());
182 + if (first > last)
183 + throw torrent::internal_error("print_download_status(...) wrote past end of the buffer.");
185 + return first;
188 +char*
189 +print_download_title_extra(char* first, char* last, core::Download* d) {
190 + if (d->is_hash_checking()) {
191 + first = print_buffer(first, last, " | Checking hash [%2i%%]",
192 + (d->download()->chunks_hashed() * 100) / d->download()->file_list()->size_chunks());
194 + else if (d->tracker_list()->has_active() && d->tracker_list()->focus() < d->tracker_list()->end()) {
196 + torrent::TrackerList* tl = d->tracker_list();
197 + char status[128];
199 + (*tl->focus())->get_status(status, sizeof(status));
200 + first = print_buffer(first, last, " | Tracker[%i:%i]: Connecting to %s %s",
201 + (*tl->focus())->group(), tl->focus_index(), (*tl->focus())->url().c_str(), status);
203 + else if (!d->message().empty()) {
204 + first = print_buffer(first, last, " | %s", d->message().c_str());
206 + else {
207 + *first = '\0';
210 + if (first > last)
211 + throw torrent::internal_error("print_download_status(...) wrote past end of the buffer.");
213 + return first;
216 char*
217 print_download_info(char* first, char* last, core::Download* d) {
218 - if (!d->download()->info()->is_open())
219 - first = print_buffer(first, last, "[CLOSED] ");
220 - else if (!d->download()->info()->is_active())
221 - first = print_buffer(first, last, "[OPEN] ");
222 - else
223 - first = print_buffer(first, last, " ");
225 - if (d->is_done())
226 - first = print_buffer(first, last, "done %10.1f MB", (double)d->download()->file_list()->size_bytes() / (double)(1 << 20));
227 - else
228 - first = print_buffer(first, last, "%6.1f / %6.1f MB",
229 - (double)d->download()->bytes_done() / (double)(1 << 20),
230 - (double)d->download()->file_list()->size_bytes() / (double)(1 << 20));
232 - first = print_buffer(first, last, " Rate: %5.1f / %5.1f KB Uploaded: %7.1f MB",
233 - (double)d->info()->up_rate()->rate() / (1 << 10),
234 - (double)d->info()->down_rate()->rate() / (1 << 10),
235 - (double)d->info()->up_rate()->total() / (1 << 20));
237 - if (d->download()->info()->is_active() && !d->is_done()) {
238 - first = print_buffer(first, last, " ");
239 - first = print_download_percentage_done(first, last, d);
240 + if (!d->info()->is_open()) {
241 + first = print_buffer(first, last, " CLOSED |");
243 + else if (!d->info()->is_active()) {
244 + first = print_buffer(first, last, " PAUSED |");
246 + else {
247 + first = print_buffer(first, last, " ACTIVE |");
250 - first = print_buffer(first, last, " ");
251 - first = print_download_time_left(first, last, d);
252 - } else {
253 - first = print_buffer(first, last, " ");
255 + if (d->is_done()) {
256 + first = print_buffer(first, last, " finished %.1f MB [100%%] |", (double)d->download()->file_list()->size_bytes() / (double)(1 << 20));
258 + else {
259 + first = print_buffer(first, last, " %.1f / %.1f MB [%i%%] |",
260 + (double)d->download()->bytes_done() / (double)(1 << 20),
261 + (double)d->download()->file_list()->size_bytes() / (double)(1 << 20),
262 + (int)(((double)d->download()->bytes_done() / (double)d->download()->file_list()->size_bytes()) * 100));
265 - first = print_buffer(first, last, " [%c%c R: %4.2f",
266 - rpc::call_command_string("d.tied_to_file", rpc::make_target(d)).empty() ? ' ' : 'T',
267 - rpc::call_command_value("d.ignore_commands", rpc::make_target(d)) == 0 ? ' ' : 'I',
268 - (double)rpc::call_command_value("d.ratio", rpc::make_target(d)) / 1000.0);
269 + //speed
270 + first = print_buffer(first, last, " Speed: %.1f / %.1f KB",
271 + (double)d->info()->down_rate()->rate() / (1 << 10),
272 + (double)d->info()->up_rate()->rate() / (1 << 10));
274 - if (d->priority() != 2)
275 - first = print_buffer(first, last, " %s", rpc::call_command_string("d.priority_str", rpc::make_target(d)).c_str());
276 + if (d->info()->is_active() && !d->is_done()) {
278 - if (!d->bencode()->get_key("rtorrent").get_key_string("throttle_name").empty())
279 - first = print_buffer(first, last , " %s", rpc::call_command_string("d.throttle_name", rpc::make_target(d)).c_str());
280 + //peers
281 + first = print_buffer(first, last, " | Peers: %i(%i)",
282 + (int)d->download()->connection_list()->size(),
283 + (int)d->download()->peer_list()->available_list_size());
285 - first = print_buffer(first, last , "]");
286 + //eta
287 + first = print_buffer(first, last, " | ETA: ");
288 + first = print_download_time_left(first, last, d);
290 - if (first > last)
291 - throw torrent::internal_error("print_download_info(...) wrote past end of the buffer.");
294 - return first;
295 + if (first > last)
296 + throw torrent::internal_error("print_download_info(...) wrote past end of the buffer.");
298 + return first;
301 +char*
302 +print_download_info_extra(char* first, char* last, core::Download* d) {
304 + first = print_buffer(first, last, "[%c%c R: %4.2f",
305 + rpc::call_command_string("d.get_tied_to_file", rpc::make_target(d)).empty() ? ' ' : 'T',
306 + rpc::call_command_value("d.get_ignore_commands", rpc::make_target(d)) == 0 ? ' ' : 'I',
307 + (double)rpc::call_command_value("d.get_ratio", rpc::make_target(d)) / 1000.0);
309 + if (d->priority() != 2)
310 + first = print_buffer(first, last, " %s", rpc::call_command_string("d.get_priority_str", rpc::make_target(d)).c_str());
312 + if (!d->bencode()->get_key("rtorrent").get_key_string("throttle_name").empty())
313 + first = print_buffer(first, last , " %s", rpc::call_command_string("d.get_throttle_name", rpc::make_target(d)).c_str());
315 + first = print_buffer(first, last , "]");
317 + if (first > last)
318 + throw torrent::internal_error("print_download_info(...) wrote past end of the buffer.");
320 + return first;
323 char*
324 @@ -221,8 +275,8 @@ print_download_time_left(char* first, ch
325 uint32_t rate = d->info()->down_rate()->rate();
327 if (rate < 512)
328 - return print_buffer(first, last, "--d --:--");
330 + return print_buffer(first, last, "--d:--h:--m");
332 time_t remaining = (d->download()->file_list()->size_bytes() - d->download()->bytes_done()) / (rate & ~(uint32_t)(512 - 1));
334 return print_ddhhmm(first, last, remaining);
335 @@ -232,9 +286,9 @@ char*
336 print_download_percentage_done(char* first, char* last, core::Download* d) {
337 if (!d->is_open() || d->is_done())
338 //return print_buffer(first, last, "[--%%]");
339 - return print_buffer(first, last, " ");
340 + return print_buffer(first, last, " ");
341 else
342 - return print_buffer(first, last, "[%2u%%]", (d->download()->file_list()->completed_chunks() * 100) / d->download()->file_list()->size_chunks());
343 + return print_buffer(first, last, "[%u%%]", (d->download()->file_list()->completed_chunks() * 100) / d->download()->file_list()->size_chunks());
346 char*
347 @@ -257,19 +311,19 @@ print_client_version(char* first, char*
349 char*
350 print_status_info(char* first, char* last) {
351 - if (!torrent::up_throttle_global()->is_throttled())
352 + if (!torrent::down_throttle_global()->is_throttled())
353 first = print_buffer(first, last, "[Throttle off");
354 else
355 - first = print_buffer(first, last, "[Throttle %3i", torrent::up_throttle_global()->max_rate() / 1024);
356 + first = print_buffer(first, last, "[Throttle %3i", torrent::down_throttle_global()->max_rate() / 1024);
358 - if (!torrent::down_throttle_global()->is_throttled())
359 + if (!torrent::up_throttle_global()->is_throttled())
360 first = print_buffer(first, last, "/off KB]");
361 else
362 - first = print_buffer(first, last, "/%3i KB]", torrent::down_throttle_global()->max_rate() / 1024);
364 + first = print_buffer(first, last, "/%3i KB]", torrent::up_throttle_global()->max_rate() / 1024);
366 first = print_buffer(first, last, " [Rate %5.1f/%5.1f KB]",
367 - (double)torrent::up_rate()->rate() / 1024.0,
368 - (double)torrent::down_rate()->rate() / 1024.0);
369 + (double)torrent::down_rate()->rate() / 1024.0,
370 + (double)torrent::up_rate()->rate() / 1024.0);
372 first = print_buffer(first, last, " [Port: %i]", (unsigned int)torrent::connection_manager()->listen_port());
374 @@ -278,7 +332,7 @@ print_status_info(char* first, char* las
375 first = print_address(first, last, torrent::connection_manager()->local_address());
376 first = print_buffer(first, last, "]");
380 if (first > last)
381 throw torrent::internal_error("print_status_info(...) wrote past end of the buffer.");
383 @@ -303,13 +357,13 @@ print_status_extra(char* first, char* la
385 first = print_buffer(first, last, " [H %u/%u]",
386 control->core()->http_stack()->active(),
387 - control->core()->http_stack()->max_active());
388 + control->core()->http_stack()->max_active());
390 first = print_buffer(first, last, " [S %i/%i/%i]",
391 torrent::total_handshakes(),
392 torrent::connection_manager()->size(),
393 torrent::connection_manager()->max_size());
396 first = print_buffer(first, last, " [F %i/%i]",
397 torrent::file_manager()->open_files(),
398 torrent::file_manager()->max_open_files());
399 diff -rupN src-old/display/utils.h src/display/utils.h
400 --- src-old/display/utils.h 2011-04-05 13:26:07.000000000 +0300
401 +++ src/display/utils.h 2011-10-29 11:20:32.608309160 +0300
402 @@ -5,12 +5,12 @@
403 // it under the terms of the GNU General Public License as published by
404 // the Free Software Foundation; either version 2 of the License, or
405 // (at your option) any later version.
406 -//
408 // This program is distributed in the hope that it will be useful,
409 // but WITHOUT ANY WARRANTY; without even the implied warranty of
410 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
411 // GNU General Public License for more details.
412 -//
414 // You should have received a copy of the GNU General Public License
415 // along with this program; if not, write to the Free Software
416 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
417 @@ -66,7 +66,9 @@ char* print_ddhhmm(char* first, ch
418 char* print_ddmmyyyy(char* first, char* last, time_t t);
420 char* print_download_title(char* first, char* last, core::Download* d);
421 +char* print_download_title_extra(char* first, char* last, core::Download* d);
422 char* print_download_info(char* first, char* last, core::Download* d);
423 +char* print_download_info_extra(char* first, char* last, core::Download* d);
424 char* print_download_status(char* first, char* last, core::Download* d);
425 char* print_download_time_left(char* first, char* last, core::Download* d);
426 char* print_download_percentage_done(char* first, char* last, core::Download* d);
427 diff -rupN src-old/display/window_download_list.cc src/display/window_download_list.cc
428 --- src-old/display/window_download_list.cc 2011-04-05 13:26:07.000000000 +0300
429 +++ src/display/window_download_list.cc 2011-10-29 11:38:15.224933883 +0300
430 @@ -5,12 +5,12 @@
431 // it under the terms of the GNU General Public License as published by
432 // the Free Software Foundation; either version 2 of the License, or
433 // (at your option) any later version.
434 -//
436 // This program is distributed in the hope that it will be useful,
437 // but WITHOUT ANY WARRANTY; without even the implied warranty of
438 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
439 // GNU General Public License for more details.
440 -//
442 // You should have received a copy of the GNU General Public License
443 // along with this program; if not, write to the Free Software
444 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
445 @@ -81,7 +81,7 @@ WindowDownloadList::redraw() {
446 Range range = rak::advance_bidirectional(m_view->begin_visible(),
447 m_view->focus() != m_view->end_visible() ? m_view->focus() : m_view->begin_visible(),
448 m_view->end_visible(),
449 - m_canvas->height() / 3);
450 + (m_canvas->height() - 1) / 3);
452 // Make sure we properly fill out the last lines so it looks like
453 // there are more torrents, yet don't hide it if we got the last one
454 @@ -89,24 +89,84 @@ WindowDownloadList::redraw() {
455 if (range.second != m_view->end_visible())
456 ++range.second;
458 - int pos = 1;
459 + int pos = 2;
461 while (range.first != range.second) {
462 char buffer[m_canvas->width() + 1];
463 char* position;
464 char* last = buffer + m_canvas->width() - 2 + 1;
465 + int title_length;
467 + //1 = red
468 + //2 = yellow
469 + //3 = green
471 + //do not print on last lines if cannot show whole torrent
472 + if (pos >= (m_canvas->height() - 1))
473 + break;
475 + //print title
476 position = print_download_title(buffer, last, *range.first);
477 - m_canvas->print(0, pos++, "%c %s", range.first == m_view->focus() ? '*' : ' ', buffer);
479 + title_length = strlen(buffer);
480 + m_canvas->print(0, pos, "%c %s", range.first == m_view->focus() ? '*' : ' ', buffer);
482 + //title color
483 + if ((*range.first)->is_done()) {
484 + //finished
485 + m_canvas->set_attr(3, pos, (title_length - 1), A_NORMAL, 3);
487 + else {
488 + //not finished
489 + m_canvas->set_attr(3, pos, (title_length - 1), A_NORMAL, 2);
492 + //print title extra
493 + position = print_download_title_extra(buffer, last, *range.first);
495 + //do not let title extra get off screen
496 + buffer[m_canvas->width() - title_length - 2] = '\0';
498 + m_canvas->print((title_length + 2), pos++, "%s", buffer);
500 + //print info
501 position = print_download_info(buffer, last, *range.first);
502 - m_canvas->print(0, pos++, "%c %s", range.first == m_view->focus() ? '*' : ' ', buffer);
503 + m_canvas->print(0, pos, "%c %s", range.first == m_view->focus() ? '*' : ' ', buffer);
505 - position = print_download_status(buffer, last, *range.first);
506 - m_canvas->print(0, pos++, "%c %s", range.first == m_view->focus() ? '*' : ' ', buffer);
507 + //info color
508 + if (!(*range.first)->info()->is_open()) {
509 + //closed
510 + m_canvas->set_attr(3, pos, 6, A_NORMAL, 1);
512 + else if (!(*range.first)->info()->is_active()) {
513 + //paused
514 + m_canvas->set_attr(3, pos, 6, A_NORMAL, 2);
516 + else {
517 + //active
518 + m_canvas->set_attr(3, pos, 6, A_NORMAL, 3);
521 + if ((*range.first)->is_done()) {
522 + //finished
523 + m_canvas->set_attr(12, pos, 8, A_NORMAL, 3);
526 + //do not print info extra if it collides with info
527 + if ((strlen(buffer) + 2) <= (m_canvas->width() - 16)) {
529 + //print info extra
530 + position = print_download_info_extra(buffer, last, *range.first);
531 + m_canvas->print((m_canvas->width() - 16), pos++, "%s", buffer);
534 + else {
535 + pos++;
538 + //skip one line
539 + pos++;
540 ++range.first;
541 - }
546 diff -rupN src-old/display/window_title.cc src/display/window_title.cc
547 --- src-old/display/window_title.cc 2011-04-05 13:26:07.000000000 +0300
548 +++ src/display/window_title.cc 2011-10-29 11:24:43.121632604 +0300
549 @@ -5,12 +5,12 @@
550 // it under the terms of the GNU General Public License as published by
551 // the Free Software Foundation; either version 2 of the License, or
552 // (at your option) any later version.
553 -//
555 // This program is distributed in the hope that it will be useful,
556 // but WITHOUT ANY WARRANTY; without even the implied warranty of
557 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
558 // GNU General Public License for more details.
559 -//
561 // You should have received a copy of the GNU General Public License
562 // along with this program; if not, write to the Free Software
563 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
564 @@ -48,6 +48,9 @@ WindowTitle::redraw() {
566 m_canvas->print(std::max(0, ((int)m_canvas->width() - (int)m_title.size()) / 2 - 4), 0,
567 "*** %s ***", m_title.c_str());
569 + m_canvas->set_attr((((int)m_canvas->width() - (int)m_title.size()) / 2 - 4), 0, 3, A_NORMAL, 2);
570 + m_canvas->set_attr( ((((int)m_canvas->width() - (int)m_title.size()) / 2) + (int)m_title.size() + 1), 0, 3, A_NORMAL, 2);
574 diff -rupN src-old/ui/download_list.cc src/ui/download_list.cc
575 --- src-old/ui/download_list.cc 2011-04-05 13:26:12.000000000 +0300
576 +++ src/ui/download_list.cc 2011-10-29 11:25:55.498296415 +0300
577 @@ -5,12 +5,12 @@
578 // it under the terms of the GNU General Public License as published by
579 // the Free Software Foundation; either version 2 of the License, or
580 // (at your option) any later version.
581 -//
583 // This program is distributed in the hope that it will be useful,
584 // but WITHOUT ANY WARRANTY; without even the implied warranty of
585 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
586 // GNU General Public License for more details.
587 -//
589 // You should have received a copy of the GNU General Public License
590 // along with this program; if not, write to the Free Software
591 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
592 @@ -157,7 +157,7 @@ DownloadList::activate_display(Display d
593 m_uiArray[m_state] = NULL;
595 break;
598 case DISPLAY_DOWNLOAD_LIST:
599 m_uiArray[DISPLAY_DOWNLOAD_LIST]->disable();
601 @@ -171,7 +171,7 @@ DownloadList::activate_display(Display d
602 case DISPLAY_STRING_LIST:
603 m_uiArray[m_state]->disable();
604 break;
607 default:
608 break;
610 @@ -193,7 +193,7 @@ DownloadList::activate_display(Display d
612 download->activate(m_frame);
613 download->slot_exit(sigc::bind(sigc::mem_fun(*this, &DownloadList::activate_display), DISPLAY_DOWNLOAD_LIST));
616 m_uiArray[DISPLAY_DOWNLOAD] = download;
617 break;
619 @@ -220,7 +220,7 @@ DownloadList::activate_display(Display d
620 // Set title.
621 switch (displayType) {
622 case DISPLAY_DOWNLOAD_LIST:
623 - control->ui()->window_title()->set_title("rTorrent " VERSION "/" +
624 + control->ui()->window_title()->set_title("rTorrent-mod " VERSION "/" +
625 std::string(torrent::version()) + " - " +
626 rpc::call_command_string("session.name"));
627 break;
628 @@ -285,7 +285,7 @@ DownloadList::receive_view_input(Input t
629 void
630 DownloadList::receive_exit_input(Input type) {
631 input::TextInput* input = control->ui()->current_input();
634 // We should check that this object is the one holding the input.
635 if (input == NULL)
636 return;