mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
[bittorrent] removed commented code
This commit is contained in:
parent
f666ea48ed
commit
66137e8f7d
@ -477,8 +477,6 @@ draw_bittorrent_piece_progress_node(struct download *download, struct terminal *
|
|||||||
/* Draw the progress meter part "[### ]" */
|
/* Draw the progress meter part "[### ]" */
|
||||||
if (!text && width > 2) {
|
if (!text && width > 2) {
|
||||||
width -= 2;
|
width -= 2;
|
||||||
// draw_text(term, x++, y, "[", 1, 0, NULL);
|
|
||||||
// draw_text(term, x + width, y, "]", 1, 0, NULL);
|
|
||||||
draw_text_node(term, x++, y, "[", 1, 0, 0);
|
draw_text_node(term, x++, y, "[", 1, 0, 0);
|
||||||
draw_text_node(term, x + width, y, "]", 1, 0, 0);
|
draw_text_node(term, x + width, y, "]", 1, 0, 0);
|
||||||
}
|
}
|
||||||
@ -488,7 +486,6 @@ draw_bittorrent_piece_progress_node(struct download *download, struct terminal *
|
|||||||
if (width <= 0 || !bittorrent->cache)
|
if (width <= 0 || !bittorrent->cache)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// if (!color) color = get_bfu_color(term, "dialog.meter");
|
|
||||||
if (!color_node) node_number = get_bfu_color_node(term, "dialog.meter");
|
if (!color_node) node_number = get_bfu_color_node(term, "dialog.meter");
|
||||||
|
|
||||||
if (bittorrent->meta.pieces <= width) {
|
if (bittorrent->meta.pieces <= width) {
|
||||||
@ -501,7 +498,6 @@ draw_bittorrent_piece_progress_node(struct download *download, struct terminal *
|
|||||||
set_box(&piecebox, x, y, chars_per_piece + !!remainder, 1);
|
set_box(&piecebox, x, y, chars_per_piece + !!remainder, 1);
|
||||||
|
|
||||||
if (bittorrent->cache->entries[piece].completed) {
|
if (bittorrent->cache->entries[piece].completed) {
|
||||||
// draw_box(term, &piecebox, ' ', 0, color);
|
|
||||||
draw_box_node(term, &piecebox, ' ', 0, node_number);
|
draw_box_node(term, &piecebox, ' ', 0, node_number);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -512,14 +508,10 @@ draw_bittorrent_piece_progress_node(struct download *download, struct terminal *
|
|||||||
} else {
|
} else {
|
||||||
int pieces_per_char = bittorrent->meta.pieces / width;
|
int pieces_per_char = bittorrent->meta.pieces / width;
|
||||||
int remainder = bittorrent->meta.pieces % width;
|
int remainder = bittorrent->meta.pieces % width;
|
||||||
/// struct color_pair inverted;
|
unsigned int inverted_node = get_bfu_color_node(term, "dialog.meter"); // must be inverted
|
||||||
unsigned int inverted_node = get_bfu_color_node(term, "dialog.meter");
|
|
||||||
uint32_t completed = 0, remaining = 0;
|
uint32_t completed = 0, remaining = 0;
|
||||||
int steps = pieces_per_char + !!remainder;
|
int steps = pieces_per_char + !!remainder;
|
||||||
|
|
||||||
/// inverted.background = color->foreground;
|
|
||||||
/// inverted.foreground = color->background;
|
|
||||||
|
|
||||||
for (piece = 0; piece < bittorrent->meta.pieces; piece++) {
|
for (piece = 0; piece < bittorrent->meta.pieces; piece++) {
|
||||||
if (bittorrent->cache->entries[piece].completed)
|
if (bittorrent->cache->entries[piece].completed)
|
||||||
completed++;
|
completed++;
|
||||||
@ -533,13 +525,10 @@ draw_bittorrent_piece_progress_node(struct download *download, struct terminal *
|
|||||||
assert(remaining <= pieces_per_char + !!remainder);
|
assert(remaining <= pieces_per_char + !!remainder);
|
||||||
|
|
||||||
if (!remaining) /* 100% */ {
|
if (!remaining) /* 100% */ {
|
||||||
// draw_char_color(term, x, y, color);
|
|
||||||
draw_char_color_node(term, x, y, node_number);
|
draw_char_color_node(term, x, y, node_number);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (completed > remaining) /* > 50% */ {
|
else if (completed > remaining) /* > 50% */ {
|
||||||
// draw_char(term, x, y, BORDER_SVLINE,
|
|
||||||
// SCREEN_ATTR_FRAME, color);
|
|
||||||
draw_char_node(term, x, y, BORDER_SVLINE,
|
draw_char_node(term, x, y, BORDER_SVLINE,
|
||||||
SCREEN_ATTR_FRAME, node_number);
|
SCREEN_ATTR_FRAME, node_number);
|
||||||
}
|
}
|
||||||
@ -577,7 +566,6 @@ draw_bittorrent_piece_progress_node(struct download *download, struct terminal *
|
|||||||
|
|
||||||
assert(slen <= width);
|
assert(slen <= width);
|
||||||
|
|
||||||
// draw_text(term, x_start, y, s, slen, 0, NULL);
|
|
||||||
draw_text_node(term, x_start, y, s, slen, 0, 0);
|
draw_text_node(term, x_start, y, s, slen, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user