From b7f6643ad50fb7d2befab053d5479ead3aa67b27 Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Wed, 25 Mar 2026 10:37:47 +0600 Subject: [PATCH] Fixed module 'auto' value processing --- source/ubinstall-gtk-components.c | 2 +- source/ubinstall-gtk-saving.c | 24 ++++++++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/source/ubinstall-gtk-components.c b/source/ubinstall-gtk-components.c index 577c03d..f6c029b 100644 --- a/source/ubinstall-gtk-components.c +++ b/source/ubinstall-gtk-components.c @@ -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); diff --git a/source/ubinstall-gtk-saving.c b/source/ubinstall-gtk-saving.c index ed67324..89c4232 100644 --- a/source/ubinstall-gtk-saving.c +++ b/source/ubinstall-gtk-saving.c @@ -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);