summaryrefslogtreecommitdiff
path: root/src/plugins/fset/fset-mouse.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2017-05-31 22:21:16 +0200
committerSébastien Helleu <flashcode@flashtux.org>2017-06-25 16:35:27 +0200
commit3211a735999876b34a3bdb94fcfd3711877ca3d7 (patch)
tree9157ce8fdd2f7ba15457f0abf8f2a713351b31ff /src/plugins/fset/fset-mouse.c
parentf555d588b8f7e575c8cf300be8026d13d3c784cb (diff)
downloadweechat-3211a735999876b34a3bdb94fcfd3711877ca3d7.zip
fset: store type as enum, translate ${type}, add ${type_en}, ${type_short} and ${type_tiny}
Diffstat (limited to 'src/plugins/fset/fset-mouse.c')
-rw-r--r--src/plugins/fset/fset-mouse.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/fset/fset-mouse.c b/src/plugins/fset/fset-mouse.c
index 902d20354..9791859b2 100644
--- a/src/plugins/fset/fset-mouse.c
+++ b/src/plugins/fset/fset-mouse.c
@@ -84,7 +84,7 @@ fset_focus_cb (const void *pointer, void *data, struct t_hashtable *info)
weechat_hashtable_set (info, "fset_option", str_value);
weechat_hashtable_set (info, "fset_option_name", ptr_fset_option->name);
weechat_hashtable_set (info, "fset_option_parent_name", ptr_fset_option->parent_name);
- weechat_hashtable_set (info, "fset_option_type", ptr_fset_option->type);
+ weechat_hashtable_set (info, "fset_option_type", fset_option_type_string[ptr_fset_option->type]);
weechat_hashtable_set (info, "fset_option_default_value", ptr_fset_option->default_value);
weechat_hashtable_set (info, "fset_option_value", ptr_fset_option->value);
weechat_hashtable_set (info, "fset_option_parent_value", ptr_fset_option->parent_value);
@@ -173,14 +173,14 @@ fset_hsignal_cb (const void *pointer, void *data, const char *signal,
{
snprintf (str_command, sizeof (str_command),
"/fset %s",
- (strcmp (ptr_fset_option->type, "boolean") == 0) ? "-toggle" : "-set");
+ (ptr_fset_option->type == FSET_OPTION_TYPE_BOOLEAN) ? "-toggle" : "-set");
weechat_command (fset_buffer, str_command);
}
else if (weechat_string_match (ptr_key, "button2-gesture-left*", 1))
{
distance = fset_mouse_get_distance_x (hashtable);
- if ((strcmp (ptr_fset_option->type, "integer") == 0)
- || (strcmp (ptr_fset_option->type, "color") == 0))
+ if ((ptr_fset_option->type == FSET_OPTION_TYPE_INTEGER)
+ || (ptr_fset_option->type == FSET_OPTION_TYPE_COLOR))
{
snprintf (str_command, sizeof (str_command),
"/fset -add -%d",
@@ -191,8 +191,8 @@ fset_hsignal_cb (const void *pointer, void *data, const char *signal,
else if (weechat_string_match (ptr_key, "button2-gesture-right*", 1))
{
distance = fset_mouse_get_distance_x (hashtable);
- if ((strcmp (ptr_fset_option->type, "integer") == 0)
- || (strcmp (ptr_fset_option->type, "color") == 0))
+ if ((ptr_fset_option->type == FSET_OPTION_TYPE_INTEGER)
+ || (ptr_fset_option->type == FSET_OPTION_TYPE_COLOR))
{
snprintf (str_command, sizeof (str_command),
"/fset -add %d",