mirror of
https://github.com/weechat/weechat.git
synced 2026-07-09 11:13:12 +02:00
Added "toggle" value for /set on boolean options, fixed refresh bugs, added option type for infolist "options"
This commit is contained in:
@@ -381,7 +381,7 @@ command_buffer (void *data, struct t_gui_buffer *buffer,
|
||||
}
|
||||
gui_buffer_close (buffer, 1);
|
||||
gui_status_refresh_needed = 1;
|
||||
gui_current_window->buffer->input_refresh_needed = 1;
|
||||
gui_buffer_ask_input_refresh (gui_current_window->buffer, 1);
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
@@ -843,15 +843,25 @@ config_file_option_set (struct t_config_option *option, char *value,
|
||||
case CONFIG_OPTION_TYPE_BOOLEAN:
|
||||
if (value)
|
||||
{
|
||||
if (config_file_string_boolean_is_valid (value))
|
||||
if (string_strcasecmp (value, "toggle") == 0)
|
||||
{
|
||||
value_int = config_file_string_to_boolean (value);
|
||||
if (value_int == *((int *)option->value))
|
||||
rc = 1;
|
||||
else
|
||||
*((int *)option->value) =
|
||||
(*((int *)option->value) == CONFIG_BOOLEAN_TRUE) ?
|
||||
CONFIG_BOOLEAN_FALSE : CONFIG_BOOLEAN_TRUE;
|
||||
rc = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (config_file_string_boolean_is_valid (value))
|
||||
{
|
||||
*((int *)option->value) = value_int;
|
||||
rc = 2;
|
||||
value_int = config_file_string_to_boolean (value);
|
||||
if (value_int == *((int *)option->value))
|
||||
rc = 1;
|
||||
else
|
||||
{
|
||||
*((int *)option->value) = value_int;
|
||||
rc = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ struct t_hook
|
||||
struct t_hook *next_hook; /* link to next hook */
|
||||
};
|
||||
|
||||
typedef int (t_hook_callback_command)(void *data, struct t_gui_buffer *,
|
||||
typedef int (t_hook_callback_command)(void *data, struct t_gui_buffer *buffer,
|
||||
int argc, char **argv, char **argv_eol);
|
||||
|
||||
struct t_hook_command
|
||||
|
||||
Reference in New Issue
Block a user