1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-07 02:03:13 +02:00

Remove obsolete nicklist options, add /bar toggle to hide/show quietly a bar

This commit is contained in:
Sebastien Helleu
2008-12-19 13:24:46 +01:00
parent edd70d4636
commit 896f509861
18 changed files with 198 additions and 406 deletions
+29 -1
View File
@@ -423,6 +423,33 @@ command_bar (void *data, struct t_gui_buffer *buffer,
return WEECHAT_RC_OK;
}
/* toggle a bar visible/hidden */
if (string_strcasecmp (argv[1], "toggle") == 0)
{
if (argc < 3)
{
gui_chat_printf (NULL,
_("%sError: missing arguments for \"%s\" "
"command"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
"bar");
return WEECHAT_RC_ERROR;
}
ptr_bar = gui_bar_search (argv[2]);
if (!ptr_bar)
{
gui_chat_printf (NULL,
_("%sError: unknown bar \"%s\""),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
argv[2]);
return WEECHAT_RC_ERROR;
}
gui_bar_set (ptr_bar, "hidden",
CONFIG_BOOLEAN(ptr_bar->hidden) ? "0" : "1");
return WEECHAT_RC_OK;
}
/* scroll in a bar */
if (string_strcasecmp (argv[1], "scroll") == 0)
{
@@ -3384,6 +3411,7 @@ command_init ()
" value: new value for option\n"
" hide: hide a bar\n"
" show: show an hidden bar\n"
" toggle: hide/show a bar\n"
" scroll: scroll bar up/down\n"
" buffer: name of buffer to scroll ('*' "
"means current buffer, you should use '*' for root bars)\n"
@@ -3405,7 +3433,7 @@ command_init ()
" /bar scroll nicklist #weechat y-100%\n"
" scroll to end of nicklist on current buffer:\n"
" /bar scroll nicklist * ye"),
"add|default|del|set|hide|show|scroll|list|listfull|"
"add|default|del|set|hide|show|toggle|scroll|list|listfull|"
"listitems %r name|hidden|priority|conditions|position|"
"filling_top_bottom|filling_left_right|size|size_max|"
"color_fg|color_delim|color_bg|separator|items",
-34
View File
@@ -82,11 +82,6 @@ struct t_config_option *config_look_hotlist_names_level;
struct t_config_option *config_look_hotlist_short_names;
struct t_config_option *config_look_hotlist_sort;
struct t_config_option *config_look_item_time_format;
struct t_config_option *config_look_nicklist;
struct t_config_option *config_look_nicklist_max_size;
struct t_config_option *config_look_nicklist_min_size;
struct t_config_option *config_look_nicklist_position;
struct t_config_option *config_look_nicklist_separator;
struct t_config_option *config_look_nickmode;
struct t_config_option *config_look_nickmode_empty;
struct t_config_option *config_look_paste_max_lines;
@@ -1132,35 +1127,6 @@ config_weechat_init ()
"item_time_format", "string",
N_("time format for \"time\" bar item"),
NULL, 0, 0, "%H:%M", NULL, NULL, NULL, NULL, NULL, NULL, NULL);
config_look_nicklist = config_file_new_option (
weechat_config_file, ptr_section,
"nicklist", "boolean",
N_("display nicklist (on buffers with nicklist enabled)"),
NULL, 0, 0, "on", NULL, NULL, NULL, &config_change_buffers, NULL, NULL, NULL);
config_look_nicklist_max_size = config_file_new_option (
weechat_config_file, ptr_section,
"nicklist_max_size", "integer",
N_("max size for nicklist (width or height, depending on "
"nicklist_position (0 = no max size; if min = max "
"and > 0, then size is fixed))"),
NULL, 0, 100, "0", NULL, NULL, NULL, &config_change_buffers, NULL, NULL, NULL);
config_look_nicklist_min_size = config_file_new_option (
weechat_config_file, ptr_section,
"nicklist_min_size", "integer",
N_("min size for nicklist (width or height, depending on "
"nicklist_position (0 = no min size))"),
NULL, 0, 100, "0", NULL, NULL, NULL, &config_change_buffers, NULL, NULL, NULL);
config_look_nicklist_position = config_file_new_option (
weechat_config_file, ptr_section,
"nicklist_position", "integer",
N_("nicklist position (top, left, right (default), "
"bottom)"),
"left|right|top|bottom", 0, 0, "right", NULL, NULL, NULL, &config_change_buffers, NULL, NULL, NULL);
config_look_nicklist_separator = config_file_new_option (
weechat_config_file, ptr_section,
"nicklist_separator", "boolean",
N_("separator between chat and nicklist"),
NULL, 0, 0, "on", NULL, NULL, NULL, &config_change_buffers, NULL, NULL, NULL);
config_look_nickmode = config_file_new_option (
weechat_config_file, ptr_section,
"nickmode", "boolean",
-5
View File
@@ -88,11 +88,6 @@ extern struct t_config_option *config_look_hotlist_names_level;
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_item_time_format;
extern struct t_config_option *config_look_nicklist;
extern struct t_config_option *config_look_nicklist_max_size;
extern struct t_config_option *config_look_nicklist_min_size;
extern struct t_config_option *config_look_nicklist_position;
extern struct t_config_option *config_look_nicklist_separator;
extern struct t_config_option *config_look_nickmode;
extern struct t_config_option *config_look_nickmode_empty;
extern struct t_config_option *config_look_paste_max_lines;
+1 -2
View File
@@ -50,8 +50,7 @@
int
gui_chat_get_real_width (struct t_gui_window *window)
{
if (window->buffer->nicklist
&& (CONFIG_INTEGER(config_look_nicklist_position) == CONFIG_LOOK_NICKLIST_RIGHT))
if (window->win_chat_x + window->win_chat_width < gui_window_get_width ())
return window->win_chat_width - 1;
else
return window->win_chat_width;
+1 -2
View File
@@ -112,8 +112,7 @@ irc_channel_new (struct t_irc_server *server, int channel_type,
if (channel_type == IRC_CHANNEL_TYPE_CHANNEL)
{
if (weechat_config_integer (weechat_config_get ("weechat.look.nicklist")))
weechat_buffer_set (new_buffer, "nicklist", "1");
weechat_buffer_set (new_buffer, "nicklist", "1");
weechat_buffer_set (new_buffer, "nicklist_display_groups", "0");
weechat_nicklist_add_group (new_buffer, NULL, IRC_NICK_GROUP_OP,
"weechat.color.nicklist_group", 1);