Created
October 29, 2011 08:58
-
-
Save Cloudef/1324254 to your computer and use it in GitHub Desktop.
rtorrent-mod-v3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -rupN src-old/command_download.cc src/command_download.cc | |
--- src-old/command_download.cc 2011-06-04 07:01:19.000000000 +0300 | |
+++ src/command_download.cc 2011-10-29 11:10:41.258332501 +0300 | |
@@ -5,12 +5,12 @@ | |
// it under the terms of the GNU General Public License as published by | |
// the Free Software Foundation; either version 2 of the License, or | |
// (at your option) any later version. | |
-// | |
+// | |
// This program is distributed in the hope that it will be useful, | |
// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
// GNU General Public License for more details. | |
-// | |
+// | |
// You should have received a copy of the GNU General Public License | |
// along with this program; if not, write to the Free Software | |
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
@@ -99,7 +99,7 @@ apply_d_change_link(core::Download* down | |
const std::string& type = (itr++)->as_string(); | |
const std::string& prefix = (itr++)->as_string(); | |
const std::string& postfix = (itr++)->as_string(); | |
- | |
+ | |
if (type.empty()) | |
throw torrent::input_error("Invalid arguments."); | |
@@ -213,7 +213,7 @@ retrieve_d_priority_str(core::Download* | |
case 2: | |
return "normal"; | |
case 3: | |
- return "high"; | |
+ return "hig"; | |
default: | |
throw torrent::input_error("Priority out of range."); | |
} | |
@@ -752,7 +752,7 @@ initialize_command_download() { | |
CMD2_DL ("d.completed_chunks", CMD2_ON_FL(completed_chunks)); | |
CMD2_DL ("d.left_bytes", CMD2_ON_FL(left_bytes)); | |
- CMD2_DL_V ("d.tracker_announce", std::bind(&torrent::TrackerList::manual_request, CMD2_BIND_TL, false)); | |
+ CMD2_DL_V ("d.tracker_announce", std::bind(&torrent::TrackerList::manual_request, CMD2_BIND_TL, false)); | |
CMD2_DL ("d.tracker_numwant", std::bind(&torrent::TrackerList::numwant, CMD2_BIND_TL)); | |
CMD2_DL_VALUE_V ("d.tracker_numwant.set", std::bind(&torrent::TrackerList::set_numwant, CMD2_BIND_TL, std::placeholders::_2)); | |
CMD2_DL ("d.tracker_focus", std::bind(&torrent::TrackerList::focus_index, CMD2_BIND_TL)); | |
diff -rupN src-old/display/canvas.cc src/display/canvas.cc | |
--- src-old/display/canvas.cc 2011-04-07 15:36:51.000000000 +0300 | |
+++ src/display/canvas.cc 2011-10-29 11:41:04.001593888 +0300 | |
@@ -5,12 +5,12 @@ | |
// it under the terms of the GNU General Public License as published by | |
// the Free Software Foundation; either version 2 of the License, or | |
// (at your option) any later version. | |
-// | |
+// | |
// This program is distributed in the hope that it will be useful, | |
// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
// GNU General Public License for more details. | |
-// | |
+// | |
// You should have received a copy of the GNU General Public License | |
// along with this program; if not, write to the Free Software | |
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
@@ -95,10 +95,18 @@ void | |
Canvas::initialize() { | |
if (m_isInitialized) | |
return; | |
- | |
+ | |
m_isInitialized = true; | |
initscr(); | |
+ | |
+ /* colors */ | |
+ start_color(); | |
+ use_default_colors(); | |
+ init_pair(1, COLOR_RED, -1); | |
+ init_pair(2, COLOR_YELLOW, -1); | |
+ init_pair(3, COLOR_GREEN, -1); | |
+ | |
raw(); | |
noecho(); | |
nodelay(stdscr, TRUE); | |
@@ -110,7 +118,7 @@ void | |
Canvas::cleanup() { | |
if (!m_isInitialized) | |
return; | |
- | |
+ | |
m_isInitialized = false; | |
noraw(); | |
diff -rupN src-old/display/canvas.h src/display/canvas.h | |
--- src-old/display/canvas.h 2011-04-07 15:36:10.000000000 +0300 | |
+++ src/display/canvas.h 2011-10-29 11:10:16.721666801 +0300 | |
@@ -5,12 +5,12 @@ | |
// it under the terms of the GNU General Public License as published by | |
// the Free Software Foundation; either version 2 of the License, or | |
// (at your option) any later version. | |
-// | |
+// | |
// This program is distributed in the hope that it will be useful, | |
// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
// GNU General Public License for more details. | |
-// | |
+// | |
// You should have received a copy of the GNU General Public License | |
// along with this program; if not, write to the Free Software | |
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
@@ -48,7 +48,7 @@ class Canvas { | |
public: | |
typedef std::vector<Attributes> attributes_list; | |
- Canvas(int x = 0, int y = 0, int width = 0, int height = 0); | |
+ Canvas(int x = 0, int y = 0, int width = 1, int height = 1); | |
~Canvas() { delwin(m_window); } | |
void refresh() { wnoutrefresh(m_window); } | |
diff -rupN src-old/display/utils.cc src/display/utils.cc | |
--- src-old/display/utils.cc 2011-04-23 15:28:07.000000000 +0300 | |
+++ src/display/utils.cc 2011-10-29 11:38:33.504933162 +0300 | |
@@ -5,12 +5,12 @@ | |
// it under the terms of the GNU General Public License as published by | |
// the Free Software Foundation; either version 2 of the License, or | |
// (at your option) any later version. | |
-// | |
+// | |
// This program is distributed in the hope that it will be useful, | |
// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
// GNU General Public License for more details. | |
-// | |
+// | |
// You should have received a copy of the GNU General Public License | |
// along with this program; if not, write to the Free Software | |
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
@@ -53,6 +53,8 @@ | |
#include <torrent/data/file_manager.h> | |
#include <torrent/download/resource_manager.h> | |
#include <torrent/peer/client_info.h> | |
+#include <torrent/peer/connection_list.h> | |
+#include <torrent/peer/peer_list.h> | |
#include "core/download.h" | |
#include "core/manager.h" | |
@@ -87,7 +89,7 @@ print_hhmmss(char* first, char* last, ti | |
char* | |
print_hhmmss_local(char* first, char* last, time_t t) { | |
std::tm *u = std::localtime(&t); | |
- | |
+ | |
if (u == NULL) | |
//return "inv_time"; | |
throw torrent::internal_error("print_hhmmss_local(...) failed."); | |
@@ -98,15 +100,15 @@ print_hhmmss_local(char* first, char* la | |
char* | |
print_ddhhmm(char* first, char* last, time_t t) { | |
if (t / (24 * 3600) < 100) | |
- return print_buffer(first, last, "%2id %2i:%02i", (int)t / (24 * 3600), ((int)t / 3600) % 24, ((int)t / 60) % 60); | |
+ return print_buffer(first, last, "%id:%ih:%im", (int)t / (24 * 3600), ((int)t / 3600) % 24, ((int)t / 60) % 60); | |
else | |
- return print_buffer(first, last, "--d --:--"); | |
+ return print_buffer(first, last, "--d:--h:--m"); | |
} | |
char* | |
print_ddmmyyyy(char* first, char* last, time_t t) { | |
std::tm *u = std::gmtime(&t); | |
- | |
+ | |
if (u == NULL) | |
//return "inv_time"; | |
throw torrent::internal_error("print_ddmmyyyy(...) failed."); | |
@@ -129,57 +131,109 @@ print_address(char* first, char* last, c | |
char* | |
print_download_title(char* first, char* last, core::Download* d) { | |
- return print_buffer(first, last, " %s", d->info()->name().c_str()); | |
+ first = print_buffer(first, last, " %s", d->info()->name().c_str()); | |
+ | |
+ if (first > last) | |
+ throw torrent::internal_error("print_download_status(...) wrote past end of the buffer."); | |
+ | |
+ return first; | |
+} | |
+ | |
+char* | |
+print_download_title_extra(char* first, char* last, core::Download* d) { | |
+ if (d->is_hash_checking()) { | |
+ first = print_buffer(first, last, " | Checking hash [%2i%%]", | |
+ (d->download()->chunks_hashed() * 100) / d->download()->file_list()->size_chunks()); | |
+ } | |
+ else if (d->tracker_list()->has_active() && d->tracker_list()->focus() < d->tracker_list()->end()) { | |
+ | |
+ torrent::TrackerList* tl = d->tracker_list(); | |
+ char status[128]; | |
+ | |
+ (*tl->focus())->get_status(status, sizeof(status)); | |
+ first = print_buffer(first, last, " | Tracker[%i:%i]: Connecting to %s %s", | |
+ (*tl->focus())->group(), tl->focus_index(), (*tl->focus())->url().c_str(), status); | |
+ } | |
+ else if (!d->message().empty()) { | |
+ first = print_buffer(first, last, " | %s", d->message().c_str()); | |
+ } | |
+ else { | |
+ *first = '\0'; | |
+ } | |
+ | |
+ if (first > last) | |
+ throw torrent::internal_error("print_download_status(...) wrote past end of the buffer."); | |
+ | |
+ return first; | |
} | |
char* | |
print_download_info(char* first, char* last, core::Download* d) { | |
- if (!d->download()->info()->is_open()) | |
- first = print_buffer(first, last, "[CLOSED] "); | |
- else if (!d->download()->info()->is_active()) | |
- first = print_buffer(first, last, "[OPEN] "); | |
- else | |
- first = print_buffer(first, last, " "); | |
- if (d->is_done()) | |
- first = print_buffer(first, last, "done %10.1f MB", (double)d->download()->file_list()->size_bytes() / (double)(1 << 20)); | |
- else | |
- first = print_buffer(first, last, "%6.1f / %6.1f MB", | |
- (double)d->download()->bytes_done() / (double)(1 << 20), | |
- (double)d->download()->file_list()->size_bytes() / (double)(1 << 20)); | |
- | |
- first = print_buffer(first, last, " Rate: %5.1f / %5.1f KB Uploaded: %7.1f MB", | |
- (double)d->info()->up_rate()->rate() / (1 << 10), | |
- (double)d->info()->down_rate()->rate() / (1 << 10), | |
- (double)d->info()->up_rate()->total() / (1 << 20)); | |
- | |
- if (d->download()->info()->is_active() && !d->is_done()) { | |
- first = print_buffer(first, last, " "); | |
- first = print_download_percentage_done(first, last, d); | |
+ if (!d->info()->is_open()) { | |
+ first = print_buffer(first, last, " CLOSED |"); | |
+ } | |
+ else if (!d->info()->is_active()) { | |
+ first = print_buffer(first, last, " PAUSED |"); | |
+ } | |
+ else { | |
+ first = print_buffer(first, last, " ACTIVE |"); | |
+ } | |
- first = print_buffer(first, last, " "); | |
- first = print_download_time_left(first, last, d); | |
- } else { | |
- first = print_buffer(first, last, " "); | |
- } | |
+ if (d->is_done()) { | |
+ first = print_buffer(first, last, " finished %.1f MB [100%%] |", (double)d->download()->file_list()->size_bytes() / (double)(1 << 20)); | |
+ } | |
+ else { | |
+ first = print_buffer(first, last, " %.1f / %.1f MB [%i%%] |", | |
+ (double)d->download()->bytes_done() / (double)(1 << 20), | |
+ (double)d->download()->file_list()->size_bytes() / (double)(1 << 20), | |
+ (int)(((double)d->download()->bytes_done() / (double)d->download()->file_list()->size_bytes()) * 100)); | |
+ } | |
- first = print_buffer(first, last, " [%c%c R: %4.2f", | |
- rpc::call_command_string("d.tied_to_file", rpc::make_target(d)).empty() ? ' ' : 'T', | |
- rpc::call_command_value("d.ignore_commands", rpc::make_target(d)) == 0 ? ' ' : 'I', | |
- (double)rpc::call_command_value("d.ratio", rpc::make_target(d)) / 1000.0); | |
+ //speed | |
+ first = print_buffer(first, last, " Speed: %.1f / %.1f KB", | |
+ (double)d->info()->down_rate()->rate() / (1 << 10), | |
+ (double)d->info()->up_rate()->rate() / (1 << 10)); | |
- if (d->priority() != 2) | |
- first = print_buffer(first, last, " %s", rpc::call_command_string("d.priority_str", rpc::make_target(d)).c_str()); | |
+ if (d->info()->is_active() && !d->is_done()) { | |
- if (!d->bencode()->get_key("rtorrent").get_key_string("throttle_name").empty()) | |
- first = print_buffer(first, last , " %s", rpc::call_command_string("d.throttle_name", rpc::make_target(d)).c_str()); | |
+ //peers | |
+ first = print_buffer(first, last, " | Peers: %i(%i)", | |
+ (int)d->download()->connection_list()->size(), | |
+ (int)d->download()->peer_list()->available_list_size()); | |
- first = print_buffer(first, last , "]"); | |
+ //eta | |
+ first = print_buffer(first, last, " | ETA: "); | |
+ first = print_download_time_left(first, last, d); | |
- if (first > last) | |
- throw torrent::internal_error("print_download_info(...) wrote past end of the buffer."); | |
+ } | |
- return first; | |
+ if (first > last) | |
+ throw torrent::internal_error("print_download_info(...) wrote past end of the buffer."); | |
+ | |
+ return first; | |
+} | |
+ | |
+char* | |
+print_download_info_extra(char* first, char* last, core::Download* d) { | |
+ | |
+ first = print_buffer(first, last, "[%c%c R: %4.2f", | |
+ rpc::call_command_string("d.get_tied_to_file", rpc::make_target(d)).empty() ? ' ' : 'T', | |
+ rpc::call_command_value("d.get_ignore_commands", rpc::make_target(d)) == 0 ? ' ' : 'I', | |
+ (double)rpc::call_command_value("d.get_ratio", rpc::make_target(d)) / 1000.0); | |
+ | |
+ if (d->priority() != 2) | |
+ first = print_buffer(first, last, " %s", rpc::call_command_string("d.get_priority_str", rpc::make_target(d)).c_str()); | |
+ | |
+ if (!d->bencode()->get_key("rtorrent").get_key_string("throttle_name").empty()) | |
+ first = print_buffer(first, last , " %s", rpc::call_command_string("d.get_throttle_name", rpc::make_target(d)).c_str()); | |
+ | |
+ first = print_buffer(first, last , "]"); | |
+ | |
+ if (first > last) | |
+ throw torrent::internal_error("print_download_info(...) wrote past end of the buffer."); | |
+ | |
+ return first; | |
} | |
char* | |
@@ -221,8 +275,8 @@ print_download_time_left(char* first, ch | |
uint32_t rate = d->info()->down_rate()->rate(); | |
if (rate < 512) | |
- return print_buffer(first, last, "--d --:--"); | |
- | |
+ return print_buffer(first, last, "--d:--h:--m"); | |
+ | |
time_t remaining = (d->download()->file_list()->size_bytes() - d->download()->bytes_done()) / (rate & ~(uint32_t)(512 - 1)); | |
return print_ddhhmm(first, last, remaining); | |
@@ -232,9 +286,9 @@ char* | |
print_download_percentage_done(char* first, char* last, core::Download* d) { | |
if (!d->is_open() || d->is_done()) | |
//return print_buffer(first, last, "[--%%]"); | |
- return print_buffer(first, last, " "); | |
+ return print_buffer(first, last, " "); | |
else | |
- return print_buffer(first, last, "[%2u%%]", (d->download()->file_list()->completed_chunks() * 100) / d->download()->file_list()->size_chunks()); | |
+ return print_buffer(first, last, "[%u%%]", (d->download()->file_list()->completed_chunks() * 100) / d->download()->file_list()->size_chunks()); | |
} | |
char* | |
@@ -257,19 +311,19 @@ print_client_version(char* first, char* | |
char* | |
print_status_info(char* first, char* last) { | |
- if (!torrent::up_throttle_global()->is_throttled()) | |
+ if (!torrent::down_throttle_global()->is_throttled()) | |
first = print_buffer(first, last, "[Throttle off"); | |
else | |
- first = print_buffer(first, last, "[Throttle %3i", torrent::up_throttle_global()->max_rate() / 1024); | |
+ first = print_buffer(first, last, "[Throttle %3i", torrent::down_throttle_global()->max_rate() / 1024); | |
- if (!torrent::down_throttle_global()->is_throttled()) | |
+ if (!torrent::up_throttle_global()->is_throttled()) | |
first = print_buffer(first, last, "/off KB]"); | |
else | |
- first = print_buffer(first, last, "/%3i KB]", torrent::down_throttle_global()->max_rate() / 1024); | |
- | |
+ first = print_buffer(first, last, "/%3i KB]", torrent::up_throttle_global()->max_rate() / 1024); | |
+ | |
first = print_buffer(first, last, " [Rate %5.1f/%5.1f KB]", | |
- (double)torrent::up_rate()->rate() / 1024.0, | |
- (double)torrent::down_rate()->rate() / 1024.0); | |
+ (double)torrent::down_rate()->rate() / 1024.0, | |
+ (double)torrent::up_rate()->rate() / 1024.0); | |
first = print_buffer(first, last, " [Port: %i]", (unsigned int)torrent::connection_manager()->listen_port()); | |
@@ -278,7 +332,7 @@ print_status_info(char* first, char* las | |
first = print_address(first, last, torrent::connection_manager()->local_address()); | |
first = print_buffer(first, last, "]"); | |
} | |
- | |
+ | |
if (first > last) | |
throw torrent::internal_error("print_status_info(...) wrote past end of the buffer."); | |
@@ -303,13 +357,13 @@ print_status_extra(char* first, char* la | |
first = print_buffer(first, last, " [H %u/%u]", | |
control->core()->http_stack()->active(), | |
- control->core()->http_stack()->max_active()); | |
+ control->core()->http_stack()->max_active()); | |
first = print_buffer(first, last, " [S %i/%i/%i]", | |
torrent::total_handshakes(), | |
torrent::connection_manager()->size(), | |
torrent::connection_manager()->max_size()); | |
- | |
+ | |
first = print_buffer(first, last, " [F %i/%i]", | |
torrent::file_manager()->open_files(), | |
torrent::file_manager()->max_open_files()); | |
diff -rupN src-old/display/utils.h src/display/utils.h | |
--- src-old/display/utils.h 2011-04-05 13:26:07.000000000 +0300 | |
+++ src/display/utils.h 2011-10-29 11:20:32.608309160 +0300 | |
@@ -5,12 +5,12 @@ | |
// it under the terms of the GNU General Public License as published by | |
// the Free Software Foundation; either version 2 of the License, or | |
// (at your option) any later version. | |
-// | |
+// | |
// This program is distributed in the hope that it will be useful, | |
// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
// GNU General Public License for more details. | |
-// | |
+// | |
// You should have received a copy of the GNU General Public License | |
// along with this program; if not, write to the Free Software | |
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
@@ -66,7 +66,9 @@ char* print_ddhhmm(char* first, ch | |
char* print_ddmmyyyy(char* first, char* last, time_t t); | |
char* print_download_title(char* first, char* last, core::Download* d); | |
+char* print_download_title_extra(char* first, char* last, core::Download* d); | |
char* print_download_info(char* first, char* last, core::Download* d); | |
+char* print_download_info_extra(char* first, char* last, core::Download* d); | |
char* print_download_status(char* first, char* last, core::Download* d); | |
char* print_download_time_left(char* first, char* last, core::Download* d); | |
char* print_download_percentage_done(char* first, char* last, core::Download* d); | |
diff -rupN src-old/display/window_download_list.cc src/display/window_download_list.cc | |
--- src-old/display/window_download_list.cc 2011-04-05 13:26:07.000000000 +0300 | |
+++ src/display/window_download_list.cc 2011-10-29 11:38:15.224933883 +0300 | |
@@ -5,12 +5,12 @@ | |
// it under the terms of the GNU General Public License as published by | |
// the Free Software Foundation; either version 2 of the License, or | |
// (at your option) any later version. | |
-// | |
+// | |
// This program is distributed in the hope that it will be useful, | |
// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
// GNU General Public License for more details. | |
-// | |
+// | |
// You should have received a copy of the GNU General Public License | |
// along with this program; if not, write to the Free Software | |
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
@@ -81,7 +81,7 @@ WindowDownloadList::redraw() { | |
Range range = rak::advance_bidirectional(m_view->begin_visible(), | |
m_view->focus() != m_view->end_visible() ? m_view->focus() : m_view->begin_visible(), | |
m_view->end_visible(), | |
- m_canvas->height() / 3); | |
+ (m_canvas->height() - 1) / 3); | |
// Make sure we properly fill out the last lines so it looks like | |
// there are more torrents, yet don't hide it if we got the last one | |
@@ -89,24 +89,84 @@ WindowDownloadList::redraw() { | |
if (range.second != m_view->end_visible()) | |
++range.second; | |
- int pos = 1; | |
+ int pos = 2; | |
while (range.first != range.second) { | |
char buffer[m_canvas->width() + 1]; | |
char* position; | |
char* last = buffer + m_canvas->width() - 2 + 1; | |
+ int title_length; | |
+ | |
+ //1 = red | |
+ //2 = yellow | |
+ //3 = green | |
+ | |
+ //do not print on last lines if cannot show whole torrent | |
+ if (pos >= (m_canvas->height() - 1)) | |
+ break; | |
+ //print title | |
position = print_download_title(buffer, last, *range.first); | |
- m_canvas->print(0, pos++, "%c %s", range.first == m_view->focus() ? '*' : ' ', buffer); | |
- | |
+ title_length = strlen(buffer); | |
+ m_canvas->print(0, pos, "%c %s", range.first == m_view->focus() ? '*' : ' ', buffer); | |
+ | |
+ //title color | |
+ if ((*range.first)->is_done()) { | |
+ //finished | |
+ m_canvas->set_attr(3, pos, (title_length - 1), A_NORMAL, 3); | |
+ } | |
+ else { | |
+ //not finished | |
+ m_canvas->set_attr(3, pos, (title_length - 1), A_NORMAL, 2); | |
+ } | |
+ | |
+ //print title extra | |
+ position = print_download_title_extra(buffer, last, *range.first); | |
+ | |
+ //do not let title extra get off screen | |
+ buffer[m_canvas->width() - title_length - 2] = '\0'; | |
+ | |
+ m_canvas->print((title_length + 2), pos++, "%s", buffer); | |
+ | |
+ //print info | |
position = print_download_info(buffer, last, *range.first); | |
- m_canvas->print(0, pos++, "%c %s", range.first == m_view->focus() ? '*' : ' ', buffer); | |
+ m_canvas->print(0, pos, "%c %s", range.first == m_view->focus() ? '*' : ' ', buffer); | |
- position = print_download_status(buffer, last, *range.first); | |
- m_canvas->print(0, pos++, "%c %s", range.first == m_view->focus() ? '*' : ' ', buffer); | |
+ //info color | |
+ if (!(*range.first)->info()->is_open()) { | |
+ //closed | |
+ m_canvas->set_attr(3, pos, 6, A_NORMAL, 1); | |
+ } | |
+ else if (!(*range.first)->info()->is_active()) { | |
+ //paused | |
+ m_canvas->set_attr(3, pos, 6, A_NORMAL, 2); | |
+ } | |
+ else { | |
+ //active | |
+ m_canvas->set_attr(3, pos, 6, A_NORMAL, 3); | |
+ } | |
+ | |
+ if ((*range.first)->is_done()) { | |
+ //finished | |
+ m_canvas->set_attr(12, pos, 8, A_NORMAL, 3); | |
+ } | |
+ | |
+ //do not print info extra if it collides with info | |
+ if ((strlen(buffer) + 2) <= (m_canvas->width() - 16)) { | |
+ | |
+ //print info extra | |
+ position = print_download_info_extra(buffer, last, *range.first); | |
+ m_canvas->print((m_canvas->width() - 16), pos++, "%s", buffer); | |
+ | |
+ } | |
+ else { | |
+ pos++; | |
+ } | |
+ //skip one line | |
+ pos++; | |
++range.first; | |
- } | |
+ } | |
} | |
} | |
diff -rupN src-old/display/window_title.cc src/display/window_title.cc | |
--- src-old/display/window_title.cc 2011-04-05 13:26:07.000000000 +0300 | |
+++ src/display/window_title.cc 2011-10-29 11:24:43.121632604 +0300 | |
@@ -5,12 +5,12 @@ | |
// it under the terms of the GNU General Public License as published by | |
// the Free Software Foundation; either version 2 of the License, or | |
// (at your option) any later version. | |
-// | |
+// | |
// This program is distributed in the hope that it will be useful, | |
// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
// GNU General Public License for more details. | |
-// | |
+// | |
// You should have received a copy of the GNU General Public License | |
// along with this program; if not, write to the Free Software | |
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
@@ -48,6 +48,9 @@ WindowTitle::redraw() { | |
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((((int)m_canvas->width() - (int)m_title.size()) / 2 - 4), 0, 3, A_NORMAL, 2); | |
+ m_canvas->set_attr( ((((int)m_canvas->width() - (int)m_title.size()) / 2) + (int)m_title.size() + 1), 0, 3, A_NORMAL, 2); | |
} | |
} | |
diff -rupN src-old/ui/download_list.cc src/ui/download_list.cc | |
--- src-old/ui/download_list.cc 2011-04-05 13:26:12.000000000 +0300 | |
+++ src/ui/download_list.cc 2011-10-29 11:25:55.498296415 +0300 | |
@@ -5,12 +5,12 @@ | |
// it under the terms of the GNU General Public License as published by | |
// the Free Software Foundation; either version 2 of the License, or | |
// (at your option) any later version. | |
-// | |
+// | |
// This program is distributed in the hope that it will be useful, | |
// but WITHOUT ANY WARRANTY; without even the implied warranty of | |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
// GNU General Public License for more details. | |
-// | |
+// | |
// You should have received a copy of the GNU General Public License | |
// along with this program; if not, write to the Free Software | |
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
@@ -157,7 +157,7 @@ DownloadList::activate_display(Display d | |
m_uiArray[m_state] = NULL; | |
break; | |
- | |
+ | |
case DISPLAY_DOWNLOAD_LIST: | |
m_uiArray[DISPLAY_DOWNLOAD_LIST]->disable(); | |
@@ -171,7 +171,7 @@ DownloadList::activate_display(Display d | |
case DISPLAY_STRING_LIST: | |
m_uiArray[m_state]->disable(); | |
break; | |
- | |
+ | |
default: | |
break; | |
} | |
@@ -193,7 +193,7 @@ DownloadList::activate_display(Display d | |
download->activate(m_frame); | |
download->slot_exit(sigc::bind(sigc::mem_fun(*this, &DownloadList::activate_display), DISPLAY_DOWNLOAD_LIST)); | |
- | |
+ | |
m_uiArray[DISPLAY_DOWNLOAD] = download; | |
break; | |
} | |
@@ -220,7 +220,7 @@ DownloadList::activate_display(Display d | |
// Set title. | |
switch (displayType) { | |
case DISPLAY_DOWNLOAD_LIST: | |
- control->ui()->window_title()->set_title("rTorrent " VERSION "/" + | |
+ control->ui()->window_title()->set_title("rTorrent-mod " VERSION "/" + | |
std::string(torrent::version()) + " - " + | |
rpc::call_command_string("session.name")); | |
break; | |
@@ -285,7 +285,7 @@ DownloadList::receive_view_input(Input t | |
void | |
DownloadList::receive_exit_input(Input type) { | |
input::TextInput* input = control->ui()->current_input(); | |
- | |
+ | |
// We should check that this object is the one holding the input. | |
if (input == NULL) | |
return; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment