1
0
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:
Sebastien Helleu
2008-04-16 14:44:02 +02:00
parent 7489ec9a40
commit ae98666bc6
24 changed files with 305 additions and 339 deletions
+1 -1
View File
@@ -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;
}
+17 -7
View File
@@ -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
View File
@@ -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