Renamed some options.

This commit is contained in:
Håvard Pettersson 2014-10-11 10:28:59 +02:00
parent ab1cef34fc
commit 188f3452e1
3 changed files with 9 additions and 10 deletions

View File

@ -40,8 +40,8 @@ char *twc_profile_option_names[TWC_PROFILE_NUM_OPTIONS] =
"max_friend_requests", "max_friend_requests",
"proxy_address", "proxy_address",
"proxy_port", "proxy_port",
"proxy_enabled", "proxy",
"udp_disabled", "udp",
}; };
char *twc_profile_option_defaults[TWC_PROFILE_NUM_OPTIONS] = char *twc_profile_option_defaults[TWC_PROFILE_NUM_OPTIONS] =
@ -52,7 +52,7 @@ char *twc_profile_option_defaults[TWC_PROFILE_NUM_OPTIONS] =
NULL, NULL,
"0", "0",
"off", "off",
"off", "on",
}; };
/** /**
@ -250,8 +250,8 @@ twc_config_init_option(int option_index, const char *option_name)
return weechat_config_new_option( return weechat_config_new_option(
twc_config_file, twc_config_section_profile, twc_config_file, twc_config_section_profile,
option_name, "boolean", option_name, "boolean",
"whether or not to proxy this profile; requires reload to " "use a proxy for communicating with the Tox network; requires "
"effect", "profile reload to take effect",
NULL, 0, 0, NULL, 0, 0,
twc_profile_option_defaults[option_index], NULL, 1, twc_profile_option_defaults[option_index], NULL, 1,
twc_config_profile_check_value_callback, (void *)(intptr_t)option_index, twc_config_profile_check_value_callback, (void *)(intptr_t)option_index,
@ -279,11 +279,11 @@ twc_config_init_option(int option_index, const char *option_name)
twc_config_profile_check_value_callback, (void *)(intptr_t)option_index, twc_config_profile_check_value_callback, (void *)(intptr_t)option_index,
twc_config_profile_change_callback, (void *)(intptr_t)option_index, twc_config_profile_change_callback, (void *)(intptr_t)option_index,
NULL, NULL); NULL, NULL);
case TWC_PROFILE_OPTION_UDP_DISABLED: case TWC_PROFILE_OPTION_UDP:
return weechat_config_new_option( return weechat_config_new_option(
twc_config_file, twc_config_section_profile, twc_config_file, twc_config_section_profile,
option_name, "boolean", option_name, "boolean",
"disable UDP; may be necessary for certain proxies", "use UDP when communicating with the Tox network",
NULL, 0, 0, NULL, 0, 0,
twc_profile_option_defaults[option_index], NULL, 1, twc_profile_option_defaults[option_index], NULL, 1,
twc_config_profile_check_value_callback, (void *)(intptr_t)option_index, twc_config_profile_check_value_callback, (void *)(intptr_t)option_index,
@ -314,7 +314,6 @@ twc_config_init_profile(struct t_twc_profile *profile)
twc_profile_option_names[i]); twc_profile_option_names[i]);
profile->options[i] = twc_config_init_option(i, option_name); profile->options[i] = twc_config_init_option(i, option_name);
weechat_log_printf("Initialized option %s %p", option_name, profile->options[i]);
free(option_name); free(option_name);
} }
} }

View File

@ -228,7 +228,7 @@ twc_profile_load(struct t_twc_profile *profile)
options->proxy_port = options->proxy_port =
TWC_PROFILE_OPTION_INTEGER(profile, TWC_PROFILE_OPTION_PROXY_PORT); TWC_PROFILE_OPTION_INTEGER(profile, TWC_PROFILE_OPTION_PROXY_PORT);
options->udp_disabled = options->udp_disabled =
TWC_PROFILE_OPTION_BOOLEAN(profile, TWC_PROFILE_OPTION_UDP_DISABLED); !TWC_PROFILE_OPTION_BOOLEAN(profile, TWC_PROFILE_OPTION_UDP);
if (options->proxy_enabled) if (options->proxy_enabled)
{ {

View File

@ -34,7 +34,7 @@ enum t_twc_profile_option
TWC_PROFILE_OPTION_PROXY_ADDRESS, TWC_PROFILE_OPTION_PROXY_ADDRESS,
TWC_PROFILE_OPTION_PROXY_PORT, TWC_PROFILE_OPTION_PROXY_PORT,
TWC_PROFILE_OPTION_PROXY_ENABLED, TWC_PROFILE_OPTION_PROXY_ENABLED,
TWC_PROFILE_OPTION_UDP_DISABLED, TWC_PROFILE_OPTION_UDP,
TWC_PROFILE_NUM_OPTIONS, TWC_PROFILE_NUM_OPTIONS,
}; };