|
|
|
|
@ -572,36 +572,36 @@ void on_config_global_save(GtkWidget *, main_window *){
|
|
|
|
|
|
|
|
|
|
void on_config_local_save(GtkWidget *, main_window *){
|
|
|
|
|
main_config.save_config=1;
|
|
|
|
|
int size;
|
|
|
|
|
config_str keys = yon_config_get_all_by_key(USERADD_SEARCH_macro,&size);
|
|
|
|
|
int passw_size;
|
|
|
|
|
config_str passwords = NULL;
|
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
|
int parsed_size;
|
|
|
|
|
char *key,*value;
|
|
|
|
|
yon_config_parse_parameter(keys[i],&key,&value);
|
|
|
|
|
config_str parsed = yon_char_parse(value,&parsed_size,":");
|
|
|
|
|
if (parsed_size>5&&!yon_char_is_empty(parsed[5])){
|
|
|
|
|
yon_char_parsed_add_or_create_if_exists(passwords,&passw_size,yon_char_new(parsed[5]));
|
|
|
|
|
parsed = yon_char_parsed_rip(parsed,&parsed_size,5);
|
|
|
|
|
char *final_string = yon_char_parsed_to_string_include_empty(parsed,parsed_size,":");
|
|
|
|
|
char *temp = yon_char_append(final_string,":");
|
|
|
|
|
free(final_string);
|
|
|
|
|
final_string=temp;
|
|
|
|
|
yon_config_set(key,final_string);
|
|
|
|
|
}
|
|
|
|
|
free(key);
|
|
|
|
|
free(value);
|
|
|
|
|
}
|
|
|
|
|
// int size;
|
|
|
|
|
// config_str keys = yon_config_get_all_by_key(USERADD_SEARCH_macro,&size);
|
|
|
|
|
// int passw_size;
|
|
|
|
|
// config_str passwords = NULL;
|
|
|
|
|
// for (int i=0;i<size;i++){
|
|
|
|
|
// int parsed_size;
|
|
|
|
|
// char *key,*value;
|
|
|
|
|
// yon_config_parse_parameter(keys[i],&key,&value);
|
|
|
|
|
// config_str parsed = yon_char_parse(value,&parsed_size,":");
|
|
|
|
|
// if (parsed_size>5&&!yon_char_is_empty(parsed[5])){
|
|
|
|
|
// yon_char_parsed_add_or_create_if_exists(passwords,&passw_size,yon_char_new(parsed[5]));
|
|
|
|
|
// parsed = yon_char_parsed_rip(parsed,&parsed_size,5);
|
|
|
|
|
// char *final_string = yon_char_parsed_to_string_include_empty(parsed,parsed_size,":");
|
|
|
|
|
// char *temp = yon_char_append(final_string,":");
|
|
|
|
|
// free(final_string);
|
|
|
|
|
// final_string=temp;
|
|
|
|
|
// yon_config_set(key,final_string);
|
|
|
|
|
// }
|
|
|
|
|
// free(key);
|
|
|
|
|
// free(value);
|
|
|
|
|
// }
|
|
|
|
|
template_saving_window *window = yon_save_proceed("system",YON_CONFIG_LOCAL,config_get_command("system"),NULL);
|
|
|
|
|
if (window){
|
|
|
|
|
yon_hide_passwords(window);
|
|
|
|
|
}
|
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
|
char *key,*value;
|
|
|
|
|
yon_config_parse_parameter(keys[i],&key,&value);
|
|
|
|
|
yon_config_set(key,value);
|
|
|
|
|
}
|
|
|
|
|
// for (int i=0;i<size;i++){
|
|
|
|
|
// char *key,*value;
|
|
|
|
|
// yon_config_parse_parameter(keys[i],&key,&value);
|
|
|
|
|
// yon_config_set(key,value);
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_config_custom_save(GtkWidget *, main_window *){
|
|
|
|
|
|