|
|
|
@ -13,16 +13,24 @@ void yon_load_proceed(YON_CONFIG_TYPE type){
|
|
|
|
switch (type){
|
|
|
|
switch (type){
|
|
|
|
case YON_CONFIG_GLOBAL:
|
|
|
|
case YON_CONFIG_GLOBAL:
|
|
|
|
yon_config_load_config(type,config_get_command("global"),NULL);
|
|
|
|
yon_config_load_config(type,config_get_command("global"),NULL);
|
|
|
|
|
|
|
|
main_config.config_load_path = yon_char_new("global");
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case YON_CONFIG_LOCAL:
|
|
|
|
case YON_CONFIG_LOCAL:
|
|
|
|
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:
|
|
|
|
char *path = NULL;
|
|
|
|
if (yon_char_is_empty(main_config.config_load_path)){
|
|
|
|
path=yon_custom_config_init(GTK_FILE_CHOOSER_ACTION_OPEN);
|
|
|
|
char *path = NULL;
|
|
|
|
if (!yon_char_is_empty(path)){
|
|
|
|
path=yon_custom_config_init(GTK_FILE_CHOOSER_ACTION_OPEN);
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(path)){
|
|
|
|
|
|
|
|
main_config.config_load_path = yon_char_new(path);
|
|
|
|
|
|
|
|
yon_config_clean();
|
|
|
|
|
|
|
|
yon_config_load_config(type,config_get_command(path),NULL);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
yon_config_clean();
|
|
|
|
yon_config_clean();
|
|
|
|
yon_config_load_config(type,config_get_command(path),NULL);
|
|
|
|
yon_config_load_config(type,config_get_command(main_config.config_load_path),NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
@ -44,6 +52,10 @@ void on_config_local_load(GtkWidget *,main_window *widgets){
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void on_config_custom_load(GtkWidget *,main_window *){
|
|
|
|
void on_config_custom_load(GtkWidget *,main_window *){
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(main_config.config_load_path)){
|
|
|
|
|
|
|
|
free(main_config.config_load_path);
|
|
|
|
|
|
|
|
main_config.config_load_path = NULL;
|
|
|
|
|
|
|
|
}
|
|
|
|
yon_load_proceed(YON_CONFIG_CUSTOM);
|
|
|
|
yon_load_proceed(YON_CONFIG_CUSTOM);
|
|
|
|
main_config.load_mode=YON_CONFIG_CUSTOM;
|
|
|
|
main_config.load_mode=YON_CONFIG_CUSTOM;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -414,8 +426,8 @@ 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_load_proceed(main_config.load_mode);
|
|
|
|
yon_launch("ubconfig --source system remove [autoinstall]");
|
|
|
|
yon_launch(yon_debug_output("%s\n","ubconfig --source system remove [autoinstall]"));
|
|
|
|
yon_config_to_default();
|
|
|
|
yon_config_to_default();
|
|
|
|
int size;
|
|
|
|
int size;
|
|
|
|
config_str parameters = yon_config_get_save_parameters(&size);
|
|
|
|
config_str parameters = yon_config_get_save_parameters(&size);
|
|
|
|
|