Fixed module 'auto' value processing

pull/326/head
parent 07445132d7
commit b7f6643ad5

@ -299,7 +299,7 @@ gboolean yon_os_components_load(main_window *widgets){
for(iter = list;iter;iter=iter->next){
os_row *row = g_object_get_data(iter->data,"kernel_row");
char *target = row->source;
if (yon_char_parsed_check_exist(parsed,parsed_size,target)>-1){
if (!strcmp(target,"auto")||yon_char_parsed_check_exist(parsed,parsed_size,target)>-1){
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(row->InstallCheck),1);
} else {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(row->InstallCheck),0);

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

Loading…
Cancel
Save