1205 |
{ |
{ |
1206 |
t_gui_window *ptr_win; |
t_gui_window *ptr_win; |
1207 |
t_weechat_hotlist *ptr_hotlist; |
t_weechat_hotlist *ptr_hotlist; |
1208 |
char format_more[32], str_nicks[32], *string; |
char format[32], str_nicks[32], *string; |
1209 |
int i, first_mode, x; |
int i, first_mode, x; |
1210 |
|
int display_name, names_count; |
1211 |
|
|
1212 |
/* make gcc happy */ |
/* make gcc happy */ |
1213 |
(void) buffer; |
(void) buffer; |
1387 |
_("Act: ")); |
_("Act: ")); |
1388 |
wprintw (ptr_win->win_status, string); |
wprintw (ptr_win->win_status, string); |
1389 |
free (string); |
free (string); |
1390 |
|
|
1391 |
|
names_count = 0; |
1392 |
for (ptr_hotlist = hotlist; ptr_hotlist; |
for (ptr_hotlist = hotlist; ptr_hotlist; |
1393 |
ptr_hotlist = ptr_hotlist->next_hotlist) |
ptr_hotlist = ptr_hotlist->next_hotlist) |
1394 |
{ |
{ |
1397 |
case HOTLIST_LOW: |
case HOTLIST_LOW: |
1398 |
gui_window_set_color (ptr_win->win_status, |
gui_window_set_color (ptr_win->win_status, |
1399 |
COLOR_WIN_STATUS_DATA_OTHER); |
COLOR_WIN_STATUS_DATA_OTHER); |
1400 |
|
display_name = ((cfg_look_hotlist_names_level & 1) != 0); |
1401 |
break; |
break; |
1402 |
case HOTLIST_MSG: |
case HOTLIST_MSG: |
1403 |
gui_window_set_color (ptr_win->win_status, |
gui_window_set_color (ptr_win->win_status, |
1404 |
COLOR_WIN_STATUS_DATA_MSG); |
COLOR_WIN_STATUS_DATA_MSG); |
1405 |
|
display_name = ((cfg_look_hotlist_names_level & 2) != 0); |
1406 |
break; |
break; |
1407 |
case HOTLIST_PRIVATE: |
case HOTLIST_PRIVATE: |
1408 |
gui_window_set_color (ptr_win->win_status, |
gui_window_set_color (ptr_win->win_status, |
1409 |
COLOR_WIN_STATUS_DATA_PRIVATE); |
COLOR_WIN_STATUS_DATA_PRIVATE); |
1410 |
|
display_name = ((cfg_look_hotlist_names_level & 4) != 0); |
1411 |
break; |
break; |
1412 |
case HOTLIST_HIGHLIGHT: |
case HOTLIST_HIGHLIGHT: |
1413 |
gui_window_set_color (ptr_win->win_status, |
gui_window_set_color (ptr_win->win_status, |
1414 |
COLOR_WIN_STATUS_DATA_HIGHLIGHT); |
COLOR_WIN_STATUS_DATA_HIGHLIGHT); |
1415 |
|
display_name = ((cfg_look_hotlist_names_level & 8) != 0); |
1416 |
|
break; |
1417 |
|
default: |
1418 |
|
display_name = 0; |
1419 |
break; |
break; |
1420 |
} |
} |
1421 |
if (ptr_hotlist->buffer->dcc) |
if (ptr_hotlist->buffer->dcc) |
1422 |
wprintw (ptr_win->win_status, "%d/DCC", |
{ |
1423 |
|
wprintw (ptr_win->win_status, "%d", |
1424 |
ptr_hotlist->buffer->number); |
ptr_hotlist->buffer->number); |
1425 |
|
gui_window_set_color (ptr_win->win_status, |
1426 |
|
COLOR_WIN_STATUS_DELIMITERS); |
1427 |
|
wprintw (ptr_win->win_status, ":"); |
1428 |
|
gui_window_set_color (ptr_win->win_status, |
1429 |
|
COLOR_WIN_STATUS); |
1430 |
|
wprintw (ptr_win->win_status, "DCC"); |
1431 |
|
} |
1432 |
else |
else |
1433 |
|
{ |
1434 |
wprintw (ptr_win->win_status, "%d", |
wprintw (ptr_win->win_status, "%d", |
1435 |
ptr_hotlist->buffer->number); |
ptr_hotlist->buffer->number); |
1436 |
gui_window_set_color (ptr_win->win_status, |
|
1437 |
COLOR_WIN_STATUS); |
if (display_name && (cfg_look_hotlist_names_count != 0) |
1438 |
|
&& (names_count < cfg_look_hotlist_names_count)) |
1439 |
|
{ |
1440 |
|
names_count++; |
1441 |
|
|
1442 |
|
gui_window_set_color (ptr_win->win_status, |
1443 |
|
COLOR_WIN_STATUS_DELIMITERS); |
1444 |
|
wprintw (ptr_win->win_status, ":"); |
1445 |
|
|
1446 |
|
gui_window_set_color (ptr_win->win_status, |
1447 |
|
COLOR_WIN_STATUS); |
1448 |
|
if (cfg_look_hotlist_names_length == 0) |
1449 |
|
snprintf (format, sizeof (format) - 1, "%%s"); |
1450 |
|
else |
1451 |
|
snprintf (format, sizeof (format) - 1, "%%.%ds", cfg_look_hotlist_names_length); |
1452 |
|
if (BUFFER_IS_SERVER(ptr_hotlist->buffer)) |
1453 |
|
wprintw (ptr_win->win_status, format, SERVER(ptr_hotlist->buffer)->name); |
1454 |
|
else if (BUFFER_IS_CHANNEL(ptr_hotlist->buffer) |
1455 |
|
|| BUFFER_IS_PRIVATE(ptr_hotlist->buffer)) |
1456 |
|
wprintw (ptr_win->win_status, format, CHANNEL(ptr_hotlist->buffer)->name); |
1457 |
|
} |
1458 |
|
} |
1459 |
|
|
1460 |
if (ptr_hotlist->next_hotlist) |
if (ptr_hotlist->next_hotlist) |
1461 |
wprintw (ptr_win->win_status, ","); |
wprintw (ptr_win->win_status, ","); |
1462 |
} |
} |
1507 |
mvwprintw (ptr_win->win_status, 0, x, "%s", string); |
mvwprintw (ptr_win->win_status, 0, x, "%s", string); |
1508 |
else |
else |
1509 |
{ |
{ |
1510 |
snprintf (format_more, sizeof (format_more) - 1, "%%-%ds", (int)(strlen (string))); |
snprintf (format, sizeof (format) - 1, "%%-%ds", (int)(strlen (string))); |
1511 |
mvwprintw (ptr_win->win_status, 0, x, format_more, " "); |
mvwprintw (ptr_win->win_status, 0, x, format, " "); |
1512 |
} |
} |
1513 |
if (gui_buffer_has_nicklist (ptr_win->buffer)) |
if (gui_buffer_has_nicklist (ptr_win->buffer)) |
1514 |
{ |
{ |