1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-27 13:26:38 +02:00

Added "smart" hotlist

This commit is contained in:
Sebastien Helleu
2005-10-01 13:41:10 +00:00
parent 63e73b30ad
commit 75c58c423c
16 changed files with 2264 additions and 1892 deletions
+5 -1
View File
@@ -1,9 +1,13 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2005-09-24
ChangeLog - 2005-10-01
Version 0.1.6 (under dev!):
* enhanced "smart" hotlist, with names (new options:
look_hotlist_names_{count|level|length})
Version 0.1.5 (2005-09-24):
* added /ame command (send CTCP action to all channels of all
connected servers)
+265 -234
View File
File diff suppressed because it is too large Load Diff
+265 -234
View File
File diff suppressed because it is too large Load Diff
+267 -234
View File
File diff suppressed because it is too large Load Diff
+259 -232
View File
File diff suppressed because it is too large Load Diff
+19 -3
View File
@@ -87,6 +87,9 @@ int cfg_look_infobar;
char *cfg_look_infobar_timestamp;
int cfg_look_infobar_seconds;
int cfg_look_infobar_delay_highlight;
int cfg_look_hotlist_names_count;
int cfg_look_hotlist_names_level;
int cfg_look_hotlist_names_length;
t_config_option weechat_options_look[] =
{ { "look_set_title", N_("set title for window (terminal for Curses GUI) with name & version"),
@@ -147,12 +150,12 @@ t_config_option weechat_options_look[] =
"right", cfg_look_nicklist_position_values, &cfg_look_nicklist_position, NULL, config_change_buffers },
{ "look_nicklist_min_size", N_("min size for nicklist"),
N_("min size for nicklist (width or height, depending on look_nicklist_position "
"(0 = no min size))"),
"(0 = no min size))"),
OPTION_TYPE_INT, 0, 100, 0,
NULL, NULL, &cfg_look_nicklist_min_size, NULL, config_change_buffers },
{ "look_nicklist_max_size", N_("max size for nicklist"),
N_("max size for nicklist (width or height, depending on look_nicklist_position "
"(0 = no max size; if min == max and > 0, then size is fixed))"),
"(0 = no max size; if min == max and > 0, then size is fixed))"),
OPTION_TYPE_INT, 0, 100, 0,
NULL, NULL, &cfg_look_nicklist_max_size, NULL, config_change_buffers },
{ "look_no_nickname", N_("text to display instead of nick when not connected"),
@@ -185,9 +188,22 @@ t_config_option weechat_options_look[] =
NULL, NULL, &cfg_look_infobar_seconds, NULL, config_change_buffer_content },
{ "look_infobar_delay_highlight", N_("delay (in seconds) for highlight messages in infobar"),
N_("delay (in seconds) for highlight messages in infobar "
"(0 = disable highlight notifications in infobar)"),
"(0 = disable highlight notifications in infobar)"),
OPTION_TYPE_INT, 0, INT_MAX, 7,
NULL, NULL, &cfg_look_infobar_delay_highlight, NULL, config_change_noop },
{ "look_hotlist_names_count", N_("max number of names in hotlist"),
N_("max number of names in hotlist (0 = no name displayed, only buffer numbers)"),
OPTION_TYPE_INT, 0, 32, 3,
NULL, NULL, &cfg_look_hotlist_names_count, NULL, config_change_buffer_content },
{ "look_hotlist_names_level", N_("level for displaying names in hotlist"),
N_("level for displaying names in hotlist (combination of: 1=join/part, 2=message, "
"4=private, 8=highlight, for example: 12=private+highlight)"),
OPTION_TYPE_INT, 1, 15, 12,
NULL, NULL, &cfg_look_hotlist_names_level, NULL, config_change_buffer_content },
{ "look_hotlist_names_length", N_("max length of names in hotlist"),
N_("max length of names in hotlist (0 = no limit)"),
OPTION_TYPE_INT, 0, 32, 0,
NULL, NULL, &cfg_look_hotlist_names_length, NULL, config_change_buffer_content },
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
};
+3
View File
@@ -102,6 +102,9 @@ extern int cfg_look_infobar;
extern char *cfg_look_infobar_timestamp;
extern int cfg_look_infobar_seconds;
extern int cfg_look_infobar_delay_highlight;
extern int cfg_look_hotlist_names_count;
extern int cfg_look_hotlist_names_level;
extern int cfg_look_hotlist_names_length;
extern int cfg_col_title;
extern int cfg_col_title_bg;
+49 -8
View File
@@ -1205,8 +1205,9 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
{
t_gui_window *ptr_win;
t_weechat_hotlist *ptr_hotlist;
char format_more[32], str_nicks[32], *string;
char format[32], str_nicks[32], *string;
int i, first_mode, x;
int display_name, names_count;
/* make gcc happy */
(void) buffer;
@@ -1386,6 +1387,8 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
_("Act: "));
wprintw (ptr_win->win_status, string);
free (string);
names_count = 0;
for (ptr_hotlist = hotlist; ptr_hotlist;
ptr_hotlist = ptr_hotlist->next_hotlist)
{
@@ -1394,28 +1397,66 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
case HOTLIST_LOW:
gui_window_set_color (ptr_win->win_status,
COLOR_WIN_STATUS_DATA_OTHER);
display_name = ((cfg_look_hotlist_names_level & 1) != 0);
break;
case HOTLIST_MSG:
gui_window_set_color (ptr_win->win_status,
COLOR_WIN_STATUS_DATA_MSG);
display_name = ((cfg_look_hotlist_names_level & 2) != 0);
break;
case HOTLIST_PRIVATE:
gui_window_set_color (ptr_win->win_status,
COLOR_WIN_STATUS_DATA_PRIVATE);
display_name = ((cfg_look_hotlist_names_level & 4) != 0);
break;
case HOTLIST_HIGHLIGHT:
gui_window_set_color (ptr_win->win_status,
COLOR_WIN_STATUS_DATA_HIGHLIGHT);
display_name = ((cfg_look_hotlist_names_level & 8) != 0);
break;
default:
display_name = 0;
break;
}
if (ptr_hotlist->buffer->dcc)
wprintw (ptr_win->win_status, "%d/DCC",
ptr_hotlist->buffer->number);
else
{
wprintw (ptr_win->win_status, "%d",
ptr_hotlist->buffer->number);
gui_window_set_color (ptr_win->win_status,
COLOR_WIN_STATUS);
gui_window_set_color (ptr_win->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (ptr_win->win_status, ":");
gui_window_set_color (ptr_win->win_status,
COLOR_WIN_STATUS);
wprintw (ptr_win->win_status, "DCC");
}
else
{
wprintw (ptr_win->win_status, "%d",
ptr_hotlist->buffer->number);
if (display_name && (cfg_look_hotlist_names_count != 0)
&& (names_count < cfg_look_hotlist_names_count))
{
names_count++;
gui_window_set_color (ptr_win->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (ptr_win->win_status, ":");
gui_window_set_color (ptr_win->win_status,
COLOR_WIN_STATUS);
if (cfg_look_hotlist_names_length == 0)
snprintf (format, sizeof (format) - 1, "%%s");
else
snprintf (format, sizeof (format) - 1, "%%.%ds", cfg_look_hotlist_names_length);
if (BUFFER_IS_SERVER(ptr_hotlist->buffer))
wprintw (ptr_win->win_status, format, SERVER(ptr_hotlist->buffer)->name);
else if (BUFFER_IS_CHANNEL(ptr_hotlist->buffer)
|| BUFFER_IS_PRIVATE(ptr_hotlist->buffer))
wprintw (ptr_win->win_status, format, CHANNEL(ptr_hotlist->buffer)->name);
}
}
if (ptr_hotlist->next_hotlist)
wprintw (ptr_win->win_status, ",");
}
@@ -1466,8 +1507,8 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
mvwprintw (ptr_win->win_status, 0, x, "%s", string);
else
{
snprintf (format_more, sizeof (format_more) - 1, "%%-%ds", (int)(strlen (string)));
mvwprintw (ptr_win->win_status, 0, x, format_more, " ");
snprintf (format, sizeof (format) - 1, "%%-%ds", (int)(strlen (string)));
mvwprintw (ptr_win->win_status, 0, x, format, " ");
}
if (gui_buffer_has_nicklist (ptr_win->buffer))
{
+5 -1
View File
@@ -1,9 +1,13 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2005-09-24
ChangeLog - 2005-10-01
Version 0.1.6 (under dev!):
* enhanced "smart" hotlist, with names (new options:
look_hotlist_names_{count|level|length})
Version 0.1.5 (2005-09-24):
* added /ame command (send CTCP action to all channels of all
connected servers)
+265 -234
View File
File diff suppressed because it is too large Load Diff
+265 -234
View File
File diff suppressed because it is too large Load Diff
+267 -234
View File
File diff suppressed because it is too large Load Diff
+259 -232
View File
File diff suppressed because it is too large Load Diff
+19 -3
View File
@@ -87,6 +87,9 @@ int cfg_look_infobar;
char *cfg_look_infobar_timestamp;
int cfg_look_infobar_seconds;
int cfg_look_infobar_delay_highlight;
int cfg_look_hotlist_names_count;
int cfg_look_hotlist_names_level;
int cfg_look_hotlist_names_length;
t_config_option weechat_options_look[] =
{ { "look_set_title", N_("set title for window (terminal for Curses GUI) with name & version"),
@@ -147,12 +150,12 @@ t_config_option weechat_options_look[] =
"right", cfg_look_nicklist_position_values, &cfg_look_nicklist_position, NULL, config_change_buffers },
{ "look_nicklist_min_size", N_("min size for nicklist"),
N_("min size for nicklist (width or height, depending on look_nicklist_position "
"(0 = no min size))"),
"(0 = no min size))"),
OPTION_TYPE_INT, 0, 100, 0,
NULL, NULL, &cfg_look_nicklist_min_size, NULL, config_change_buffers },
{ "look_nicklist_max_size", N_("max size for nicklist"),
N_("max size for nicklist (width or height, depending on look_nicklist_position "
"(0 = no max size; if min == max and > 0, then size is fixed))"),
"(0 = no max size; if min == max and > 0, then size is fixed))"),
OPTION_TYPE_INT, 0, 100, 0,
NULL, NULL, &cfg_look_nicklist_max_size, NULL, config_change_buffers },
{ "look_no_nickname", N_("text to display instead of nick when not connected"),
@@ -185,9 +188,22 @@ t_config_option weechat_options_look[] =
NULL, NULL, &cfg_look_infobar_seconds, NULL, config_change_buffer_content },
{ "look_infobar_delay_highlight", N_("delay (in seconds) for highlight messages in infobar"),
N_("delay (in seconds) for highlight messages in infobar "
"(0 = disable highlight notifications in infobar)"),
"(0 = disable highlight notifications in infobar)"),
OPTION_TYPE_INT, 0, INT_MAX, 7,
NULL, NULL, &cfg_look_infobar_delay_highlight, NULL, config_change_noop },
{ "look_hotlist_names_count", N_("max number of names in hotlist"),
N_("max number of names in hotlist (0 = no name displayed, only buffer numbers)"),
OPTION_TYPE_INT, 0, 32, 3,
NULL, NULL, &cfg_look_hotlist_names_count, NULL, config_change_buffer_content },
{ "look_hotlist_names_level", N_("level for displaying names in hotlist"),
N_("level for displaying names in hotlist (combination of: 1=join/part, 2=message, "
"4=private, 8=highlight, for example: 12=private+highlight)"),
OPTION_TYPE_INT, 1, 15, 12,
NULL, NULL, &cfg_look_hotlist_names_level, NULL, config_change_buffer_content },
{ "look_hotlist_names_length", N_("max length of names in hotlist"),
N_("max length of names in hotlist (0 = no limit)"),
OPTION_TYPE_INT, 0, 32, 0,
NULL, NULL, &cfg_look_hotlist_names_length, NULL, config_change_buffer_content },
{ NULL, NULL, NULL, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL }
};
+3
View File
@@ -102,6 +102,9 @@ extern int cfg_look_infobar;
extern char *cfg_look_infobar_timestamp;
extern int cfg_look_infobar_seconds;
extern int cfg_look_infobar_delay_highlight;
extern int cfg_look_hotlist_names_count;
extern int cfg_look_hotlist_names_level;
extern int cfg_look_hotlist_names_length;
extern int cfg_col_title;
extern int cfg_col_title_bg;
+49 -8
View File
@@ -1205,8 +1205,9 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
{
t_gui_window *ptr_win;
t_weechat_hotlist *ptr_hotlist;
char format_more[32], str_nicks[32], *string;
char format[32], str_nicks[32], *string;
int i, first_mode, x;
int display_name, names_count;
/* make gcc happy */
(void) buffer;
@@ -1386,6 +1387,8 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
_("Act: "));
wprintw (ptr_win->win_status, string);
free (string);
names_count = 0;
for (ptr_hotlist = hotlist; ptr_hotlist;
ptr_hotlist = ptr_hotlist->next_hotlist)
{
@@ -1394,28 +1397,66 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
case HOTLIST_LOW:
gui_window_set_color (ptr_win->win_status,
COLOR_WIN_STATUS_DATA_OTHER);
display_name = ((cfg_look_hotlist_names_level & 1) != 0);
break;
case HOTLIST_MSG:
gui_window_set_color (ptr_win->win_status,
COLOR_WIN_STATUS_DATA_MSG);
display_name = ((cfg_look_hotlist_names_level & 2) != 0);
break;
case HOTLIST_PRIVATE:
gui_window_set_color (ptr_win->win_status,
COLOR_WIN_STATUS_DATA_PRIVATE);
display_name = ((cfg_look_hotlist_names_level & 4) != 0);
break;
case HOTLIST_HIGHLIGHT:
gui_window_set_color (ptr_win->win_status,
COLOR_WIN_STATUS_DATA_HIGHLIGHT);
display_name = ((cfg_look_hotlist_names_level & 8) != 0);
break;
default:
display_name = 0;
break;
}
if (ptr_hotlist->buffer->dcc)
wprintw (ptr_win->win_status, "%d/DCC",
ptr_hotlist->buffer->number);
else
{
wprintw (ptr_win->win_status, "%d",
ptr_hotlist->buffer->number);
gui_window_set_color (ptr_win->win_status,
COLOR_WIN_STATUS);
gui_window_set_color (ptr_win->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (ptr_win->win_status, ":");
gui_window_set_color (ptr_win->win_status,
COLOR_WIN_STATUS);
wprintw (ptr_win->win_status, "DCC");
}
else
{
wprintw (ptr_win->win_status, "%d",
ptr_hotlist->buffer->number);
if (display_name && (cfg_look_hotlist_names_count != 0)
&& (names_count < cfg_look_hotlist_names_count))
{
names_count++;
gui_window_set_color (ptr_win->win_status,
COLOR_WIN_STATUS_DELIMITERS);
wprintw (ptr_win->win_status, ":");
gui_window_set_color (ptr_win->win_status,
COLOR_WIN_STATUS);
if (cfg_look_hotlist_names_length == 0)
snprintf (format, sizeof (format) - 1, "%%s");
else
snprintf (format, sizeof (format) - 1, "%%.%ds", cfg_look_hotlist_names_length);
if (BUFFER_IS_SERVER(ptr_hotlist->buffer))
wprintw (ptr_win->win_status, format, SERVER(ptr_hotlist->buffer)->name);
else if (BUFFER_IS_CHANNEL(ptr_hotlist->buffer)
|| BUFFER_IS_PRIVATE(ptr_hotlist->buffer))
wprintw (ptr_win->win_status, format, CHANNEL(ptr_hotlist->buffer)->name);
}
}
if (ptr_hotlist->next_hotlist)
wprintw (ptr_win->win_status, ",");
}
@@ -1466,8 +1507,8 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
mvwprintw (ptr_win->win_status, 0, x, "%s", string);
else
{
snprintf (format_more, sizeof (format_more) - 1, "%%-%ds", (int)(strlen (string)));
mvwprintw (ptr_win->win_status, 0, x, format_more, " ");
snprintf (format, sizeof (format) - 1, "%%-%ds", (int)(strlen (string)));
mvwprintw (ptr_win->win_status, 0, x, format, " ");
}
if (gui_buffer_has_nicklist (ptr_win->buffer))
{