summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2011-04-11 13:57:00 +0200
committerSebastien Helleu <flashcode@flashtux.org>2011-04-11 13:57:00 +0200
commit9d128cad2279ff070d8204e1d3d7003f379c58da (patch)
treef75686cf81ed32debf23d13809dd90c7f0b0cb4d /src/core
parent8597f14bf6efe06000070c0e90fe729c843e8d7c (diff)
downloadweechat-9d128cad2279ff070d8204e1d3d7003f379c58da.zip
core: add messages counts in hotlist for each buffer, option weechat.look.hotlist_buffer_separator and tag "notify_none"
New options: - weechat.look.hotlist_buffer_separator - weechat.look.hotlist_count_max - weechat.look.hotlist_count_min_msg - weechat.color.status_count_msg - weechat.color.status_count_private - weechat.color.status_count_highlight - weechat.color.status_count_other
Diffstat (limited to 'src/core')
-rw-r--r--src/core/wee-command.c3
-rw-r--r--src/core/wee-config.c48
-rw-r--r--src/core/wee-config.h7
-rw-r--r--src/core/wee-upgrade.c21
4 files changed, 73 insertions, 6 deletions
diff --git a/src/core/wee-command.c b/src/core/wee-command.c
index ef159092e..e350ddd25 100644
--- a/src/core/wee-command.c
+++ b/src/core/wee-command.c
@@ -4818,7 +4818,8 @@ command_init ()
"The default key alt+'=' toggles filtering on/off.\n\n"
"Tags most commonly used:\n"
" no_filter, no_highlight, no_log, log0..log9 (log level),\n"
- " notify_message, notify_private, notify_highlight,\n"
+ " notify_none, notify_message, notify_private, "
+ "notify_highlight,\n"
" nick_xxx (xxx is nick in message),\n"
" irc_xxx (xxx is command name or number, see /server raw),\n"
" irc_numeric, irc_error, irc_action, irc_ctcp, "
diff --git a/src/core/wee-config.c b/src/core/wee-config.c
index 4cff94579..aad659c53 100644
--- a/src/core/wee-config.c
+++ b/src/core/wee-config.c
@@ -88,6 +88,9 @@ struct t_config_option *config_look_highlight;
struct t_config_option *config_look_highlight_regex;
struct t_config_option *config_look_highlight_tags;
struct t_config_option *config_look_hline_char;
+struct t_config_option *config_look_hotlist_buffer_separator;
+struct t_config_option *config_look_hotlist_count_max;
+struct t_config_option *config_look_hotlist_count_min_msg;
struct t_config_option *config_look_hotlist_names_count;
struct t_config_option *config_look_hotlist_names_length;
struct t_config_option *config_look_hotlist_names_level;
@@ -161,6 +164,10 @@ struct t_config_option *config_color_status_data_msg;
struct t_config_option *config_color_status_data_private;
struct t_config_option *config_color_status_data_highlight;
struct t_config_option *config_color_status_data_other;
+struct t_config_option *config_color_status_count_msg;
+struct t_config_option *config_color_status_count_private;
+struct t_config_option *config_color_status_count_highlight;
+struct t_config_option *config_color_status_count_other;
struct t_config_option *config_color_status_more;
struct t_config_option *config_color_status_time;
struct t_config_option *config_color_input_text_not_found;
@@ -1595,6 +1602,23 @@ config_weechat_init_options ()
"will draw a real line with ncurses, but may cause bugs with URL "
"selection under some terminals), wide chars are NOT allowed here"),
NULL, 0, 0, "-", NULL, 0, NULL, NULL, &config_change_buffers, NULL, NULL, NULL);
+ config_look_hotlist_buffer_separator = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "hotlist_buffer_separator", "string",
+ N_("string displayed between buffers in hotlist"),
+ NULL, 0, 0, ", ", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
+ config_look_hotlist_count_max = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "hotlist_count_max", "integer",
+ N_("max number of messages count to display in hotlist for a buffer "
+ "(0 = never display messages count)"),
+ NULL, 0, GUI_HOTLIST_NUM_PRIORITIES, "2", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
+ config_look_hotlist_count_min_msg = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "hotlist_count_min_msg", "integer",
+ N_("display messages count if number of messages is greater or equal "
+ "to this value"),
+ NULL, 1, 100, "2", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
config_look_hotlist_names_count = config_file_new_option (
weechat_config_file, ptr_section,
"hotlist_names_count", "integer",
@@ -2089,6 +2113,30 @@ config_weechat_init_options ()
"(status bar)"),
NULL, -1, 0, "default", NULL, 0,
NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ config_color_status_count_msg = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "status_count_msg", "color",
+ N_("text color for count of messages in hotlist (status bar)"),
+ NULL, -1, 0, "brown", NULL, 0,
+ NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ config_color_status_count_private = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "status_count_private", "color",
+ N_("text color for count of private messages in hotlist (status bar)"),
+ NULL, -1, 0, "green", NULL, 0,
+ NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ config_color_status_count_highlight = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "status_count_highlight", "color",
+ N_("text color for count of highlight messages in hotlist (status bar)"),
+ NULL, -1, 0, "magenta", NULL, 0,
+ NULL, NULL, &config_change_color, NULL, NULL, NULL);
+ config_color_status_count_other = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "status_count_other", "color",
+ N_("text color for count of other messages in hotlist (status bar)"),
+ NULL, -1, 0, "default", NULL, 0,
+ NULL, NULL, &config_change_color, NULL, NULL, NULL);
config_color_status_more = config_file_new_option (
weechat_config_file, ptr_section,
"status_more", "color",
diff --git a/src/core/wee-config.h b/src/core/wee-config.h
index 002e07ee4..de7f62fe3 100644
--- a/src/core/wee-config.h
+++ b/src/core/wee-config.h
@@ -114,6 +114,9 @@ extern struct t_config_option *config_look_day_change_time_format;
extern struct t_config_option *config_look_highlight;
extern struct t_config_option *config_look_highlight_regex;
extern struct t_config_option *config_look_hline_char;
+extern struct t_config_option *config_look_hotlist_buffer_separator;
+extern struct t_config_option *config_look_hotlist_count_max;
+extern struct t_config_option *config_look_hotlist_count_min_msg;
extern struct t_config_option *config_look_hotlist_names_count;
extern struct t_config_option *config_look_hotlist_names_length;
extern struct t_config_option *config_look_hotlist_names_level;
@@ -185,6 +188,10 @@ extern struct t_config_option *config_color_status_data_msg;
extern struct t_config_option *config_color_status_data_private;
extern struct t_config_option *config_color_status_data_highlight;
extern struct t_config_option *config_color_status_data_other;
+extern struct t_config_option *config_color_status_count_msg;
+extern struct t_config_option *config_color_status_count_private;
+extern struct t_config_option *config_color_status_count_highlight;
+extern struct t_config_option *config_color_status_count_other;
extern struct t_config_option *config_color_status_more;
extern struct t_config_option *config_color_status_time;
extern struct t_config_option *config_color_input_text_not_found;
diff --git a/src/core/wee-upgrade.c b/src/core/wee-upgrade.c
index 2c2eb4963..4e351853c 100644
--- a/src/core/wee-upgrade.c
+++ b/src/core/wee-upgrade.c
@@ -304,9 +304,10 @@ upgrade_weechat_read_cb (void *data,
struct t_gui_nick_group *ptr_group;
struct t_gui_buffer *ptr_buffer, *ptr_buffer_for_merge;
struct t_gui_line *new_line;
+ struct t_gui_hotlist *new_hotlist;
struct timeval creation_time;
void *buf;
- int size, index, length;
+ int i, size, index, length;
/* make C compiler happy */
(void) data;
@@ -563,10 +564,20 @@ upgrade_weechat_read_cb (void *data,
if (buf)
{
memcpy (&creation_time, buf, size);
- gui_hotlist_add (ptr_buffer,
- infolist_integer (infolist, "priority"),
- &creation_time,
- 1);
+ new_hotlist = gui_hotlist_add (ptr_buffer,
+ infolist_integer (infolist, "priority"),
+ &creation_time,
+ 1);
+ if (new_hotlist)
+ {
+ for (i = 0; i < GUI_HOTLIST_NUM_PRIORITIES; i++)
+ {
+ snprintf (option_name, sizeof (option_name),
+ "count_%02d", i);
+ new_hotlist->count[i] = infolist_integer (infolist,
+ option_name);
+ }
+ }
}
}
}