mirror of
https://github.com/weechat/weechat.git
synced 2026-07-09 03:03:12 +02:00
Do not automatically switch to xfer buffer, except by /xfer command
This commit is contained in:
@@ -60,6 +60,8 @@ xfer_buffer_refresh (char *hotlist)
|
||||
{
|
||||
snprintf (str_color, sizeof (str_color),
|
||||
"%s,%s",
|
||||
(line == xfer_buffer_selected_line) ?
|
||||
weechat_config_string (xfer_config_color_text_selected) :
|
||||
weechat_config_string (xfer_config_color_text),
|
||||
weechat_config_string (xfer_config_color_text_bg));
|
||||
|
||||
@@ -229,7 +231,6 @@ xfer_buffer_input_cb (void *data, struct t_gui_buffer *buffer,
|
||||
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) buffer;
|
||||
|
||||
xfer = xfer_search_by_number (xfer_buffer_selected_line);
|
||||
|
||||
@@ -273,6 +274,10 @@ xfer_buffer_input_cb (void *data, struct t_gui_buffer *buffer,
|
||||
xfer_buffer_refresh (WEECHAT_HOTLIST_MESSAGE);
|
||||
}
|
||||
}
|
||||
else if (weechat_strcasecmp (input_data, "q") == 0)
|
||||
{
|
||||
weechat_buffer_close (buffer, 1);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
@@ -314,6 +319,5 @@ xfer_buffer_open ()
|
||||
weechat_buffer_set (xfer_buffer, "title", _("Xfer list"));
|
||||
weechat_buffer_set (xfer_buffer, "key_bind_meta2-A", "/xfer up");
|
||||
weechat_buffer_set (xfer_buffer, "key_bind_meta2-B", "/xfer down");
|
||||
weechat_buffer_set (xfer_buffer, "display", "1");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,26 +44,27 @@ xfer_command_xfer (void *data, struct t_gui_buffer *buffer, int argc,
|
||||
|
||||
if (!xfer_buffer)
|
||||
xfer_buffer_open ();
|
||||
|
||||
if (argc > 1)
|
||||
|
||||
if (xfer_buffer)
|
||||
{
|
||||
if (strcmp (argv[1], "up") == 0)
|
||||
weechat_buffer_set (xfer_buffer, "display", "1");
|
||||
|
||||
if (argc > 1)
|
||||
{
|
||||
if (xfer_buffer_selected_line > 0)
|
||||
if (strcmp (argv[1], "up") == 0)
|
||||
{
|
||||
xfer_buffer_selected_line--;
|
||||
xfer_buffer_refresh (NULL);
|
||||
if (xfer_buffer_selected_line > 0)
|
||||
xfer_buffer_selected_line--;
|
||||
}
|
||||
}
|
||||
else if (strcmp (argv[1], "down") == 0)
|
||||
{
|
||||
if (xfer_buffer_selected_line < xfer_count - 1)
|
||||
else if (strcmp (argv[1], "down") == 0)
|
||||
{
|
||||
xfer_buffer_selected_line++;
|
||||
xfer_buffer_refresh (NULL);
|
||||
if (xfer_buffer_selected_line < xfer_count - 1)
|
||||
xfer_buffer_selected_line++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
xfer_buffer_refresh (NULL);
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ struct t_config_option *xfer_config_look_progress_bar_size;
|
||||
|
||||
struct t_config_option *xfer_config_color_text;
|
||||
struct t_config_option *xfer_config_color_text_bg;
|
||||
struct t_config_option *xfer_config_color_selected_bg;
|
||||
struct t_config_option *xfer_config_color_text_selected;
|
||||
struct t_config_option *xfer_config_color_status[XFER_NUM_STATUS];
|
||||
|
||||
/* xfer config, network section */
|
||||
@@ -102,7 +102,7 @@ xfer_config_init ()
|
||||
xfer_config_look_auto_open_buffer = weechat_config_new_option (
|
||||
xfer_config_file, ptr_section,
|
||||
"auto_open_buffer", "boolean",
|
||||
N_("auto open xfer buffer and switch to it when a new xfer is added "
|
||||
N_("auto open xfer buffer when a new xfer is added "
|
||||
"to list"),
|
||||
NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
xfer_config_look_progress_bar_size = weechat_config_new_option (
|
||||
@@ -134,11 +134,11 @@ xfer_config_init ()
|
||||
N_("background color"),
|
||||
NULL, 0, 0, "default",
|
||||
NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
xfer_config_color_selected_bg = weechat_config_new_option (
|
||||
xfer_config_color_text_selected = weechat_config_new_option (
|
||||
xfer_config_file, ptr_section,
|
||||
"selected_bg", "color",
|
||||
N_("background color for selected line"),
|
||||
NULL, 0, 0, "magenta",
|
||||
"text_selected", "color",
|
||||
N_("text color of selected xfer line"),
|
||||
NULL, 0, 0, "white",
|
||||
NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
xfer_config_color_status[XFER_STATUS_WAITING] = weechat_config_new_option (
|
||||
xfer_config_file, ptr_section,
|
||||
|
||||
@@ -31,7 +31,7 @@ extern struct t_config_option *xfer_config_look_progress_bar_size;
|
||||
|
||||
extern struct t_config_option *xfer_config_color_text;
|
||||
extern struct t_config_option *xfer_config_color_text_bg;
|
||||
extern struct t_config_option *xfer_config_color_selected_bg;
|
||||
extern struct t_config_option *xfer_config_color_text_selected;
|
||||
extern struct t_config_option *xfer_config_color_status[];
|
||||
|
||||
extern struct t_config_option *xfer_config_network_timeout;
|
||||
|
||||
Reference in New Issue
Block a user