From 90d24d6600b2356c73724a9aafc3c80cacf9d49c Mon Sep 17 00:00:00 2001 From: Ivan Dmitrievich Yartsev Date: Mon, 30 Mar 2026 14:53:47 +0600 Subject: [PATCH] Config restoring changes --- source/ubinstall-gtk-installation.c | 4 ++-- source/ubinstall-gtk-saving.c | 19 ++++++++++++------- source/ubinstall-gtk.h | 2 ++ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/source/ubinstall-gtk-installation.c b/source/ubinstall-gtk-installation.c index f136fd0..80daa2d 100644 --- a/source/ubinstall-gtk-installation.c +++ b/source/ubinstall-gtk-installation.c @@ -486,8 +486,8 @@ void yon_install_init(main_window *widgets, enum YON_PAGES page){ gtk_spin_button_set_value(GTK_SPIN_BUTTON(partition_size_spin),atol(parameter)); gtk_combo_box_set_active(GTK_COMBO_BOX(partition_size_combo),yon_get_size_get_from_letter(parameter[strlen(parameter)-1])-1); } else { - gtk_spin_button_set_value(GTK_SPIN_BUTTON(partition_size_spin),3); - gtk_combo_box_set_active(GTK_COMBO_BOX(partition_size_combo),2); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(partition_size_spin),16); + gtk_combo_box_set_active(GTK_COMBO_BOX(partition_size_combo),1); } } if (partition_mark_entry){ diff --git a/source/ubinstall-gtk-saving.c b/source/ubinstall-gtk-saving.c index 89c4232..53f018f 100644 --- a/source/ubinstall-gtk-saving.c +++ b/source/ubinstall-gtk-saving.c @@ -11,13 +11,15 @@ void yon_load_proceed(YON_CONFIG_TYPE type){ if (!yon_char_is_empty(config_get_default_command)) yon_config_load_config(YON_CONFIG_DEFAULT,config_get_default_command,NULL); 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: + 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); - main_config.config_load_path = yon_char_new("system"); break; case YON_CONFIG_CUSTOM: 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); 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); main_config.load_mode=YON_CONFIG_LOCAL; yon_main_window_update_locale(widgets); @@ -426,9 +431,9 @@ int yon_config_save(main_window *widgets){ } 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_config_to_default(); + yon_config_custom_apply(&main_config.startup_config); + yon_config_set_status_full(1); int size; config_str parameters = yon_config_get_save_parameters(&size); char *command_params = yon_char_parsed_to_string(parameters,size, " "); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 0c22aae..c39cdf8 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -499,6 +499,8 @@ typedef struct config_str argv; int argc; + yon_config_custom *startup_config; + int autoinstall; // if active, installation starts immidiately after app start } config;