mirror of
https://github.com/weechat/weechat.git
synced 2026-06-26 04:46:37 +02:00
Rename options "irc.look.open_{channel|pv}_near_server" to "irc.look.new_{channel|pv}_position" with new values (none, next or near_server)
This commit is contained in:
@@ -150,8 +150,8 @@ irc_channel_new (struct t_irc_server *server, int channel_type,
|
||||
{
|
||||
struct t_irc_channel *new_channel;
|
||||
struct t_gui_buffer *new_buffer;
|
||||
int buffer_created;
|
||||
char *buffer_name;
|
||||
int buffer_created, current_buffer_number, buffer_position;
|
||||
char *buffer_name, str_number[32];;
|
||||
|
||||
/* alloc memory for new channel */
|
||||
if ((new_channel = malloc (sizeof (*new_channel))) == NULL)
|
||||
@@ -170,6 +170,8 @@ irc_channel_new (struct t_irc_server *server, int channel_type,
|
||||
weechat_nicklist_remove_all (new_buffer);
|
||||
else
|
||||
{
|
||||
current_buffer_number = weechat_buffer_get_integer (weechat_current_buffer (),
|
||||
"number");
|
||||
new_buffer = weechat_buffer_new (buffer_name,
|
||||
&irc_input_data_cb, NULL,
|
||||
&irc_buffer_close_cb, NULL);
|
||||
@@ -178,12 +180,24 @@ irc_channel_new (struct t_irc_server *server, int channel_type,
|
||||
free (new_channel);
|
||||
return NULL;
|
||||
}
|
||||
if (((channel_type == IRC_CHANNEL_TYPE_CHANNEL)
|
||||
&& weechat_config_boolean (irc_config_look_open_channel_near_server))
|
||||
|| ((channel_type == IRC_CHANNEL_TYPE_PRIVATE)
|
||||
&& weechat_config_boolean (irc_config_look_open_pv_near_server)))
|
||||
buffer_position = (channel_type == IRC_CHANNEL_TYPE_CHANNEL) ?
|
||||
weechat_config_integer (irc_config_look_new_channel_position) :
|
||||
weechat_config_integer (irc_config_look_new_pv_position);
|
||||
switch (buffer_position)
|
||||
{
|
||||
irc_channel_move_near_server (server, channel_type, new_buffer);
|
||||
case IRC_CONFIG_LOOK_BUFFER_POSITION_NONE:
|
||||
/* do nothing */
|
||||
break;
|
||||
case IRC_CONFIG_LOOK_BUFFER_POSITION_NEXT:
|
||||
/* move buffer to current number + 1 */
|
||||
snprintf (str_number, sizeof (str_number),
|
||||
"%d", current_buffer_number + 1);
|
||||
weechat_buffer_set (new_buffer, "number", str_number);
|
||||
break;
|
||||
case IRC_CONFIG_LOOK_BUFFER_POSITION_NEAR_SERVER:
|
||||
/* move buffer after last channel/pv of server */
|
||||
irc_channel_move_near_server (server, channel_type, new_buffer);
|
||||
break;
|
||||
}
|
||||
buffer_created = 1;
|
||||
}
|
||||
|
||||
@@ -52,8 +52,8 @@ struct t_config_section *irc_config_section_server = NULL;
|
||||
struct t_config_option *irc_config_look_color_nicks_in_server_messages;
|
||||
struct t_config_option *irc_config_look_color_pv_nick_like_channel;
|
||||
struct t_config_option *irc_config_look_server_buffer;
|
||||
struct t_config_option *irc_config_look_open_channel_near_server;
|
||||
struct t_config_option *irc_config_look_open_pv_near_server;
|
||||
struct t_config_option *irc_config_look_new_channel_position;
|
||||
struct t_config_option *irc_config_look_new_pv_position;
|
||||
struct t_config_option *irc_config_look_nick_prefix;
|
||||
struct t_config_option *irc_config_look_nick_suffix;
|
||||
struct t_config_option *irc_config_look_nick_completion_smart;
|
||||
@@ -1545,16 +1545,24 @@ irc_config_init ()
|
||||
"merge_with_core|merge_without_core|independent", 0, 0, "merge_with_core",
|
||||
NULL, 0, NULL, NULL,
|
||||
&irc_config_change_look_server_buffer, NULL, NULL, NULL);
|
||||
irc_config_look_open_channel_near_server = weechat_config_new_option (
|
||||
irc_config_look_new_channel_position = weechat_config_new_option (
|
||||
irc_config_file, ptr_section,
|
||||
"open_channel_near_server", "boolean",
|
||||
N_("open new channels near server"),
|
||||
NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
irc_config_look_open_pv_near_server = weechat_config_new_option (
|
||||
"new_channel_position", "integer",
|
||||
N_("force position of new channel in list of buffers "
|
||||
"(none = default position (should be last buffer)r, "
|
||||
"next = current buffer + 1, near_server = after last channel/pv "
|
||||
"of server)"),
|
||||
"none|next|near_server", 0, 0, "none",
|
||||
NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
irc_config_look_new_pv_position = weechat_config_new_option (
|
||||
irc_config_file, ptr_section,
|
||||
"open_pv_near_server", "boolean",
|
||||
N_("open new privates near server"),
|
||||
NULL, 0, 0, "off", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
"new_pv_position", "integer",
|
||||
N_("force position of new private in list of buffers "
|
||||
"(none = default position (should be last buffer)r, "
|
||||
"next = current buffer + 1, near_server = after last channel/pv "
|
||||
"of server)"),
|
||||
"none|next|near_server", 0, 0, "none",
|
||||
NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
irc_config_look_nick_prefix = weechat_config_new_option (
|
||||
irc_config_file, ptr_section,
|
||||
"nick_prefix", "string",
|
||||
|
||||
@@ -29,6 +29,13 @@ enum t_irc_config_look_server_buffer
|
||||
IRC_CONFIG_LOOK_SERVER_BUFFER_INDEPENDENT,
|
||||
};
|
||||
|
||||
enum t_irc_config_look_buffer_position
|
||||
{
|
||||
IRC_CONFIG_LOOK_BUFFER_POSITION_NONE = 0,
|
||||
IRC_CONFIG_LOOK_BUFFER_POSITION_NEXT,
|
||||
IRC_CONFIG_LOOK_BUFFER_POSITION_NEAR_SERVER,
|
||||
};
|
||||
|
||||
enum t_irc_config_look_item_display_server
|
||||
{
|
||||
IRC_CONFIG_LOOK_ITEM_DISPLAY_SERVER_PLUGIN = 0,
|
||||
@@ -71,8 +78,8 @@ extern struct t_config_section *irc_config_section_server;
|
||||
extern struct t_config_option *irc_config_look_color_nicks_in_server_messages;
|
||||
extern struct t_config_option *irc_config_look_color_pv_nick_like_channel;
|
||||
extern struct t_config_option *irc_config_look_server_buffer;
|
||||
extern struct t_config_option *irc_config_look_open_channel_near_server;
|
||||
extern struct t_config_option *irc_config_look_open_pv_near_server;
|
||||
extern struct t_config_option *irc_config_look_new_channel_position;
|
||||
extern struct t_config_option *irc_config_look_new_pv_position;
|
||||
extern struct t_config_option *irc_config_look_nick_prefix;
|
||||
extern struct t_config_option *irc_config_look_nick_suffix;
|
||||
extern struct t_config_option *irc_config_look_nick_completion_smart;
|
||||
|
||||
Reference in New Issue
Block a user