summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/wee-config.c12
-rw-r--r--src/core/wee-config.h2
-rw-r--r--src/gui/gui-bar-item.c16
3 files changed, 26 insertions, 4 deletions
diff --git a/src/core/wee-config.c b/src/core/wee-config.c
index 95efa5e98..1855f070f 100644
--- a/src/core/wee-config.c
+++ b/src/core/wee-config.c
@@ -112,8 +112,10 @@ 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;
struct t_config_option *config_look_hotlist_names_merged_buffers;
+struct t_config_option *config_look_hotlist_prefix;
struct t_config_option *config_look_hotlist_short_names;
struct t_config_option *config_look_hotlist_sort;
+struct t_config_option *config_look_hotlist_suffix;
struct t_config_option *config_look_hotlist_unique_numbers;
struct t_config_option *config_look_input_cursor_scroll;
struct t_config_option *config_look_input_share;
@@ -2128,6 +2130,11 @@ config_weechat_init_options ()
"hotlist_names_merged_buffers", "boolean",
N_("if set, force display of names in hotlist for merged buffers"),
NULL, 0, 0, "off", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
+ config_look_hotlist_prefix = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "hotlist_prefix", "string",
+ N_("text displayed at the beginning of the hotlist"),
+ NULL, 0, 0, "H: ", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
config_look_hotlist_short_names = config_file_new_option (
weechat_config_file, ptr_section,
"hotlist_short_names", "boolean",
@@ -2143,6 +2150,11 @@ config_weechat_init_options ()
"group_time_asc|group_time_desc|group_number_asc|"
"group_number_desc|number_asc|number_desc",
0, 0, "group_time_asc", NULL, 0, NULL, NULL, &config_change_hotlist_sort, NULL, NULL, NULL);
+ config_look_hotlist_suffix = config_file_new_option (
+ weechat_config_file, ptr_section,
+ "hotlist_suffix", "string",
+ N_("text displayed at the end of the hotlist"),
+ NULL, 0, 0, "", NULL, 0, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL);
config_look_hotlist_unique_numbers = config_file_new_option (
weechat_config_file, ptr_section,
"hotlist_unique_numbers", "boolean",
diff --git a/src/core/wee-config.h b/src/core/wee-config.h
index b1f541b5d..c6542528e 100644
--- a/src/core/wee-config.h
+++ b/src/core/wee-config.h
@@ -137,8 +137,10 @@ 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;
extern struct t_config_option *config_look_hotlist_names_merged_buffers;
+extern struct t_config_option *config_look_hotlist_prefix;
extern struct t_config_option *config_look_hotlist_short_names;
extern struct t_config_option *config_look_hotlist_sort;
+extern struct t_config_option *config_look_hotlist_suffix;
extern struct t_config_option *config_look_hotlist_unique_numbers;
extern struct t_config_option *config_look_input_cursor_scroll;
extern struct t_config_option *config_look_input_share;
diff --git a/src/gui/gui-bar-item.c b/src/gui/gui-bar-item.c
index a203a5e3c..b7a601a84 100644
--- a/src/gui/gui-bar-item.c
+++ b/src/gui/gui-bar-item.c
@@ -1086,7 +1086,8 @@ char *
gui_bar_item_default_hotlist (void *data, struct t_gui_bar_item *item,
struct t_gui_window *window)
{
- char buf[2048], format[32], *buffer_without_name_displayed;
+ char buf[4096], format[32], *buffer_without_name_displayed;
+ const char *hotlist_suffix;
struct t_gui_hotlist *ptr_hotlist;
int numbers_count, names_count, display_name, count_max;
int priority, priority_min, priority_min_displayed, private;
@@ -1101,8 +1102,7 @@ gui_bar_item_default_hotlist (void *data, struct t_gui_bar_item *item,
buf[0] = '\0';
- /* TRANSLATORS: if possible use short word or abbreviation here ("Act" is abbreviation of "Activity" in english) */
- strcat (buf, _("Act: "));
+ strcat (buf, CONFIG_STRING(config_look_hotlist_prefix));
buffer_without_name_displayed = NULL;
if (CONFIG_BOOLEAN(config_look_hotlist_unique_numbers) && last_gui_buffer)
@@ -1275,7 +1275,7 @@ gui_bar_item_default_hotlist (void *data, struct t_gui_bar_item *item,
}
}
- if (strlen (buf) > sizeof (buf) - 64)
+ if (strlen (buf) > sizeof (buf) - 256)
break;
}
}
@@ -1283,6 +1283,14 @@ gui_bar_item_default_hotlist (void *data, struct t_gui_bar_item *item,
if (buffer_without_name_displayed)
free (buffer_without_name_displayed);
+ hotlist_suffix = CONFIG_STRING(config_look_hotlist_suffix);
+ if (hotlist_suffix[0]
+ && (strlen (buf) + strlen (CONFIG_STRING(config_look_hotlist_suffix)) + 16 < sizeof (buf)))
+ {
+ strcat (buf, GUI_COLOR_CUSTOM_BAR_FG);
+ strcat (buf, hotlist_suffix);
+ }
+
return strdup (buf);
}