From e16a586e9cf15674cff4eee627844326683c6bbf Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 5 Jul 2024 14:21:02 +0600 Subject: [PATCH] Fixes, added system configuration installation if main installation was completed before --- source/ubinstall-gtk.c | 32 +++++++++++++++++++++++++++++++- source/ubinstall-gtk.h | 2 +- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index e9e4a9a..97cafcb 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -401,6 +401,34 @@ void on_page_changed(GtkWidget *,GtkWidget *,int page, main_window *widgets){ } } +void *on_setup_system_configuration(void *); +void *on_setup_system_configuration(void *){ + int size; + config_str all_parameters = yon_config_get_selection_by_key(&size, + user_gecos_parameter, + user_password_parameter, + root_password_parameter, + autologin_parameter, + xkbmodel_parameter, + xkblayout_parameter, + xkbvariant_parameter, + xkboptions_parameter, + hostname_parameter, + zone_parameter, + lang_parameter, + locale_parameter, + NULL); + if (all_parameters){ + char *parameter_string = yon_char_parsed_to_string(all_parameters,size," "); + char *command = set_user_config_command(parameter_string); + if (system(command)){}; + yon_char_parsed_free(all_parameters,size); + free(command); + if (parameter_string) free(parameter_string); + } + return NULL; +} + void on_page_navigation_clicked(GtkWidget *self, main_window *widgets); void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ int mode = self==widgets->NextButton ? 1 : self == widgets->BackButton ? -1 : self==widgets->CancelInstallButton?-2:0; @@ -696,7 +724,8 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ } gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALLATION); if (gtk_progress_bar_get_fraction(GTK_PROGRESS_BAR(widgets->InstallationProgress))>0.9){ - + pthread_t tid; + pthread_create(&tid,NULL,on_setup_system_configuration,NULL); } gtk_widget_set_sensitive(widgets->CancelInstallButton,0); gtk_widget_set_sensitive(widgets->NextButton,0); @@ -902,6 +931,7 @@ void on_same_installation_device_changed(GtkWidget *, main_window *widgets){ } } +void on_gparted_open(); void on_gparted_open(){ yon_launch_app_with_arguments(open_gparted_command,NULL); } diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index ac0801e..576b4c4 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -110,7 +110,7 @@ NULL #define part_type_parameter "AUTOINSTALL[part_fs_type]" #define part_type_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[part_fs_type]" -#define save_config_command(parameters) yon_char_unite("pkexec bash -c 'ubconfig set [autoinstall] ",parameters, "; nice ubinstall2 --config /etc/ublinux/autoinstall'", NULL) +#define save_config_command(parameters) yon_char_unite("pkexec bash -c 'ubconfig set [autoinstall] ",parameters, "; nice ubinstall2 --test --config /etc/ublinux/autoinstall'", NULL) #define set_user_config_command(parameters) yon_char_unite("pkexec bash -c 'ubconfig --target system set [autoinstall] ",parameters,";nice ubinstall2 --autoconfig'",NULL)