|
|
|
|
@ -4,6 +4,32 @@ config main_config;
|
|
|
|
|
|
|
|
|
|
//functions
|
|
|
|
|
|
|
|
|
|
void on_save_done(main_window *widgets, config_str output, int size){
|
|
|
|
|
char *final_output = yon_char_parsed_to_string(output,size,"");
|
|
|
|
|
if (final_output){
|
|
|
|
|
printf("%s\n",final_output);
|
|
|
|
|
free(final_output);
|
|
|
|
|
}
|
|
|
|
|
yon_char_parsed_free(output,size);
|
|
|
|
|
textdomain(template_ui_LocaleName);
|
|
|
|
|
switch (main_config.save_config){
|
|
|
|
|
case 0:
|
|
|
|
|
yon_ubl_status_box_render(GLOBAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
yon_ubl_status_box_render(LOCAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
yon_ubl_status_box_render(GLOBAL_LOCAL_SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
yon_ubl_status_box_render(SAVE_SUCCESS_LABEL,BACKGROUND_IMAGE_SUCCESS_TYPE);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
textdomain(LocaleName);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int yon_load_proceed(YON_CONFIG_TYPE type){
|
|
|
|
|
if (type!=YON_CONFIG_CUSTOM){
|
|
|
|
|
yon_config_clean();
|
|
|
|
|
@ -194,6 +220,7 @@ void yon_config_global_load(GtkWidget *self, main_window *widgets){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_config_global_local_save(){
|
|
|
|
|
main_config.save_config=2;
|
|
|
|
|
int changed = yon_config_get_status(id_parameter)==1;
|
|
|
|
|
template_saving_window *window = yon_save_proceed(NULL,YON_CONFIG_BOTH,config_get_command("global"),NULL);
|
|
|
|
|
if (window){
|
|
|
|
|
@ -280,6 +307,7 @@ void yon_config_custom_load(GtkWidget *self, main_window *widgets){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_config_local_save(){
|
|
|
|
|
main_config.save_config=1;
|
|
|
|
|
int changed = yon_config_get_status(id_parameter)==1;
|
|
|
|
|
template_saving_window *window = yon_save_proceed("system",YON_CONFIG_LOCAL,config_get_command("system"),NULL);
|
|
|
|
|
if (window){
|
|
|
|
|
@ -291,6 +319,7 @@ void yon_config_local_save(){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_config_global_save(){
|
|
|
|
|
main_config.save_config=0;
|
|
|
|
|
int changed = yon_config_get_status(id_parameter)==1;
|
|
|
|
|
template_saving_window *window = yon_save_proceed("global",YON_CONFIG_GLOBAL,config_get_command("global"),NULL);
|
|
|
|
|
if (window){
|
|
|
|
|
@ -303,6 +332,7 @@ void yon_config_global_save(){
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_config_custom_save(){
|
|
|
|
|
main_config.save_config=3;
|
|
|
|
|
template_saving_window *window = yon_save_proceed(NULL,YON_CONFIG_CUSTOM,config_get_command("system"),NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -714,6 +744,7 @@ void config_init(){
|
|
|
|
|
main_config.lock_save_global=0;
|
|
|
|
|
main_config.lock_save_local=0;
|
|
|
|
|
main_config.domain_connected=0;
|
|
|
|
|
main_config.save_config=0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_check_domain_connected(GtkWidget *self, main_window *widgets){
|
|
|
|
|
@ -852,6 +883,7 @@ main_window *yon_main_window_complete(main_window *widgets){
|
|
|
|
|
char *domain = yon_config_get_by_key(DOMAIN);
|
|
|
|
|
if (!yon_char_is_empty(domain))
|
|
|
|
|
gtk_entry_set_text(GTK_ENTRY(widgets->DomainEntry),domain);
|
|
|
|
|
yon_save_window_set_postsave_function(on_save_done,widgets);
|
|
|
|
|
return widgets;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|