1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-16 01:08:31 -04:00

[leds] Removed commented code

This commit is contained in:
Witold Filipczyk 2022-03-19 10:02:47 +01:00
parent 318d260b9c
commit 533e688ab1

View File

@ -177,6 +177,7 @@ init_led_panel(struct led_panel *leds)
} }
} }
#if 0
static int static int
draw_timer(struct terminal *term, int xpos, int ypos, struct color_pair *color) draw_timer(struct terminal *term, int xpos, int ypos, struct color_pair *color)
{ {
@ -191,6 +192,7 @@ draw_timer(struct terminal *term, int xpos, int ypos, struct color_pair *color)
return length; return length;
} }
#endif
static int static int
draw_timer_node(struct terminal *term, int xpos, int ypos, unsigned int node_number) draw_timer_node(struct terminal *term, int xpos, int ypos, unsigned int node_number)
@ -207,7 +209,7 @@ draw_timer_node(struct terminal *term, int xpos, int ypos, unsigned int node_num
return length; return length;
} }
#if 0
static int static int
draw_show_ip(struct session *ses, int xpos, int ypos, struct color_pair *color) draw_show_ip(struct session *ses, int xpos, int ypos, struct color_pair *color)
{ {
@ -224,6 +226,7 @@ draw_show_ip(struct session *ses, int xpos, int ypos, struct color_pair *color)
} }
return 0; return 0;
} }
#endif
static int static int
draw_show_ip_node(struct session *ses, int xpos, int ypos, unsigned int node_number) draw_show_ip_node(struct session *ses, int xpos, int ypos, unsigned int node_number)
@ -242,6 +245,7 @@ draw_show_ip_node(struct session *ses, int xpos, int ypos, unsigned int node_num
return 0; return 0;
} }
#if 0
static int static int
draw_temperature(struct session *ses, int xpos, int ypos, struct color_pair *color) draw_temperature(struct session *ses, int xpos, int ypos, struct color_pair *color)
{ {
@ -284,6 +288,7 @@ draw_temperature(struct session *ses, int xpos, int ypos, struct color_pair *col
return length; return length;
} }
#endif
static int static int
draw_temperature_node(struct session *ses, int xpos, int ypos, unsigned int node_number) draw_temperature_node(struct session *ses, int xpos, int ypos, unsigned int node_number)
@ -329,6 +334,7 @@ draw_temperature_node(struct session *ses, int xpos, int ypos, unsigned int node
} }
#ifdef HAVE_STRFTIME #ifdef HAVE_STRFTIME
#if 0
static int static int
draw_clock(struct terminal *term, int xpos, int ypos, struct color_pair *color) draw_clock(struct terminal *term, int xpos, int ypos, struct color_pair *color)
{ {
@ -344,6 +350,7 @@ draw_clock(struct terminal *term, int xpos, int ypos, struct color_pair *color)
return length; return length;
} }
#endif
static int static int
draw_clock_node(struct terminal *term, int xpos, int ypos, unsigned int node_number) draw_clock_node(struct terminal *term, int xpos, int ypos, unsigned int node_number)
@ -382,7 +389,6 @@ void
draw_leds(struct session *ses) draw_leds(struct session *ses)
{ {
struct terminal *term = ses->tab->term; struct terminal *term = ses->tab->term;
// struct color_pair *led_color = NULL;
unsigned int node_number = 0; unsigned int node_number = 0;
int i; int i;
int xpos = term->width - LEDS_COUNT - 3; int xpos = term->width - LEDS_COUNT - 3;
@ -394,21 +400,13 @@ draw_leds(struct session *ses)
* could do that easily. */ * could do that easily. */
if (get_opt_int("ui.timer.enable", NULL) == 2) { if (get_opt_int("ui.timer.enable", NULL) == 2) {
node_number = get_bfu_color_node(term, "status.status-text"); node_number = get_bfu_color_node(term, "status.status-text");
// led_color = get_bfu_color(term, "status.status-text");
// if (!led_color) goto end;
if (!node_number) goto end; if (!node_number) goto end;
// term->leds_length += draw_timer(term, xpos, ypos, led_color);
term->leds_length += draw_timer_node(term, xpos, ypos, node_number); term->leds_length += draw_timer_node(term, xpos, ypos, node_number);
} }
if (!get_leds_panel_enable()) return; if (!get_leds_panel_enable()) return;
// if (!led_color) {
// led_color = get_bfu_color(term, "status.status-text");
// if (!led_color) goto end;
// }
if (!node_number) { if (!node_number) {
node_number = get_bfu_color_node(term, "status.status-text"); node_number = get_bfu_color_node(term, "status.status-text");
if (!node_number) goto end; if (!node_number) goto end;
@ -416,42 +414,34 @@ draw_leds(struct session *ses)
#ifdef HAVE_STRFTIME #ifdef HAVE_STRFTIME
if (get_leds_clock_enable()) { if (get_leds_clock_enable()) {
// term->leds_length += draw_clock(term, xpos - term->leds_length, ypos, led_color);
term->leds_length += draw_clock_node(term, xpos - term->leds_length, ypos, node_number); term->leds_length += draw_clock_node(term, xpos - term->leds_length, ypos, node_number);
} }
#endif #endif
if (get_leds_temperature_enable()) { if (get_leds_temperature_enable()) {
// struct color_pair *color = get_bfu_color(term, "status.status-text");
unsigned int node_number = get_bfu_color_node(term, "status.status-text"); unsigned int node_number = get_bfu_color_node(term, "status.status-text");
// if (color) term->leds_length += draw_temperature(ses, xpos - term->leds_length, ypos, color);
if (node_number) term->leds_length += draw_temperature_node(ses, xpos - term->leds_length, ypos, node_number); if (node_number) term->leds_length += draw_temperature_node(ses, xpos - term->leds_length, ypos, node_number);
} }
if (get_leds_show_ip_enable()) { if (get_leds_show_ip_enable()) {
// struct color_pair *color = get_bfu_color(term, "status.showip-text");
unsigned int node_number = get_bfu_color_node(term, "status.showip-text"); unsigned int node_number = get_bfu_color_node(term, "status.showip-text");
// if (color) term->leds_length += draw_show_ip(ses, xpos - term->leds_length, ypos, color);
if (node_number) term->leds_length += draw_show_ip_node(ses, xpos - term->leds_length, ypos, node_number); if (node_number) term->leds_length += draw_show_ip_node(ses, xpos - term->leds_length, ypos, node_number);
} }
/* We must shift the whole thing by one char to left, because we don't /* We must shift the whole thing by one char to left, because we don't
* draft the char in the right-down corner :(. */ * draft the char in the right-down corner :(. */
// draw_char(term, xpos, ypos, '[', 0, led_color);
draw_char_node(term, xpos, ypos, '[', 0, node_number); draw_char_node(term, xpos, ypos, '[', 0, node_number);
for (i = 0; i < LEDS_COUNT; i++) { for (i = 0; i < LEDS_COUNT; i++) {
struct led *led = &ses->status.leds.leds[i]; struct led *led = &ses->status.leds.leds[i];
// draw_char(term, xpos + i + 1, ypos, led->value__, 0, led_color);
draw_char_node(term, xpos + i + 1, ypos, led->value__, 0, node_number); draw_char_node(term, xpos + i + 1, ypos, led->value__, 0, node_number);
led->value_changed__ = 0; led->value_changed__ = 0;
} }
// draw_char(term, xpos + LEDS_COUNT + 1, ypos, ']', 0, led_color);
draw_char_node(term, xpos + LEDS_COUNT + 1, ypos, ']', 0, node_number); draw_char_node(term, xpos + LEDS_COUNT + 1, ypos, ']', 0, node_number);
term->leds_length += LEDS_COUNT + 2; term->leds_length += LEDS_COUNT + 2;