Config restoring fixes

pull/396/head
parent 1d741ec0fb
commit f31d3a69d6

@ -23,5 +23,6 @@ void yon_quick_install(GtkWidget *self, main_window *widgets){
} else {
yon_launch("ubconfig --source system get /");
yon_launch(ubinstall_dry_run_command);
}
}

@ -7,18 +7,18 @@ void yon_config_save_proceed(char *path, YON_CONFIG_TYPE type){
void yon_load_proceed(YON_CONFIG_TYPE type){
if (type!=YON_CONFIG_CUSTOM){
yon_config_clean();
if (main_config.config_load_path){
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(main_config.config_load_path),NULL);
}
}
if (!yon_char_is_empty(config_get_default_command)){
yon_config_load_config(YON_CONFIG_DEFAULT,config_get_default_command,NULL);
}
if (main_config.config_load_path){
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(main_config.config_load_path),NULL);
}
switch (type){
case YON_CONFIG_LOCAL:
main_config.config_load_path = yon_char_new("system");
@ -30,6 +30,14 @@ void yon_load_proceed(YON_CONFIG_TYPE type){
char *path = NULL;
path=yon_custom_config_init(GTK_FILE_CHOOSER_ACTION_OPEN);
if (!yon_char_is_empty(path)){
if (main_config.config_load_path){
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(main_config.config_load_path),NULL);
}
main_config.config_load_path = yon_char_new(path);
main_config.config_save_path = main_config.config_load_path;
yon_config_clean();

@ -14513,7 +14513,7 @@ separately into the selected partition.</property>
<property name="spacing">5</property>
<child>
<object class="GtkButton" id="CancelInstallButton">
<property name="label" translatable="yes">Cancel</property>
<property name="label" translatable="yes">Exit</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="receives-default">True</property>

Loading…
Cancel
Save