diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2008-05-06 18:34:04 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2008-05-06 18:34:04 +0200 |
commit | aea2a0e31aa53c2d491418e9816571489c6e0af9 (patch) | |
tree | 85092e528b3c33c0f4e812767e8ea93dff529d34 /src/plugins | |
parent | 5689970cb1db504aa6a9bda901f7861e4a6d9fc4 (diff) | |
download | weechat-aea2a0e31aa53c2d491418e9816571489c6e0af9.zip |
Do not automatically switch to xfer buffer, except by /xfer command
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/xfer/xfer-buffer.c | 8 | ||||
-rw-r--r-- | src/plugins/xfer/xfer-command.c | 25 | ||||
-rw-r--r-- | src/plugins/xfer/xfer-config.c | 12 | ||||
-rw-r--r-- | src/plugins/xfer/xfer-config.h | 2 |
4 files changed, 26 insertions, 21 deletions
diff --git a/src/plugins/xfer/xfer-buffer.c b/src/plugins/xfer/xfer-buffer.c index dd32ca0b0..2219c6e22 100644 --- a/src/plugins/xfer/xfer-buffer.c +++ b/src/plugins/xfer/xfer-buffer.c @@ -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"); } } diff --git a/src/plugins/xfer/xfer-command.c b/src/plugins/xfer/xfer-command.c index 95d5adfff..771b144b1 100644 --- a/src/plugins/xfer/xfer-command.c +++ b/src/plugins/xfer/xfer-command.c @@ -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; } diff --git a/src/plugins/xfer/xfer-config.c b/src/plugins/xfer/xfer-config.c index 3efc0e487..6b1961015 100644 --- a/src/plugins/xfer/xfer-config.c +++ b/src/plugins/xfer/xfer-config.c @@ -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, diff --git a/src/plugins/xfer/xfer-config.h b/src/plugins/xfer/xfer-config.h index 3101693a4..298529737 100644 --- a/src/plugins/xfer/xfer-config.h +++ b/src/plugins/xfer/xfer-config.h @@ -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; |