|
|
|
@ -11,13 +11,15 @@ void yon_load_proceed(YON_CONFIG_TYPE type){
|
|
|
|
if (!yon_char_is_empty(config_get_default_command))
|
|
|
|
if (!yon_char_is_empty(config_get_default_command))
|
|
|
|
yon_config_load_config(YON_CONFIG_DEFAULT,config_get_default_command,NULL);
|
|
|
|
yon_config_load_config(YON_CONFIG_DEFAULT,config_get_default_command,NULL);
|
|
|
|
switch (type){
|
|
|
|
switch (type){
|
|
|
|
case YON_CONFIG_GLOBAL:
|
|
|
|
|
|
|
|
yon_config_load_config(type,config_get_command("global"),NULL);
|
|
|
|
|
|
|
|
main_config.config_load_path = yon_char_new("global");
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case YON_CONFIG_LOCAL:
|
|
|
|
case YON_CONFIG_LOCAL:
|
|
|
|
|
|
|
|
if (main_config.startup_config){
|
|
|
|
|
|
|
|
yon_config_restore(NULL);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
yon_config_custom_clean(main_config.startup_config);
|
|
|
|
|
|
|
|
main_config.startup_config = NULL;
|
|
|
|
|
|
|
|
yon_config_custom_load_config(&main_config.startup_config,config_get_command("system"),NULL);
|
|
|
|
|
|
|
|
main_config.config_load_path = yon_char_new("system");
|
|
|
|
yon_config_load_config(type,config_get_command("system"),NULL);
|
|
|
|
yon_config_load_config(type,config_get_command("system"),NULL);
|
|
|
|
main_config.config_load_path = yon_char_new("system");
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case YON_CONFIG_CUSTOM:
|
|
|
|
case YON_CONFIG_CUSTOM:
|
|
|
|
if (yon_char_is_empty(main_config.config_load_path)){
|
|
|
|
if (yon_char_is_empty(main_config.config_load_path)){
|
|
|
|
@ -45,6 +47,9 @@ void on_config_local_load(GtkWidget *,main_window *widgets){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!yon_char_is_empty(main_config.config_load_path)) free(main_config.config_load_path);
|
|
|
|
if (!yon_char_is_empty(main_config.config_load_path)) free(main_config.config_load_path);
|
|
|
|
main_config.config_load_path = yon_char_new("system");
|
|
|
|
main_config.config_load_path = yon_char_new("system");
|
|
|
|
|
|
|
|
// yon_config_custom_clean(main_config.startup_config);
|
|
|
|
|
|
|
|
// main_config.startup_config = NULL;
|
|
|
|
|
|
|
|
// yon_config_custom_load_config(&main_config.startup_config,config_get_command("system"),NULL);
|
|
|
|
yon_load_proceed(YON_CONFIG_LOCAL);
|
|
|
|
yon_load_proceed(YON_CONFIG_LOCAL);
|
|
|
|
main_config.load_mode=YON_CONFIG_LOCAL;
|
|
|
|
main_config.load_mode=YON_CONFIG_LOCAL;
|
|
|
|
yon_main_window_update_locale(widgets);
|
|
|
|
yon_main_window_update_locale(widgets);
|
|
|
|
@ -426,9 +431,9 @@ int yon_config_save(main_window *widgets){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void yon_config_restore(main_window *){
|
|
|
|
void yon_config_restore(main_window *){
|
|
|
|
yon_load_proceed(main_config.load_mode);
|
|
|
|
|
|
|
|
yon_launch(yon_debug_output("%s\n","ubconfig --source system remove [autoinstall]"));
|
|
|
|
yon_launch(yon_debug_output("%s\n","ubconfig --source system remove [autoinstall]"));
|
|
|
|
yon_config_to_default();
|
|
|
|
yon_config_custom_apply(&main_config.startup_config);
|
|
|
|
|
|
|
|
yon_config_set_status_full(1);
|
|
|
|
int size;
|
|
|
|
int size;
|
|
|
|
config_str parameters = yon_config_get_save_parameters(&size);
|
|
|
|
config_str parameters = yon_config_get_save_parameters(&size);
|
|
|
|
char *command_params = yon_char_parsed_to_string(parameters,size, " ");
|
|
|
|
char *command_params = yon_char_parsed_to_string(parameters,size, " ");
|
|
|
|
|