mirror of
https://github.com/irssi/irssi.git
synced 2024-12-04 14:46:39 -05:00
Setting lag_min_show to -1 disables displaying lag entirely.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@390 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
d4f8ad2c3f
commit
dc22d8830d
@ -527,7 +527,7 @@ static void statusbar_lag(SBAR_ITEM_REC *item, int ypos)
|
|||||||
lag_unknown = now-server->lag_last_check >
|
lag_unknown = now-server->lag_last_check >
|
||||||
MAX_LAG_UNKNOWN_TIME+settings_get_int("lag_check_time");
|
MAX_LAG_UNKNOWN_TIME+settings_get_int("lag_check_time");
|
||||||
|
|
||||||
if (server->lag < lag_min_show && !lag_unknown)
|
if (lag_min_show < 0 || (server->lag < lag_min_show && !lag_unknown))
|
||||||
size_needed = 0; /* small lag, don't display */
|
size_needed = 0; /* small lag, don't display */
|
||||||
else {
|
else {
|
||||||
g_string_sprintf(str, "%d.%02d", server->lag/1000, (server->lag % 1000)/10);
|
g_string_sprintf(str, "%d.%02d", server->lag/1000, (server->lag % 1000)/10);
|
||||||
@ -541,27 +541,25 @@ static void statusbar_lag(SBAR_ITEM_REC *item, int ypos)
|
|||||||
size_needed = str->len+7;
|
size_needed = str->len+7;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item->size != size_needed)
|
if (item->size != size_needed) {
|
||||||
{
|
/* we need more (or less..) space! */
|
||||||
/* we need more (or less..) space! */
|
statusbar_item_resize(item, size_needed);
|
||||||
statusbar_item_resize(item, size_needed);
|
g_string_free(str, TRUE);
|
||||||
g_string_free(str, TRUE);
|
return;
|
||||||
return;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (item->size != 0)
|
if (item->size != 0) {
|
||||||
{
|
lag_last_draw = now;
|
||||||
lag_last_draw = now;
|
move(ypos, item->xpos);
|
||||||
move(ypos, item->xpos);
|
set_color((1 << 4)+3); addch('[');
|
||||||
set_color((1 << 4)+3); addch('[');
|
set_color((1 << 4)+7); addstr("Lag: ");
|
||||||
set_color((1 << 4)+7); addstr("Lag: ");
|
|
||||||
|
|
||||||
set_color((1 << 4)+15); addstr(str->str);
|
set_color((1 << 4)+15); addstr(str->str);
|
||||||
set_color((1 << 4)+3); addch(']');
|
set_color((1 << 4)+3); addch(']');
|
||||||
|
|
||||||
screen_refresh();
|
screen_refresh();
|
||||||
}
|
}
|
||||||
g_string_free(str, TRUE);
|
g_string_free(str, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sig_statusbar_lag_redraw(void)
|
static void sig_statusbar_lag_redraw(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user