From 6d5524b52c5951d9cbe405f5ed555716c2d20d1f Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 19 Jul 2024 18:08:56 +0600 Subject: [PATCH 01/10] Saving added. Loading 50% done. No localisation --- ...om.ublinux.ubinstall-gtk.sync-symbolic.svg | 8 + source/ubinstall-gtk.c | 339 +++++++++++++++++- source/ubinstall-gtk.h | 29 +- source/ubl-strings.h | 5 + ubinstall-gtk.glade | 185 +++++++++- 5 files changed, 543 insertions(+), 23 deletions(-) create mode 100644 icons/actions/com.ublinux.ubinstall-gtk.sync-symbolic.svg diff --git a/icons/actions/com.ublinux.ubinstall-gtk.sync-symbolic.svg b/icons/actions/com.ublinux.ubinstall-gtk.sync-symbolic.svg new file mode 100644 index 0000000..e81e0f7 --- /dev/null +++ b/icons/actions/com.ublinux.ubinstall-gtk.sync-symbolic.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 5a2b5a7..8b9af41 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -3,12 +3,280 @@ config main_config; //functions + +void _yon_saving_threaded(char *final_command); +void _yon_saving_threaded(char *final_command){ + FILE *file = popen(final_command,"r"); + int file_save; + config_str file_return = yon_config_load_file(file,&file_save); + pclose(file); + file_return = yon_char_parsed_append(file_return,&file_save,final_command); + char *result = yon_char_parsed_to_string(file_return,file_save,""); + yon_debug_output("%s\n",result); + free(result); +} + +char *yon_save_command_prepare(char *command, char *target){ + int size; + config_str parsed = yon_char_parse(command,&size," "); + free(parsed[2]); + parsed[2]=yon_char_new(target); + free(parsed[3]); + parsed[3]=yon_char_new("set"); + for (int i=5;iInstallationRadio),1); + page = YON_PAGE_INSTALL_COMMON; + } else if (strcmp(type,"next")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationNearRadio),1); + page = YON_PAGE_INSTALL_SEPARATE; + } else if (strcmp(type,"part")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationLinuxRadio),1); + page = YON_PAGE_INSTALL_SAME_PARTITION; + } else if (!strcmp(type,"grub_install")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->GrubInstallRadio),1); + page = YON_PAGE_OPTIONS_GRUB_INSTALL; + } else if (strcmp(type,"grub_update")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->GrubUpdateRadio),1); + page = YON_PAGE_OPTIONS_GRUB_UPDATE; + } else if (strcmp(type,"system_only")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->OSRadio),1); + page = YON_PAGE_OPTIONS_OS_ONLY; + } else if (strcmp(type,"data_only")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->UserDataOnlyRadio),1); + page = YON_PAGE_OPTIONS_USRDATA_ONLY; + } else if (strcmp(type,"custom")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->SeparateRadio),1); + page = YON_PAGE_OPTIONS_SEPARATE; + } + + char *device = config(AUTOINSTALL_DEVICE); + char *part = NULL; + if (page!=YON_PAGE_INSTALL_COMMON) + part = config(part_parameter); + + char *fs_type = config(part_type_parameter); + char *device_label = config(device_label_parameter); + char *format = config(device_format_parameter); + char *part_size = config(part_size_parameter); + + GtkListStore *device_list = widgets->DevicesList; + GtkListStore *part_list=widgets->PartitionsList; + GtkWidget *device_tree=NULL; + GtkWidget *part_tree=NULL; + switch (page){ + case YON_PAGE_INSTALL_COMMON:{ + device_tree = widgets->CommonInstallationDevicesTree; + } break; + case YON_PAGE_INSTALL_SEPARATE:{ + device_tree = widgets->InstallationNearSysDevicesTree; + part_tree = widgets->InstallationNearSysSectionTree; + gtk_spin_button_set_value(GTK_SPIN_BUTTON(widgets->InstallationNearSizeSpin),atof(part_size)); + if (part_size[strlen(part_size)-1]=='M') gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->InstallationNearSizeTypeSpin),0); + if (part_size[strlen(part_size)-1]=='G') gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->InstallationNearSizeTypeSpin),1); + if (part_size[strlen(part_size)-1]=='T') gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->InstallationNearSizeTypeSpin),2); + if (!strcmp(format,"no")) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->NextInstallationFormatCheck),0); + else gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->NextInstallationFormatCheck),1); + gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->NextInstallationFilesystemTypeCombo),fs_type); + gtk_entry_set_text(GTK_ENTRY(widgets->NextInstallationSectionNameEntry),device_label); + + } break; + case YON_PAGE_INSTALL_SAME_PARTITION:{ + device_tree = widgets->SamePlaceDeviceTree; + part_tree = widgets->SamePlacePartTree; + gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->SameInstallationFilesystemTypeCombo),fs_type); + if (!strcmp(format,"no")) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->SameInstallationFormatCheck),0); + else gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->SameInstallationFormatCheck),1); + gtk_entry_set_text(GTK_ENTRY(widgets->SameInstallationSectionNameEntry),device_label); + } break; + case YON_PAGE_OPTIONS_GRUB_INSTALL:{ + device_tree = widgets->GrubInstallDevicesTree; + } break; + case YON_PAGE_OPTIONS_GRUB_UPDATE:{ + device_tree = widgets->GrubUpdateDevicesTree; + } break; + case YON_PAGE_OPTIONS_SEPARATE:{ + GtkTreeIter iter; + device_tree = widgets->SeparateDevicesTree; + part_tree = widgets->SeparateSysSectionTree; + for_iter(GTK_TREE_MODEL(device_list),&iter){ + char *cur_device; + gtk_tree_model_get(GTK_TREE_MODEL(device_list),&iter, 0,&cur_device,-1); + if (!strcmp(cur_device,device)){ + gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(device_tree)),&iter); + break; + } + } + for_iter(GTK_TREE_MODEL(part_list),&iter){ + char *cur_part; + gtk_tree_model_get(GTK_TREE_MODEL(device_list),&iter, 0,&cur_part,-1); + if (!strcmp(cur_part,part)){ + gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(part_tree)),&iter); + } + } + } break; + case YON_PAGE_OPTIONS_OS_ONLY:{ + device_tree = widgets->OSDevicesTree; + part_tree = widgets->OSSysSectionTree; + } break; + case YON_PAGE_OPTIONS_USRDATA_ONLY:{ + device_tree = widgets->UserdataDevicesTree; + part_tree = widgets->UserdataSysSectionTree; + } break; + } + + char *zone = config(zone_parameter); + char *system_locale = config(locale_parameter); + char *language = config(lang_parameter); + + char *kbmodel = config (xkbmodel_parameter); + char *optinos = config(xkboptions_parameter); + char *layout = config(xkblayout_parameter); + + char *user_name = config(user_name_parameter); + char *user_gecos = config(user_name_parameter); + char *user_password = config(user_name_parameter); + char *root_password = config(user_name_parameter); + char *autologin = config(user_name_parameter); + char *hostname = config(user_name_parameter); + +} + +void on_config_local_load(GtkWidget *,main_window *); +void on_config_local_load(GtkWidget *,main_window *){ + yon_load_proceed(YON_CONFIG_LOCAL); + main_config.load_mode=1; +} + +void on_config_global_load(GtkWidget *,main_window *); +void on_config_global_load(GtkWidget *,main_window *){ + yon_load_proceed(YON_CONFIG_GLOBAL); + main_config.load_mode=0; +} + +void on_config_custom_load(GtkWidget *,main_window *); +void on_config_custom_load(GtkWidget *,main_window *){ + yon_load_proceed(YON_CONFIG_CUSTOM); + main_config.load_mode=3; +} + +void on_config_global_local_save(GtkWidget *,main_window *widgets); +void on_config_global_local_save(GtkWidget *,main_window *widgets){ + yon_save_proceed(NULL,YON_CONFIG_BOTH); + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_COMPLETED); +} + +void on_config_local_save(GtkWidget *,main_window *widgets); +void on_config_local_save(GtkWidget *,main_window *widgets){ + yon_save_proceed("system",YON_CONFIG_LOCAL); + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_COMPLETED); + +} + +void on_config_global_save(GtkWidget *,main_window *widgets); +void on_config_global_save(GtkWidget *,main_window *widgets){ + yon_save_proceed("global",YON_CONFIG_GLOBAL); + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_COMPLETED); + +} + +void on_config_custom_save(GtkWidget *, main_window *widgets); +void on_config_custom_save(GtkWidget *, main_window *widgets){ + char *path = NULL; + // YON_CONFIG_TYPE type = YON_CONFIG_CUSTOM; + GtkWidget *dialog = gtk_file_chooser_dialog_new(TITLE_LABEL,NULL,GTK_FILE_CHOOSER_ACTION_SAVE,CANCEL_LABEL,GTK_RESPONSE_CANCEL,SAVE_LABEL,GTK_RESPONSE_ACCEPT,NULL); + textdomain(TITLE_LABEL); + GtkFileFilter *filter = gtk_file_filter_new(); + gtk_window_set_icon_name(GTK_WINDOW(dialog),yon_char_append("com.ublinux.",LocaleName)); + gtk_file_filter_add_pattern(filter,"*.ini"); + gtk_file_filter_set_name(filter, "*.ini"); + gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog),filter); + int response = gtk_dialog_run(GTK_DIALOG(dialog)); + if (response == GTK_RESPONSE_ACCEPT){ + char *file = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)); + // char *directory = gtk_file_chooser_get_current_folder(GTK_FILE_CHOOSER(dialog)); + if (!yon_char_is_empty(file)){ + if (!strstr(file,".ini")) file = yon_char_append(file,".ini"); + if (access(file,0)!=F_OK){ + char *command_creation = ubconfig_file_create(file); + int a = system(command_creation); + if (access(file,0)!=F_OK||a){ + yon_ubl_status_box_render(CUSTOM_CONFIG_CREATION_ERROR_LABEL,BACKGROUND_IMAGE_FAIL_TYPE); + return; + } + } + } + path = yon_char_unite("'",file,"'",NULL); + free(file); + gtk_widget_destroy(dialog); + } else { + gtk_widget_destroy(dialog); + return; + } + yon_save_proceed(path,YON_CONFIG_CUSTOM); + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_COMPLETED); +} void yon_open_browser(GtkWidget *, char *link); void yon_open_browser(GtkWidget *, char *link){ @@ -228,6 +496,7 @@ void config_init(){ main_config.install_complete=0; main_config.save_done=0; main_config.configure_mode=0; + main_config.load_mode=-1; } void on_configuration_mode_switch(GtkWidget *self); @@ -308,7 +577,6 @@ gboolean on_image_slide(void *data){ return 1; } -char* yon_debug_output(char *pattern,char*text); char* yon_debug_output(char *pattern,char*text){ if (main_config.debug_mode){ printf(pattern,text); @@ -405,6 +673,7 @@ void on_page_changed(GtkWidget *,GtkWidget *,int page, main_window *widgets); void on_page_changed(GtkWidget *,GtkWidget *,int page, main_window *widgets){ switch(page){ case YON_PAGE_WELCOME: { + gtk_widget_hide(widgets->SaveButton); gtk_widget_set_sensitive(widgets->CancelInstallButton,0); gtk_widget_set_sensitive(widgets->BackButton,0); gtk_widget_set_sensitive(widgets->NextButton,1); @@ -412,7 +681,7 @@ void on_page_changed(GtkWidget *,GtkWidget *,int page, main_window *widgets){ gtk_button_set_label(GTK_BUTTON(widgets->CancelInstallButton),CANCEL_LABEL); gtk_image_set_from_icon_name(GTK_IMAGE(gtk_button_get_image(GTK_BUTTON(widgets->NextButton))),"com.ublinux.ubinstall-gtk.arrow-right-symbolic",GTK_ICON_SIZE_BUTTON); gtk_image_set_from_icon_name(GTK_IMAGE(gtk_button_get_image(GTK_BUTTON(widgets->CancelInstallButton))),"com.ublinux.ubinstall-gtk.circle-exit-symbolic",GTK_ICON_SIZE_BUTTON); - // gtk_widget_set_sensitive(widgets->ConfigurationModeMenuItem,1); + gtk_widget_set_sensitive(widgets->ConfigurationModeMenuItem,1); yon_switch_page_render(widgets,0); } break; @@ -455,6 +724,7 @@ void on_page_changed(GtkWidget *,GtkWidget *,int page, main_window *widgets){ case YON_PAGE_USERS: yon_switch_page_render(widgets,6); gtk_widget_set_sensitive(widgets->NextButton,1); + gtk_widget_hide(widgets->SaveButton); break; case YON_PAGE_INSTALL_ERROR: case YON_PAGE_COMPLETION:{ @@ -469,10 +739,27 @@ void on_page_changed(GtkWidget *,GtkWidget *,int page, main_window *widgets){ main_config.save_done=0; gtk_button_set_label(GTK_BUTTON(widgets->NextButton),RESTART_LABEL); gtk_button_set_label(GTK_BUTTON(widgets->CancelInstallButton),EXIT_LABEL); - gtk_image_set_from_icon_name(GTK_IMAGE(gtk_button_get_image(GTK_BUTTON(widgets->NextButton))),"com.ublinux.libublsettingsui-gtk3.sync-symbolic",GTK_ICON_SIZE_BUTTON); + gtk_image_set_from_icon_name(GTK_IMAGE(gtk_button_get_image(GTK_BUTTON(widgets->NextButton))), + "com.ublinux.ubinstall-gtk.sync-symbolic",GTK_ICON_SIZE_BUTTON); } break; + case YON_PAGE_COMPLETED:{ + yon_switch_page_render(widgets,7); + gtk_widget_set_sensitive(widgets->BackButton,1); + gtk_widget_hide(gtk_widget_get_parent(widgets->PackageInstallationProgress)); + gtk_widget_hide(widgets->InstallationLabel); + gtk_widget_hide(widgets->PackageInstallationLabel); + gtk_widget_set_sensitive(widgets->NextButton,0); + gtk_widget_set_sensitive(widgets->CancelInstallButton,1); + main_config.install_complete=0; + main_config.save_done=0; + gtk_button_set_label(GTK_BUTTON(widgets->CancelInstallButton),EXIT_LABEL); + gtk_image_set_from_icon_name(GTK_IMAGE(gtk_button_get_image(GTK_BUTTON(widgets->NextButton))), + "com.ublinux.ubinstall-gtk.sync-symbolic",GTK_ICON_SIZE_BUTTON); + + }break; + case YON_PAGE_SECTIONS: case YON_PAGE_INSTALL_COMMON: case YON_PAGE_INSTALL_SEPARATE: @@ -485,6 +772,12 @@ void on_page_changed(GtkWidget *,GtkWidget *,int page, main_window *widgets){ case YON_PAGE_OPTIONS_OS_ONLY: case YON_PAGE_OPTIONS_USRDATA_ONLY: { yon_switch_page_render(widgets,2); + } break; + case YON_PAGE_CONFIGURE_END: { + gtk_widget_set_sensitive(widgets->BackButton,1); + gtk_widget_set_sensitive(widgets->NextButton,0); + gtk_widget_set_sensitive(widgets->CancelInstallButton,1); + gtk_widget_show(widgets->SaveButton); } } } @@ -607,7 +900,7 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ switch (page){ case YON_PAGE_WELCOME:{ gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_LICENCE); - // gtk_widget_set_sensitive(widgets->ConfigurationModeMenuItem,0); + gtk_widget_set_sensitive(widgets->ConfigurationModeMenuItem,0); } break; case YON_PAGE_SECTIONS:{ //sections @@ -1102,6 +1395,14 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_SECTIONS); break; + case YON_PAGE_CONFIGURE_END:{ + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_USERS); + } break; + + case YON_PAGE_COMPLETED:{ + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_USERS); + } break; + default:{ gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),page-1); } @@ -1466,6 +1767,17 @@ main_window *yon_main_window_complete(){ widgets->UserdataDevicesTree = yon_gtk_builder_get_widget(builder,"UserdataDevicesTree"); widgets->UserdataSysSectionTree = yon_gtk_builder_get_widget(builder,"UserdataSysSectionTree"); + widgets->SaveButton = yon_gtk_builder_get_widget(builder,"SaveButton"); + + widgets->LoadGlobalConfigurationMenuItem = yon_gtk_builder_get_widget(builder,"LoadGlobalConfigurationMenuItem"); + widgets->LoadLocalConfigurationMenuItem = yon_gtk_builder_get_widget(builder,"LoadLocalConfigurationMenuItem"); + widgets->LoadExternalConfigurationMenuItem = yon_gtk_builder_get_widget(builder,"LoadExternalConfigurationMenuItem"); + + widgets->SaveGlobalLocalConfigurationMenuItem = yon_gtk_builder_get_widget(builder,"SaveGlobalLocalConfigurationMenuItem"); + widgets->SaveGlobalConfigurationMenuItem = yon_gtk_builder_get_widget(builder,"SaveGlobalConfigurationMenuItem"); + widgets->SaveLocalConfigurationMenuItem = yon_gtk_builder_get_widget(builder,"SaveLocalConfigurationMenuItem"); + widgets->SaveExternalConfigurationMenuItem = yon_gtk_builder_get_widget(builder,"SaveExternalConfigurationMenuItem"); + widgets->LanguagesList = GTK_LIST_STORE(gtk_builder_get_object(builder,"LanguagesList")); widgets->LanguagesFilter = GTK_TREE_MODEL(gtk_builder_get_object(builder,"LanguagesFilter")); widgets->LayoutsFilter = GTK_TREE_MODEL(gtk_builder_get_object(builder,"LayoutsFilter")); @@ -1473,6 +1785,15 @@ main_window *yon_main_window_complete(){ widgets->AdditionalSoftwareList = GTK_LIST_STORE(gtk_builder_get_object(builder,"AdditionalSoftwareList")); widgets->PartitionsList = GTK_LIST_STORE(gtk_builder_get_object(builder,"PartitionsList")); + g_signal_connect(G_OBJECT(widgets->LoadGlobalConfigurationMenuItem),"activate",G_CALLBACK(on_config_global_load),widgets); + g_signal_connect(G_OBJECT(widgets->LoadLocalConfigurationMenuItem),"activate",G_CALLBACK(on_config_local_load),widgets); + g_signal_connect(G_OBJECT(widgets->LoadExternalConfigurationMenuItem),"activate",G_CALLBACK(on_config_custom_load),widgets); + + g_signal_connect(G_OBJECT(widgets->SaveGlobalLocalConfigurationMenuItem),"activate",G_CALLBACK(on_config_global_local_save),widgets); + g_signal_connect(G_OBJECT(widgets->SaveGlobalConfigurationMenuItem),"activate",G_CALLBACK(on_config_global_save),widgets); + g_signal_connect(G_OBJECT(widgets->SaveLocalConfigurationMenuItem),"activate",G_CALLBACK(on_config_local_save),widgets); + g_signal_connect(G_OBJECT(widgets->SaveExternalConfigurationMenuItem),"activate",G_CALLBACK(on_config_custom_save),widgets); + g_signal_connect(G_OBJECT(widgets->ReadFullLogButton),"clicked",G_CALLBACK(on_process_log_view),widgets); g_signal_connect(G_OBJECT(widgets->ReadShortLogButton),"clicked",G_CALLBACK(on_summary_log_view),widgets); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 4eff327..dcd435f 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -135,6 +135,16 @@ NULL #define full_log_path "/var/log/ubinstall.log" +#define yon_config_get_custom_command(target) yon_char_unite("ubconfig --source ",target," get [autoinstall] AUTOINSTALL[installer_lang] AUTOINSTALL[install_type] AUTOINSTALL[device] AUTOINSTALL[part] AUTOINSTALL[part_size] AUTOINSTALL[part_label] AUTOINSTALL[part_fs_type] AUTOINSTALL[part_format] UTOINSTALL[locale] AUTOINSTALL[lang] AUTOINSTALL[zone] AUTOINSTALL[user_name] AUTOINSTALL[user_gecos] AUTOINSTALL[user_password] AUTOINSTALL[root_password] AUTOINSTALL[autologin] AUTOINSTALL[xkbmodel] AUTOINSTALL[xkblayout] AUTOINSTALL[xkbvariant] AUTOINSTALL[xkboptions] AUTOINSTALL[hostname] AUTOINSTALL[modules] AUTOINSTALL[modules_extra]",NULL) +#define config_get_local_command "ubconfig --source system get [autoinstall] AUTOINSTALL[installer_lang] AUTOINSTALL[install_type] AUTOINSTALL[device] AUTOINSTALL[part] AUTOINSTALL[part_size] AUTOINSTALL[part_label] AUTOINSTALL[part_fs_type] AUTOINSTALL[part_format] UTOINSTALL[locale] AUTOINSTALL[lang] AUTOINSTALL[zone] AUTOINSTALL[user_name] AUTOINSTALL[user_gecos] AUTOINSTALL[user_password] AUTOINSTALL[root_password] AUTOINSTALL[autologin] AUTOINSTALL[xkbmodel] AUTOINSTALL[xkblayout] AUTOINSTALL[xkbvariant] AUTOINSTALL[xkboptions] AUTOINSTALL[hostname] AUTOINSTALL[modules] AUTOINSTALL[modules_extra]" +#define config_get_global_command yon_char_new("ubconfig --source global get [autoinstall] AUTOINSTALL[installer_lang] AUTOINSTALL[install_type] AUTOINSTALL[device] AUTOINSTALL[part] AUTOINSTALL[part_size] AUTOINSTALL[part_label] AUTOINSTALL[part_fs_type] AUTOINSTALL[part_format] UTOINSTALL[locale] AUTOINSTALL[lang] AUTOINSTALL[zone] AUTOINSTALL[user_name] AUTOINSTALL[user_gecos] AUTOINSTALL[user_password] AUTOINSTALL[root_password] AUTOINSTALL[autologin] AUTOINSTALL[xkbmodel] AUTOINSTALL[xkblayout] AUTOINSTALL[xkbvariant] AUTOINSTALL[xkboptions] AUTOINSTALL[hostname] AUTOINSTALL[modules] AUTOINSTALL[modules_extra]") +#define config_get_default_command "" + +#define config_get_global_only_parameters "" +#define config_get_local_only_parameters "" + +#define ubconfig_file_create(target) yon_char_unite("ubconfig --target \"",target,"\" create",NULL) + typedef char* string; string version_application; @@ -182,6 +192,7 @@ typedef struct { int password_min_length; int save_done; + int load_mode; int install_complete; int debug_mode; @@ -201,6 +212,17 @@ typedef struct { GtkListStore *AdditionalSoftwareList; GtkListStore *PartitionsList; + GtkWidget *LoadGlobalConfigurationMenuItem; + GtkWidget *LoadLocalConfigurationMenuItem; + GtkWidget *LoadExternalConfigurationMenuItem; + + GtkWidget *SaveGlobalLocalConfigurationMenuItem; + GtkWidget *SaveGlobalConfigurationMenuItem; + GtkWidget *SaveLocalConfigurationMenuItem; + GtkWidget *SaveExternalConfigurationMenuItem; + + GtkWidget *SaveButton; + GtkWidget *MainWindow; GtkWidget *StatusBox; @@ -392,4 +414,9 @@ void NewFunction(ubinstall_language_window *window, GtkBuilder *builder); ubinstall_keyboard_window *yon_ubinstall_keyboard_new(); password_window *yon_password_new(); -void on_password_accept(GtkWidget *self, dictionary *dict); \ No newline at end of file +void on_password_accept(GtkWidget *self, dictionary *dict); + +char* yon_debug_output(char *pattern,char*text); + +char *yon_save_command_prepare(char *command, char *target); +void yon_interface_update(main_window *widgets); \ No newline at end of file diff --git a/source/ubl-strings.h b/source/ubl-strings.h index c53c39f..6153559 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -6,7 +6,10 @@ #define WELCOME_LABEL _("Welcome to UBLinux installation") #define WELCOME_BOTTOM_LABEL _("This program will ask you few questions\nand help you install UBLinux on your computer") +#define OPEN_LABEL _("Open") + #define KEYBOARD_TITLE_LABEL _("Keyboard layout") + #define CUSTOM_CONFIG_CREATION_ERROR_LABEL _("New configuration file creation failed") #define CANCEL_LABEL _("Cancel") #define BACK_LABEL _("Back") @@ -138,3 +141,5 @@ #define ERROR_LABEL _("Error has occured while installation process") #define LOG_VIEW_LABEL _("Log exploration") + #define SAVE_LABEL _("Save") + #define LOAD_LABEL _("Load") diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index 5ced464..0ef282d 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -72,7 +72,7 @@ - 100 + 999999 16 1 10 @@ -165,6 +165,40 @@ True False + False + + + True + False + Load global configuration + + + + + + True + False + Load local configuration + + + + + + True + False + Load from specific file + + + + True @@ -201,6 +235,54 @@ + + True + False + False + + + True + False + Save configuration + + + + + + True + False + Save to global configuration + + + + + + True + False + Save to local configuration + + + + + + True + False + Save to specific file + + + + + 800 500 @@ -482,7 +564,6 @@ agreement 5 5 left - False True @@ -2485,9 +2566,10 @@ or continue working in the UBLinux Live environment. True False - Installation completion + Completion + @@ -2500,7 +2582,6 @@ or continue working in the UBLinux Live environment. - True False @@ -2509,6 +2590,41 @@ or continue working in the UBLinux Live environment. 1 + + + True + False + end + Success + + + + + + + True + True + 2 + + + + + True + False + start + You have successfully saved configuration. + center + True + + + + + + True + True + 3 + + 11 @@ -3332,15 +3448,15 @@ installed. False 1 - ext3 - ext4 - fat16 - fat32 - exfat - riserfs - udf - xfs - zfs + ext3 + ext4 + fat16 + fat32 + exfat + riserfs + udf + xfs + zfs @@ -7000,6 +7116,7 @@ separately into the selected partition. + True True False True @@ -7058,6 +7175,48 @@ separately into the selected partition. 1 + + + True + False + True + menu3 + + + True + False + + + True + False + Save + + + False + True + 0 + + + + + True + False + pan-down-symbolic + + + False + True + 1 + + + + + + + end + 2 + + From 47c845c70a79635bf2d3d01bca110d04d1264146 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 22 Jul 2024 09:53:30 +0600 Subject: [PATCH 02/10] Test sync for log window and progress bar --- source/ubinstall-gtk.c | 327 ++++++++++++++++++++--------------------- source/ubinstall-gtk.h | 3 +- 2 files changed, 162 insertions(+), 168 deletions(-) diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 8b9af41..90ede0a 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -78,128 +78,130 @@ void yon_load_proceed(YON_CONFIG_TYPE type){ } void yon_interface_update(main_window *widgets){ - enum YON_PAGES page; - char *type = config(AUTOINSTALL_TYPE_INSTALL); - if (strcmp(type,"fast")){ - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationRadio),1); - page = YON_PAGE_INSTALL_COMMON; - } else if (strcmp(type,"next")){ - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationNearRadio),1); - page = YON_PAGE_INSTALL_SEPARATE; - } else if (strcmp(type,"part")){ - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationLinuxRadio),1); - page = YON_PAGE_INSTALL_SAME_PARTITION; - } else if (!strcmp(type,"grub_install")){ - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->GrubInstallRadio),1); - page = YON_PAGE_OPTIONS_GRUB_INSTALL; - } else if (strcmp(type,"grub_update")){ - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->GrubUpdateRadio),1); - page = YON_PAGE_OPTIONS_GRUB_UPDATE; - } else if (strcmp(type,"system_only")){ - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->OSRadio),1); - page = YON_PAGE_OPTIONS_OS_ONLY; - } else if (strcmp(type,"data_only")){ - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->UserDataOnlyRadio),1); - page = YON_PAGE_OPTIONS_USRDATA_ONLY; - } else if (strcmp(type,"custom")){ - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->SeparateRadio),1); - page = YON_PAGE_OPTIONS_SEPARATE; - } - - char *device = config(AUTOINSTALL_DEVICE); - char *part = NULL; - if (page!=YON_PAGE_INSTALL_COMMON) - part = config(part_parameter); - - char *fs_type = config(part_type_parameter); - char *device_label = config(device_label_parameter); - char *format = config(device_format_parameter); - char *part_size = config(part_size_parameter); - - GtkListStore *device_list = widgets->DevicesList; - GtkListStore *part_list=widgets->PartitionsList; - GtkWidget *device_tree=NULL; - GtkWidget *part_tree=NULL; - switch (page){ - case YON_PAGE_INSTALL_COMMON:{ - device_tree = widgets->CommonInstallationDevicesTree; - } break; - case YON_PAGE_INSTALL_SEPARATE:{ - device_tree = widgets->InstallationNearSysDevicesTree; - part_tree = widgets->InstallationNearSysSectionTree; - gtk_spin_button_set_value(GTK_SPIN_BUTTON(widgets->InstallationNearSizeSpin),atof(part_size)); - if (part_size[strlen(part_size)-1]=='M') gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->InstallationNearSizeTypeSpin),0); - if (part_size[strlen(part_size)-1]=='G') gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->InstallationNearSizeTypeSpin),1); - if (part_size[strlen(part_size)-1]=='T') gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->InstallationNearSizeTypeSpin),2); - if (!strcmp(format,"no")) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->NextInstallationFormatCheck),0); - else gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->NextInstallationFormatCheck),1); - gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->NextInstallationFilesystemTypeCombo),fs_type); - gtk_entry_set_text(GTK_ENTRY(widgets->NextInstallationSectionNameEntry),device_label); - - } break; - case YON_PAGE_INSTALL_SAME_PARTITION:{ - device_tree = widgets->SamePlaceDeviceTree; - part_tree = widgets->SamePlacePartTree; - gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->SameInstallationFilesystemTypeCombo),fs_type); - if (!strcmp(format,"no")) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->SameInstallationFormatCheck),0); - else gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->SameInstallationFormatCheck),1); - gtk_entry_set_text(GTK_ENTRY(widgets->SameInstallationSectionNameEntry),device_label); - } break; - case YON_PAGE_OPTIONS_GRUB_INSTALL:{ - device_tree = widgets->GrubInstallDevicesTree; - } break; - case YON_PAGE_OPTIONS_GRUB_UPDATE:{ - device_tree = widgets->GrubUpdateDevicesTree; - } break; - case YON_PAGE_OPTIONS_SEPARATE:{ - GtkTreeIter iter; - device_tree = widgets->SeparateDevicesTree; - part_tree = widgets->SeparateSysSectionTree; - for_iter(GTK_TREE_MODEL(device_list),&iter){ - char *cur_device; - gtk_tree_model_get(GTK_TREE_MODEL(device_list),&iter, 0,&cur_device,-1); - if (!strcmp(cur_device,device)){ - gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(device_tree)),&iter); - break; - } - } - for_iter(GTK_TREE_MODEL(part_list),&iter){ - char *cur_part; - gtk_tree_model_get(GTK_TREE_MODEL(device_list),&iter, 0,&cur_part,-1); - if (!strcmp(cur_part,part)){ - gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(part_tree)),&iter); - } - } - } break; - case YON_PAGE_OPTIONS_OS_ONLY:{ - device_tree = widgets->OSDevicesTree; - part_tree = widgets->OSSysSectionTree; - } break; - case YON_PAGE_OPTIONS_USRDATA_ONLY:{ - device_tree = widgets->UserdataDevicesTree; - part_tree = widgets->UserdataSysSectionTree; - } break; - } - - char *zone = config(zone_parameter); - char *system_locale = config(locale_parameter); - char *language = config(lang_parameter); - - char *kbmodel = config (xkbmodel_parameter); - char *optinos = config(xkboptions_parameter); - char *layout = config(xkblayout_parameter); - - char *user_name = config(user_name_parameter); - char *user_gecos = config(user_name_parameter); - char *user_password = config(user_name_parameter); - char *root_password = config(user_name_parameter); - char *autologin = config(user_name_parameter); - char *hostname = config(user_name_parameter); + if (widgets){}; + // enum YON_PAGES page; + // char *type = config(AUTOINSTALL_TYPE_INSTALL); + // if (strcmp(type,"fast")){ + // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationRadio),1); + // page = YON_PAGE_INSTALL_COMMON; + // } else if (strcmp(type,"next")){ + // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationNearRadio),1); + // page = YON_PAGE_INSTALL_SEPARATE; + // } else if (strcmp(type,"part")){ + // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationLinuxRadio),1); + // page = YON_PAGE_INSTALL_SAME_PARTITION; + // } else if (!strcmp(type,"grub_install")){ + // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); + // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->GrubInstallRadio),1); + // page = YON_PAGE_OPTIONS_GRUB_INSTALL; + // } else if (strcmp(type,"grub_update")){ + // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); + // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->GrubUpdateRadio),1); + // page = YON_PAGE_OPTIONS_GRUB_UPDATE; + // } else if (strcmp(type,"system_only")){ + // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); + // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->OSRadio),1); + // page = YON_PAGE_OPTIONS_OS_ONLY; + // } else if (strcmp(type,"data_only")){ + // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); + // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->UserDataOnlyRadio),1); + // page = YON_PAGE_OPTIONS_USRDATA_ONLY; + // } else if (strcmp(type,"custom")){ + // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); + // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->SeparateRadio),1); + // page = YON_PAGE_OPTIONS_SEPARATE; + // } + + // char *device = config(AUTOINSTALL_DEVICE); + // char *part = NULL; + // if (page!=YON_PAGE_INSTALL_COMMON) + // part = config(part_parameter); + + // char *fs_type = config(part_type_parameter); + // char *device_label = config(device_label_parameter); + // char *format = config(device_format_parameter); + // char *part_size = config(part_size_parameter); + + // GtkListStore *device_list = widgets->DevicesList; + // GtkListStore *part_list=widgets->PartitionsList; + // GtkWidget *device_tree=NULL; + // GtkWidget *part_tree=NULL; + // switch (page){ + // case YON_PAGE_INSTALL_COMMON:{ + // device_tree = widgets->CommonInstallationDevicesTree; + // } break; + // case YON_PAGE_INSTALL_SEPARATE:{ + // device_tree = widgets->InstallationNearSysDevicesTree; + // part_tree = widgets->InstallationNearSysSectionTree; + // gtk_spin_button_set_value(GTK_SPIN_BUTTON(widgets->InstallationNearSizeSpin),atof(part_size)); + // if (part_size[strlen(part_size)-1]=='M') gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->InstallationNearSizeTypeSpin),0); + // if (part_size[strlen(part_size)-1]=='G') gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->InstallationNearSizeTypeSpin),1); + // if (part_size[strlen(part_size)-1]=='T') gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->InstallationNearSizeTypeSpin),2); + // if (!strcmp(format,"no")) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->NextInstallationFormatCheck),0); + // else gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->NextInstallationFormatCheck),1); + // gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->NextInstallationFilesystemTypeCombo),fs_type); + // gtk_entry_set_text(GTK_ENTRY(widgets->NextInstallationSectionNameEntry),device_label); + + // } break; + // case YON_PAGE_INSTALL_SAME_PARTITION:{ + // device_tree = widgets->SamePlaceDeviceTree; + // part_tree = widgets->SamePlacePartTree; + // gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->SameInstallationFilesystemTypeCombo),fs_type); + // if (!strcmp(format,"no")) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->SameInstallationFormatCheck),0); + // else gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->SameInstallationFormatCheck),1); + // gtk_entry_set_text(GTK_ENTRY(widgets->SameInstallationSectionNameEntry),device_label); + // } break; + // case YON_PAGE_OPTIONS_GRUB_INSTALL:{ + // device_tree = widgets->GrubInstallDevicesTree; + // } break; + // case YON_PAGE_OPTIONS_GRUB_UPDATE:{ + // device_tree = widgets->GrubUpdateDevicesTree; + // } break; + // case YON_PAGE_OPTIONS_SEPARATE:{ + // GtkTreeIter iter; + // device_tree = widgets->SeparateDevicesTree; + // part_tree = widgets->SeparateSysSectionTree; + // for_iter(GTK_TREE_MODEL(device_list),&iter){ + // char *cur_device; + // gtk_tree_model_get(GTK_TREE_MODEL(device_list),&iter, 0,&cur_device,-1); + // if (!strcmp(cur_device,device)){ + // gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(device_tree)),&iter); + // break; + // } + // } + // for_iter(GTK_TREE_MODEL(part_list),&iter){ + // char *cur_part; + // gtk_tree_model_get(GTK_TREE_MODEL(device_list),&iter, 0,&cur_part,-1); + // if (!strcmp(cur_part,part)){ + // gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(part_tree)),&iter); + // } + // } + // } break; + // case YON_PAGE_OPTIONS_OS_ONLY:{ + // device_tree = widgets->OSDevicesTree; + // part_tree = widgets->OSSysSectionTree; + // } break; + // case YON_PAGE_OPTIONS_USRDATA_ONLY:{ + // device_tree = widgets->UserdataDevicesTree; + // part_tree = widgets->UserdataSysSectionTree; + // } break; + // default:{}break; + // } + + // char *zone = config(zone_parameter); + // char *system_locale = config(locale_parameter); + // char *language = config(lang_parameter); + + // char *kbmodel = config (xkbmodel_parameter); + // char *optinos = config(xkboptions_parameter); + // char *layout = config(xkblayout_parameter); + + // char *user_name = config(user_name_parameter); + // char *user_gecos = config(user_name_parameter); + // char *user_password = config(user_name_parameter); + // char *root_password = config(user_name_parameter); + // char *autologin = config(user_name_parameter); + // char *hostname = config(user_name_parameter); } @@ -497,6 +499,7 @@ void config_init(){ main_config.save_done=0; main_config.configure_mode=0; main_config.load_mode=-1; + main_config.log_progress_buzy=-1; } void on_configuration_mode_switch(GtkWidget *self); @@ -614,52 +617,38 @@ void *on_config_save(void *data){ gboolean yon_installation_progress_update(void *data); gboolean yon_installation_progress_update(void *data){ main_window *widgets = (main_window*)data; - FILE *file = NULL; - char *current = g_malloc0(4096); - clock_t last_time = 0; - clock_t current_time; - while (1){ - while (gtk_events_pending()) gtk_main_iteration(); - current_time = clock(); - if ((double)(current_time - last_time) / CLOCKS_PER_SEC >= 0.5){ - if (!file) - file = fopen(progress_path,"r"); - if (file){ - if (fgets(current,4096,file)){ - - } else { - if (!yon_char_is_empty(current)&¤t[0]=='('){ - char * current_copy = yon_char_new(current); - char *percentage = yon_char_divide_search(current_copy,")",-1); - free(yon_char_divide(current_copy,0)); - free(yon_char_divide(percentage,0)); - if (strcmp(percentage,"#pb")){ - double fraction = atof(percentage); - gtk_label_set_text(GTK_LABEL(widgets->InstallationLabel),current_copy); - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->InstallationProgress),fraction/100); - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->PackageInstallationProgress),0); - gtk_label_set_text(GTK_LABEL(widgets->PackageInstallationLabel),""); - } else { - gtk_widget_show(gtk_widget_get_parent(widgets->PackageInstallationProgress)); - - int size; - config_str parsed = yon_char_parse(current_copy,&size," "); - double fraction = atof(parsed[2])/100; - gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->PackageInstallationProgress),fraction); - gtk_label_set_text(GTK_LABEL(widgets->PackageInstallationLabel),yon_char_parsed_to_string(parsed,size," ")); - yon_char_parsed_free(parsed,size); - } - last_time = current_time; - free(current_copy); - free(percentage); - } - break; - } - } + while (gtk_events_pending()) gtk_main_iteration(); + int size; + while (main_config.log_progress_buzy){}; + main_config.log_progress_buzy=1; + config_str text = yon_file_open(progress_path,&size); + main_config.log_progress_buzy=0; + if (size){ + if (!yon_char_is_empty(text[size-1])&&text[size-1][0]=='('){ + char * current_copy = yon_char_new(text[size-1]); + char *percentage = yon_char_divide_search(current_copy,")",-1); + free(yon_char_divide(current_copy,0)); + free(yon_char_divide(percentage,0)); + if (strcmp(percentage,"#pb")){ + double fraction = atof(percentage); + gtk_label_set_text(GTK_LABEL(widgets->InstallationLabel),current_copy); + gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->InstallationProgress),fraction/100); + gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->PackageInstallationProgress),0); + gtk_label_set_text(GTK_LABEL(widgets->PackageInstallationLabel),""); + } else { + gtk_widget_show(gtk_widget_get_parent(widgets->PackageInstallationProgress)); + + int size; + config_str parsed = yon_char_parse(current_copy,&size," "); + double fraction = atof(parsed[2])/100; + gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(widgets->PackageInstallationProgress),fraction); + gtk_label_set_text(GTK_LABEL(widgets->PackageInstallationLabel),yon_char_parsed_to_string(parsed,size," ")); + yon_char_parsed_free(parsed,size); } + free(current_copy); + free(percentage); } - fclose(file); - file=NULL; + } if (main_config.install_thread){ return 1; @@ -836,7 +825,10 @@ gboolean yon_read_log(void *data){ log_window *window = (log_window*)data; if (window->Window){ int size; + while (!main_config.install_complete&&main_config.log_progress_buzy){}; + main_config.log_progress_buzy=1; config_str parsed = yon_file_open(window->command,&size); + main_config.log_progress_buzy=0; if (size){ char *final = yon_char_parsed_to_string(parsed,size,""); gtk_label_set_text(GTK_LABEL(window->LogLabel),final); @@ -1963,7 +1955,8 @@ main_window *yon_main_window_complete(){ models[i+1] = yon_char_divide_search(models[i+1],"\n",-1); gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(widgets->KeyboardModelCombo),models[i],_(models[i+1])); } - + yon_load_proceed(YON_CONFIG_DEFAULT); + yon_interface_update(widgets); return widgets; } diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index dcd435f..f329812 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -138,7 +138,7 @@ NULL #define yon_config_get_custom_command(target) yon_char_unite("ubconfig --source ",target," get [autoinstall] AUTOINSTALL[installer_lang] AUTOINSTALL[install_type] AUTOINSTALL[device] AUTOINSTALL[part] AUTOINSTALL[part_size] AUTOINSTALL[part_label] AUTOINSTALL[part_fs_type] AUTOINSTALL[part_format] UTOINSTALL[locale] AUTOINSTALL[lang] AUTOINSTALL[zone] AUTOINSTALL[user_name] AUTOINSTALL[user_gecos] AUTOINSTALL[user_password] AUTOINSTALL[root_password] AUTOINSTALL[autologin] AUTOINSTALL[xkbmodel] AUTOINSTALL[xkblayout] AUTOINSTALL[xkbvariant] AUTOINSTALL[xkboptions] AUTOINSTALL[hostname] AUTOINSTALL[modules] AUTOINSTALL[modules_extra]",NULL) #define config_get_local_command "ubconfig --source system get [autoinstall] AUTOINSTALL[installer_lang] AUTOINSTALL[install_type] AUTOINSTALL[device] AUTOINSTALL[part] AUTOINSTALL[part_size] AUTOINSTALL[part_label] AUTOINSTALL[part_fs_type] AUTOINSTALL[part_format] UTOINSTALL[locale] AUTOINSTALL[lang] AUTOINSTALL[zone] AUTOINSTALL[user_name] AUTOINSTALL[user_gecos] AUTOINSTALL[user_password] AUTOINSTALL[root_password] AUTOINSTALL[autologin] AUTOINSTALL[xkbmodel] AUTOINSTALL[xkblayout] AUTOINSTALL[xkbvariant] AUTOINSTALL[xkboptions] AUTOINSTALL[hostname] AUTOINSTALL[modules] AUTOINSTALL[modules_extra]" #define config_get_global_command yon_char_new("ubconfig --source global get [autoinstall] AUTOINSTALL[installer_lang] AUTOINSTALL[install_type] AUTOINSTALL[device] AUTOINSTALL[part] AUTOINSTALL[part_size] AUTOINSTALL[part_label] AUTOINSTALL[part_fs_type] AUTOINSTALL[part_format] UTOINSTALL[locale] AUTOINSTALL[lang] AUTOINSTALL[zone] AUTOINSTALL[user_name] AUTOINSTALL[user_gecos] AUTOINSTALL[user_password] AUTOINSTALL[root_password] AUTOINSTALL[autologin] AUTOINSTALL[xkbmodel] AUTOINSTALL[xkblayout] AUTOINSTALL[xkbvariant] AUTOINSTALL[xkboptions] AUTOINSTALL[hostname] AUTOINSTALL[modules] AUTOINSTALL[modules_extra]") -#define config_get_default_command "" +#define config_get_default_command "ubconfig --source default get [autoinstall] AUTOINSTALL[installer_lang] AUTOINSTALL[install_type] AUTOINSTALL[device] AUTOINSTALL[part] AUTOINSTALL[part_size] AUTOINSTALL[part_label] AUTOINSTALL[part_fs_type] AUTOINSTALL[part_format] UTOINSTALL[locale] AUTOINSTALL[lang] AUTOINSTALL[zone] AUTOINSTALL[user_name] AUTOINSTALL[user_gecos] AUTOINSTALL[user_password] AUTOINSTALL[root_password] AUTOINSTALL[autologin] AUTOINSTALL[xkbmodel] AUTOINSTALL[xkblayout] AUTOINSTALL[xkbvariant] AUTOINSTALL[xkboptions] AUTOINSTALL[hostname] AUTOINSTALL[modules] AUTOINSTALL[modules_extra]" #define config_get_global_only_parameters "" #define config_get_local_only_parameters "" @@ -202,6 +202,7 @@ typedef struct { GThread *install_thread; guint progress_thread; int configure_mode; + int log_progress_buzy; } config; typedef struct { From 966c89d0aaf478c75c83db52a4c028c1d71f4ff3 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 22 Jul 2024 10:02:56 +0600 Subject: [PATCH 03/10] Test sync for log window and progress bar --- source/ubinstall-gtk.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 90ede0a..533cfbf 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -619,7 +619,8 @@ gboolean yon_installation_progress_update(void *data){ main_window *widgets = (main_window*)data; while (gtk_events_pending()) gtk_main_iteration(); int size; - while (main_config.log_progress_buzy){}; + while (main_config.log_progress_buzy){ + while (gtk_events_pending()) gtk_main_iteration();}; main_config.log_progress_buzy=1; config_str text = yon_file_open(progress_path,&size); main_config.log_progress_buzy=0; From 7515031aa13d2536fec2442594786b1b9b2ed7a8 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 22 Jul 2024 10:05:22 +0600 Subject: [PATCH 04/10] Test sync for log window and progress bar --- source/ubinstall-gtk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 533cfbf..7a597e5 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -499,7 +499,7 @@ void config_init(){ main_config.save_done=0; main_config.configure_mode=0; main_config.load_mode=-1; - main_config.log_progress_buzy=-1; + main_config.log_progress_buzy=0; } void on_configuration_mode_switch(GtkWidget *self); From 07d5678e99d656e7f5c38dd8359099bd5b3aa948 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 22 Jul 2024 14:23:54 +0600 Subject: [PATCH 05/10] Test fix for parameter removal; Test fix for log scrolling --- source/ubinstall-gtk.c | 22 ++++++++++++++-------- source/ubinstall-gtk.h | 1 + ubinstall-gtk-log-view.glade | 2 +- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 7a597e5..743f070 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -813,6 +813,7 @@ log_window *yon_log_window_new(){ log_window *window = malloc(sizeof(log_window)); GtkBuilder *builder = gtk_builder_new_from_resource(glade_path_log_view); window->Window = yon_gtk_builder_get_widget(builder,"MainWindow"); + window->ScrollWindow = yon_gtk_builder_get_widget(builder,"ScrollWindow"); window->HeadLabel = yon_gtk_builder_get_widget(builder,"headerTopic"); window->LogLabel = yon_gtk_builder_get_widget(builder,"LogLabel"); window->StatusBox = yon_gtk_builder_get_widget(builder,"StatusBox"); @@ -835,6 +836,7 @@ if (window->Window){ gtk_label_set_text(GTK_LABEL(window->LogLabel),final); free(final); yon_char_parsed_free(parsed,size); + gtk_adjustment_set_value(gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(window->ScrollWindow)),gtk_adjustment_get_upper(gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(window->ScrollWindow)))); } return 1; } @@ -984,12 +986,14 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ } else { yon_config_remove_by_key(xkblayout_parameter); } - char *model = gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->KeyboardModelCombo))?(char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->KeyboardModelCombo)):""; - // char *layout_switch; - if (!yon_char_is_empty(model)) - yon_config_register(xkbmodel_parameter,xkbmodel_parameter_command,model); - else + if (!gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->KeyboardModelCombo))){ + char *model = gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->KeyboardModelCombo)); + // char *layout_switch; + if (!yon_char_is_empty(model)) + yon_config_register(xkbmodel_parameter,xkbmodel_parameter_command,model); + } else{ yon_config_remove_by_key(xkbmodel_parameter); + } if (!yon_char_is_empty(layouts_list)) yon_config_register(locale_parameter,locale_parameter_command,layouts_list); else @@ -1139,11 +1143,12 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ return; } else { char *password = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->PasswordEntry)); + yon_config_register(user_password_parameter,user_password_parameter_command,password); } } else { - yon_config_register(user_password_parameter,user_password_parameter_command,PASSWORD_DEFAULT); + yon_config_remove_by_key(user_password_parameter); } if (gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->AdminPasswordCombo))==1){ @@ -1202,12 +1207,13 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ yon_config_remove_by_key(xkbmodel_parameter); } - char *options = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->LayoutBindingCombo)); - if (!yon_char_is_empty(options)){ + if (gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->LayoutBindingCombo))){ + char *options = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->LayoutBindingCombo)); yon_config_register(xkboptions_parameter,xkboptions_parameter_command,options); } else { yon_config_remove_by_key(xkboptions_parameter); } + if (!main_config.configure_mode){ if (!main_config.install_complete){ gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALLATION); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index f329812..6727f1b 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -402,6 +402,7 @@ typedef struct{ typedef struct { GtkWidget *Window; + GtkWidget *ScrollWindow; GtkWidget *StatusBox; GtkWidget *HeadLabel; GtkWidget *LogLabel; diff --git a/ubinstall-gtk-log-view.glade b/ubinstall-gtk-log-view.glade index 88255a9..42d453e 100644 --- a/ubinstall-gtk-log-view.glade +++ b/ubinstall-gtk-log-view.glade @@ -42,7 +42,7 @@ vertical 5 - + True True in From bb271d6b6195f58f7507c1cbc2308b9552ea41ea Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 22 Jul 2024 14:28:31 +0600 Subject: [PATCH 06/10] Test fix for parameter removal; Test fix for log scrolling --- source/ubinstall-gtk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 743f070..8a89a13 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -987,7 +987,7 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ yon_config_remove_by_key(xkblayout_parameter); } if (!gtk_combo_box_get_active(GTK_COMBO_BOX(widgets->KeyboardModelCombo))){ - char *model = gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->KeyboardModelCombo)); + char *model = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->KeyboardModelCombo)); // char *layout_switch; if (!yon_char_is_empty(model)) yon_config_register(xkbmodel_parameter,xkbmodel_parameter_command,model); From f7d5e5e39d0221c159b46b7dbf46a11710290756 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 22 Jul 2024 15:28:33 +0600 Subject: [PATCH 07/10] Removed pkexec from gparted command --- source/ubinstall-gtk.c | 28 +++++++++++++++++++++++++--- source/ubinstall-gtk.h | 6 ++++-- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 8a89a13..1fd2ae6 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -79,7 +79,7 @@ void yon_load_proceed(YON_CONFIG_TYPE type){ void yon_interface_update(main_window *widgets){ if (widgets){}; - // enum YON_PAGES page; + // enum YON_PAGES page=YON_PAGE_COMPLETED; // char *type = config(AUTOINSTALL_TYPE_INSTALL); // if (strcmp(type,"fast")){ // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationRadio),1); @@ -188,21 +188,41 @@ void yon_interface_update(main_window *widgets){ // default:{}break; // } + // GtkTreeIter iter; + // char *zone = config(zone_parameter); + // char *region = NULL; + // if (!yon_char_is_empty(zone)) region = yon_char_divide_search(zone,"",-1); // char *system_locale = config(locale_parameter); // char *language = config(lang_parameter); + // for_iter(widgets->LanguagesList,&iter){ + // char *cur=NULL; + // gtk_tree_model_get(GTK_TREE_MODEL(widgets->LanguagesList),&iter,1,&cur,-1); + // if (strstr(system_locale,cur)){ + // gtk_list_store_set(GTK_TREE_MODEL(widgets->LanguagesList),&iter,0,1,-1); + // } else { + // gtk_list_store_set(GTK_TREE_MODEL(widgets->LanguagesList),&iter,0,0,-1); + // } + // } + // gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter)); + // gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->RegionCombo),region); + // gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->ZoneCombo),zone); + // gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->LanguageCombo),language); + // char *kbmodel = config (xkbmodel_parameter); // char *optinos = config(xkboptions_parameter); // char *layout = config(xkblayout_parameter); + + // char *user_name = config(user_name_parameter); // char *user_gecos = config(user_name_parameter); // char *user_password = config(user_name_parameter); // char *root_password = config(user_name_parameter); // char *autologin = config(user_name_parameter); // char *hostname = config(user_name_parameter); - + } void on_config_local_load(GtkWidget *,main_window *); @@ -716,7 +736,10 @@ void on_page_changed(GtkWidget *,GtkWidget *,int page, main_window *widgets){ gtk_widget_set_sensitive(widgets->NextButton,1); gtk_widget_hide(widgets->SaveButton); break; + case YON_PAGE_INSTALL_ERROR: + on_summary_log_view((GtkWidget*)NULL); + [[fallthrough]]; case YON_PAGE_COMPLETION:{ yon_switch_page_render(widgets,7); gtk_widget_set_sensitive(widgets->BackButton,0); @@ -851,7 +874,6 @@ void on_process_log_view(GtkWidget *){ gdk_threads_add_timeout(500,(GSourceFunc)yon_read_log,window); } -void on_summary_log_view(GtkWidget *); void on_summary_log_view(GtkWidget *){ log_window *window = yon_log_window_new(); yon_gtk_window_setup(GTK_WINDOW(window->Window),NULL,LOG_VIEW_LABEL,icon_path,"log_viewer"); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 6727f1b..7e3739e 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -117,7 +117,7 @@ NULL #define set_user_config_command(parameters) yon_char_unite("pkexec bash -c 'ubconfig --target system set [autoinstall] ",parameters,";nice ubinstall2 autoconfig'",NULL) -#define open_gparted_command "pkexec gparted" +#define open_gparted_command "gparted" #define AUTOINSTALL_TYPE_INSTALL_command "ubconfig --source global get autoinstall AUTOINSTALL[install_type]" #define AUTOINSTALL_DEVICE_command "ubconfig --source global get autoinstall AUTOINSTALL[device]" @@ -421,4 +421,6 @@ void on_password_accept(GtkWidget *self, dictionary *dict); char* yon_debug_output(char *pattern,char*text); char *yon_save_command_prepare(char *command, char *target); -void yon_interface_update(main_window *widgets); \ No newline at end of file +void yon_interface_update(main_window *widgets); + +void on_summary_log_view(GtkWidget *); \ No newline at end of file From 95f6a79bf3450a18c5d54b60b98af4ac9b33a214 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 22 Jul 2024 19:33:16 +0600 Subject: [PATCH 08/10] localisation updates, 90% of config loading --- source/ubinstall-gtk.c | 434 ++++++++++++++++++++++++++--------------- source/ubinstall-gtk.h | 15 +- source/ubl-strings.h | 17 ++ ubinstall-gtk.glade | 2 +- ubinstall-gtk.pot | 36 ++++ ubinstall-gtk_ru.po | 51 ++++- 6 files changed, 388 insertions(+), 167 deletions(-) diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 1fd2ae6..175cf07 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -79,167 +79,291 @@ void yon_load_proceed(YON_CONFIG_TYPE type){ void yon_interface_update(main_window *widgets){ if (widgets){}; - // enum YON_PAGES page=YON_PAGE_COMPLETED; - // char *type = config(AUTOINSTALL_TYPE_INSTALL); - // if (strcmp(type,"fast")){ - // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationRadio),1); - // page = YON_PAGE_INSTALL_COMMON; - // } else if (strcmp(type,"next")){ - // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationNearRadio),1); - // page = YON_PAGE_INSTALL_SEPARATE; - // } else if (strcmp(type,"part")){ - // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationLinuxRadio),1); - // page = YON_PAGE_INSTALL_SAME_PARTITION; - // } else if (!strcmp(type,"grub_install")){ - // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); - // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->GrubInstallRadio),1); - // page = YON_PAGE_OPTIONS_GRUB_INSTALL; - // } else if (strcmp(type,"grub_update")){ - // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); - // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->GrubUpdateRadio),1); - // page = YON_PAGE_OPTIONS_GRUB_UPDATE; - // } else if (strcmp(type,"system_only")){ - // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); - // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->OSRadio),1); - // page = YON_PAGE_OPTIONS_OS_ONLY; - // } else if (strcmp(type,"data_only")){ - // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); - // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->UserDataOnlyRadio),1); - // page = YON_PAGE_OPTIONS_USRDATA_ONLY; - // } else if (strcmp(type,"custom")){ - // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); - // gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->SeparateRadio),1); - // page = YON_PAGE_OPTIONS_SEPARATE; - // } - - // char *device = config(AUTOINSTALL_DEVICE); - // char *part = NULL; - // if (page!=YON_PAGE_INSTALL_COMMON) - // part = config(part_parameter); - - // char *fs_type = config(part_type_parameter); - // char *device_label = config(device_label_parameter); - // char *format = config(device_format_parameter); - // char *part_size = config(part_size_parameter); - - // GtkListStore *device_list = widgets->DevicesList; - // GtkListStore *part_list=widgets->PartitionsList; - // GtkWidget *device_tree=NULL; - // GtkWidget *part_tree=NULL; - // switch (page){ - // case YON_PAGE_INSTALL_COMMON:{ - // device_tree = widgets->CommonInstallationDevicesTree; - // } break; - // case YON_PAGE_INSTALL_SEPARATE:{ - // device_tree = widgets->InstallationNearSysDevicesTree; - // part_tree = widgets->InstallationNearSysSectionTree; - // gtk_spin_button_set_value(GTK_SPIN_BUTTON(widgets->InstallationNearSizeSpin),atof(part_size)); - // if (part_size[strlen(part_size)-1]=='M') gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->InstallationNearSizeTypeSpin),0); - // if (part_size[strlen(part_size)-1]=='G') gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->InstallationNearSizeTypeSpin),1); - // if (part_size[strlen(part_size)-1]=='T') gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->InstallationNearSizeTypeSpin),2); - // if (!strcmp(format,"no")) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->NextInstallationFormatCheck),0); - // else gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->NextInstallationFormatCheck),1); - // gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->NextInstallationFilesystemTypeCombo),fs_type); - // gtk_entry_set_text(GTK_ENTRY(widgets->NextInstallationSectionNameEntry),device_label); - - // } break; - // case YON_PAGE_INSTALL_SAME_PARTITION:{ - // device_tree = widgets->SamePlaceDeviceTree; - // part_tree = widgets->SamePlacePartTree; - // gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->SameInstallationFilesystemTypeCombo),fs_type); - // if (!strcmp(format,"no")) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->SameInstallationFormatCheck),0); - // else gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->SameInstallationFormatCheck),1); - // gtk_entry_set_text(GTK_ENTRY(widgets->SameInstallationSectionNameEntry),device_label); - // } break; - // case YON_PAGE_OPTIONS_GRUB_INSTALL:{ - // device_tree = widgets->GrubInstallDevicesTree; - // } break; - // case YON_PAGE_OPTIONS_GRUB_UPDATE:{ - // device_tree = widgets->GrubUpdateDevicesTree; - // } break; - // case YON_PAGE_OPTIONS_SEPARATE:{ - // GtkTreeIter iter; - // device_tree = widgets->SeparateDevicesTree; - // part_tree = widgets->SeparateSysSectionTree; - // for_iter(GTK_TREE_MODEL(device_list),&iter){ - // char *cur_device; - // gtk_tree_model_get(GTK_TREE_MODEL(device_list),&iter, 0,&cur_device,-1); - // if (!strcmp(cur_device,device)){ - // gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(device_tree)),&iter); - // break; - // } - // } - // for_iter(GTK_TREE_MODEL(part_list),&iter){ - // char *cur_part; - // gtk_tree_model_get(GTK_TREE_MODEL(device_list),&iter, 0,&cur_part,-1); - // if (!strcmp(cur_part,part)){ - // gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(part_tree)),&iter); - // } - // } - // } break; - // case YON_PAGE_OPTIONS_OS_ONLY:{ - // device_tree = widgets->OSDevicesTree; - // part_tree = widgets->OSSysSectionTree; - // } break; - // case YON_PAGE_OPTIONS_USRDATA_ONLY:{ - // device_tree = widgets->UserdataDevicesTree; - // part_tree = widgets->UserdataSysSectionTree; - // } break; - // default:{}break; - // } - - // GtkTreeIter iter; - - // char *zone = config(zone_parameter); - // char *region = NULL; - // if (!yon_char_is_empty(zone)) region = yon_char_divide_search(zone,"",-1); - // char *system_locale = config(locale_parameter); - // char *language = config(lang_parameter); - // for_iter(widgets->LanguagesList,&iter){ - // char *cur=NULL; - // gtk_tree_model_get(GTK_TREE_MODEL(widgets->LanguagesList),&iter,1,&cur,-1); - // if (strstr(system_locale,cur)){ - // gtk_list_store_set(GTK_TREE_MODEL(widgets->LanguagesList),&iter,0,1,-1); - // } else { - // gtk_list_store_set(GTK_TREE_MODEL(widgets->LanguagesList),&iter,0,0,-1); - // } - // } - // gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter)); - // gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->RegionCombo),region); - // gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->ZoneCombo),zone); - // gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->LanguageCombo),language); - - - // char *kbmodel = config (xkbmodel_parameter); - // char *optinos = config(xkboptions_parameter); - // char *layout = config(xkblayout_parameter); - - - - // char *user_name = config(user_name_parameter); - // char *user_gecos = config(user_name_parameter); - // char *user_password = config(user_name_parameter); - // char *root_password = config(user_name_parameter); - // char *autologin = config(user_name_parameter); - // char *hostname = config(user_name_parameter); + enum YON_PAGES page=YON_PAGE_COMPLETED; + char *type = config(AUTOINSTALL_TYPE_INSTALL); + if (!yon_char_is_empty(type)){ + if (!strcmp(type,"fast")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationRadio),1); + page = YON_PAGE_INSTALL_COMMON; + } else if (!strcmp(type,"next")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationNearRadio),1); + page = YON_PAGE_INSTALL_SEPARATE; + } else if (!strcmp(type,"part")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationLinuxRadio),1); + page = YON_PAGE_INSTALL_SAME_PARTITION; + } else if (!strcmp(type,"grub_install")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->GrubInstallRadio),1); + page = YON_PAGE_OPTIONS_GRUB_INSTALL; + } else if (!strcmp(type,"grub_update")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->GrubUpdateRadio),1); + page = YON_PAGE_OPTIONS_GRUB_UPDATE; + } else if (!strcmp(type,"system_only")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->OSRadio),1); + page = YON_PAGE_OPTIONS_OS_ONLY; + } else if (!strcmp(type,"data_only")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->UserDataOnlyRadio),1); + page = YON_PAGE_OPTIONS_USRDATA_ONLY; + } else if (!strcmp(type,"custom")){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio),1); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->SeparateRadio),1); + page = YON_PAGE_OPTIONS_SEPARATE; + } + } + + char *device = config(AUTOINSTALL_DEVICE); + char *part = NULL; + if (page!=YON_PAGE_INSTALL_COMMON) + part = config(part_parameter); + + char *fs_type = config(part_type_parameter); + char *device_label = config(device_label_parameter); + char *format = config(device_format_parameter); + char *part_size = config(part_size_parameter); + + GtkListStore *device_list = widgets->DevicesList; + GtkListStore *part_list=widgets->PartitionsList; + GtkWidget *device_tree=NULL; + GtkWidget *part_tree=NULL; + switch (page){ + case YON_PAGE_INSTALL_COMMON:{ + device_tree = widgets->CommonInstallationDevicesTree; + } break; + case YON_PAGE_INSTALL_SEPARATE:{ + device_tree = widgets->InstallationNearSysDevicesTree; + part_tree = widgets->InstallationNearSysSectionTree; + if (!yon_char_is_empty(part_size)){ + gtk_spin_button_set_value(GTK_SPIN_BUTTON(widgets->InstallationNearSizeSpin),atof(part_size)); + if (part_size[strlen(part_size)-1]=='M') gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->InstallationNearSizeTypeSpin),0); + if (part_size[strlen(part_size)-1]=='G') gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->InstallationNearSizeTypeSpin),1); + if (part_size[strlen(part_size)-1]=='T') gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->InstallationNearSizeTypeSpin),2); + } + if (format&&!strcmp(format,"yes")) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->NextInstallationFormatCheck),1); + else gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->NextInstallationFormatCheck),main_config.format_default); + gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->NextInstallationFilesystemTypeCombo),fs_type); + gtk_entry_set_text(GTK_ENTRY(widgets->NextInstallationSectionNameEntry),device_label); + + } break; + case YON_PAGE_INSTALL_SAME_PARTITION:{ + device_tree = widgets->SamePlaceDeviceTree; + part_tree = widgets->SamePlacePartTree; + gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->SameInstallationFilesystemTypeCombo),fs_type); + if (format&&!strcmp(format,"yes")) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->SameInstallationFormatCheck),1); + else gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->SameInstallationFormatCheck),main_config.format_default); + if (device_label) + gtk_entry_set_text(GTK_ENTRY(widgets->SameInstallationSectionNameEntry),device_label); + else + gtk_entry_set_text(GTK_ENTRY(widgets->SameInstallationSectionNameEntry),""); + + } break; + case YON_PAGE_OPTIONS_GRUB_INSTALL:{ + device_tree = widgets->GrubInstallDevicesTree; + } break; + case YON_PAGE_OPTIONS_GRUB_UPDATE:{ + device_tree = widgets->GrubUpdateDevicesTree; + } break; + case YON_PAGE_OPTIONS_SEPARATE:{ + GtkTreeIter iter; + device_tree = widgets->SeparateDevicesTree; + part_tree = widgets->SeparateSysSectionTree; + for_iter(GTK_TREE_MODEL(device_list),&iter){ + char *cur_device; + gtk_tree_model_get(GTK_TREE_MODEL(device_list),&iter, 0,&cur_device,-1); + if (!strcmp(cur_device,device)){ + gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(device_tree)),&iter); + break; + } + } + on_near_installation_device_changed(device_tree,widgets); + for_iter(GTK_TREE_MODEL(part_list),&iter){ + char *cur_part; + gtk_tree_model_get(GTK_TREE_MODEL(device_list),&iter, 0,&cur_part,-1); + if (!strcmp(cur_part,part)){ + gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(part_tree)),&iter); + } + } + } break; + case YON_PAGE_OPTIONS_OS_ONLY:{ + device_tree = widgets->OSDevicesTree; + part_tree = widgets->OSSysSectionTree; + } break; + case YON_PAGE_OPTIONS_USRDATA_ONLY:{ + device_tree = widgets->UserdataDevicesTree; + part_tree = widgets->UserdataSysSectionTree; + } break; + default:{}break; + } + + GtkTreeIter iter; + char *cur_device=""; + if (page!=YON_PAGE_OPTIONS_SEPARATE && !yon_char_is_empty(device)){ + for_iter (widgets->DevicesList,&iter){ + gtk_tree_model_get(GTK_TREE_MODEL(widgets->DevicesList),&iter,0,&cur_device,-1); + if (!strcmp(device,cur_device)){ + gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(device_tree)),&iter); + break; + } + } + on_near_installation_device_changed(device_tree,widgets); + if (!yon_char_is_empty(part)){ + for_iter (widgets->PartitionsList,&iter){ + gtk_tree_model_get(GTK_TREE_MODEL(widgets->PartitionsList),&iter,0,&part,-1); + if (!strcmp(device,cur_device)){ + gtk_tree_selection_select_iter(gtk_tree_view_get_selection(GTK_TREE_VIEW(part_tree)),&iter); + break; + } + } + } + } + + + char *system_locale = config(locale_parameter); + if (!yon_char_is_empty(system_locale)){ + for_iter(widgets->LanguagesList,&iter){ + char *cur=NULL; + gtk_tree_model_get(GTK_TREE_MODEL(widgets->LanguagesList),&iter,1,&cur,-1); + if (strstr(system_locale,cur)){ + gtk_list_store_set((widgets->LanguagesList),&iter,0,1,-1); + } else { + gtk_list_store_set((widgets->LanguagesList),&iter,0,0,-1); + } + } + gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter)); + } else { + for_iter(widgets->LanguagesList,&iter){ + gtk_list_store_set((widgets->LanguagesList),&iter,0,0,-1); + } + gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter)); + } + + char *zone = config(zone_parameter); + char *region = NULL; + if (!yon_char_is_empty(zone)) region = yon_char_divide_search(zone,"/",-1); + if (!yon_char_is_empty(region)){ + gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->RegionCombo),region); + } else { + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->RegionCombo),0); + } + + if (!yon_char_is_empty(zone)){ + gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->ZoneCombo),zone); + } else { + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->ZoneCombo),0); + } + + char *language = config(lang_parameter); + if (!yon_char_is_empty(language)){ + gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->LanguageCombo),language); + } else { + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->LanguageCombo),0); + } + + + char *kbmodel = config (xkbmodel_parameter); + char *optinos = config(xkboptions_parameter); + char *layout = config(xkblayout_parameter); + + if (!yon_char_is_empty(kbmodel)){ + gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->KeyboardModelCombo),kbmodel); + } else gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->KeyboardModelCombo),0); + + if (!yon_char_is_empty(optinos)){ + gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->LayoutBindingCombo),optinos); + } else gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->LayoutBindingCombo),0); + + if (!yon_char_is_empty(layout)){ + for_iter(widgets->LayoutList,&iter){ + char *cur=NULL; + gtk_tree_model_get(GTK_TREE_MODEL(widgets->LayoutList),&iter,1,&cur,-1); + if (strstr(layout,cur)){ + gtk_tree_store_set(widgets->LayoutList,&iter,0,1,-1); + } else { + gtk_tree_store_set(widgets->LayoutList,&iter,0,0,-1); + } + } + gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter)); + } else { + for_iter(widgets->LayoutList,&iter){ + gtk_tree_store_set((widgets->LayoutList),&iter,0,0,-1); + } + gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter)); + } + + char *user_name = config(user_name_parameter); + char *user_gecos = config(user_gecos_parameter); + char *user_password = config(user_password_parameter); + char *root_password = config(root_password_parameter); + char *autologin = config(autologin_parameter); + char *hostname = config(hostname_parameter); + + if (!yon_char_is_empty(user_name)){ + gtk_entry_set_text(GTK_ENTRY(widgets->LoginEntry),user_name); + } else gtk_entry_set_text(GTK_ENTRY(widgets->LoginEntry),""); + + if (!yon_char_is_empty(user_gecos)){ + gtk_entry_set_text(GTK_ENTRY(widgets->UserNameEntry),user_gecos); + } else gtk_entry_set_text(GTK_ENTRY(widgets->UserNameEntry),""); + + if (!yon_char_is_empty(user_password)){ + gtk_entry_set_text(GTK_ENTRY(widgets->PasswordEntry),user_password); + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->PasswordCombo),1); + } else { + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->PasswordCombo),0); + gtk_entry_set_text(GTK_ENTRY(widgets->PasswordEntry),""); + } + + if (!yon_char_is_empty(root_password)){ + gtk_entry_set_text(GTK_ENTRY(widgets->AdminPasswordEntry),root_password); + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->AdminPasswordCombo),1); + } else { + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->AdminPasswordCombo),0); + gtk_entry_set_text(GTK_ENTRY(widgets->AdminPasswordEntry),""); + } + + if (!yon_char_is_empty(autologin)){ + if (!strcmp(autologin,"yes")) + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->AutologinCheck),1); + else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->AutologinCheck),0); + } else + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->AutologinCheck),main_config.autologin_default); + + if (!yon_char_is_empty(hostname)){ + if (strcmp(hostname,"auto")){ + gtk_entry_set_text(GTK_ENTRY(widgets->HotnameEntry),hostname); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->AutoHostnameCheck),0); + } else{ + gtk_entry_set_text(GTK_ENTRY(widgets->HotnameEntry),""); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->AutoHostnameCheck),1); + } + } else { + gtk_entry_set_text(GTK_ENTRY(widgets->HotnameEntry),""); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->AutoHostnameCheck),1); + } } -void on_config_local_load(GtkWidget *,main_window *); -void on_config_local_load(GtkWidget *,main_window *){ +void on_config_local_load(GtkWidget *,main_window *widgets); +void on_config_local_load(GtkWidget *,main_window *widgets){ yon_load_proceed(YON_CONFIG_LOCAL); + yon_interface_update(widgets); main_config.load_mode=1; } void on_config_global_load(GtkWidget *,main_window *); -void on_config_global_load(GtkWidget *,main_window *){ +void on_config_global_load(GtkWidget *,main_window *widgets){ yon_load_proceed(YON_CONFIG_GLOBAL); + yon_interface_update(widgets); main_config.load_mode=0; } void on_config_custom_load(GtkWidget *,main_window *); -void on_config_custom_load(GtkWidget *,main_window *){ +void on_config_custom_load(GtkWidget *,main_window *widgets){ yon_load_proceed(YON_CONFIG_CUSTOM); + yon_interface_update(widgets); main_config.load_mode=3; } @@ -963,10 +1087,10 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ GtkTreeModel *model = GTK_TREE_MODEL(widgets->LanguagesFilter); char *lang_code=NULL; for_iter(model,&iter){ - gtk_tree_model_get(model,&iter,1,&lang_code,-1); - languages = yon_char_unite(languages,",",lang_code,NULL); + gtk_tree_model_get(model,&iter,2,&lang_code,-1); + languages = yon_char_unite(languages,!yon_char_is_empty(languages)?",":"",lang_code,NULL); } - if (yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->AvailableLanguagesEntry)))){ + if (yon_char_is_empty(languages)){ yon_config_remove_by_key(locale_parameter); } else { yon_config_register(locale_parameter,locale_parameter_command,languages); @@ -1017,9 +1141,9 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ yon_config_remove_by_key(xkbmodel_parameter); } if (!yon_char_is_empty(layouts_list)) - yon_config_register(locale_parameter,locale_parameter_command,layouts_list); + yon_config_register(xkblayout_parameter,xkblayout_parameter_command,layouts_list); else - yon_config_remove_by_key(locale_parameter); + yon_config_remove_by_key(xkblayout_parameter); gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),page+1); } break; @@ -1153,7 +1277,7 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ if (yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->LoginEntry)))){ yon_config_remove_by_key(user_name_parameter); } else { - char *login = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->UserNameEntry)); + char *login = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->LoginEntry)); yon_config_register(user_name_parameter,user_name_parameter_command,login); } @@ -1194,7 +1318,7 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ yon_config_remove_by_key(hostname_parameter); } else { - char *hostname = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->UserNameEntry)); + char *hostname = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->HotnameEntry)); yon_config_register(hostname_parameter,hostname_parameter_command,hostname); } @@ -1212,7 +1336,6 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ gtk_tree_model_get(GTK_TREE_MODEL(widgets->LayoutsFilter),&iter,0,&id,3,&status,-1); if (status){ char *temp = yon_char_unite(locales,!yon_char_is_empty(locales)?",":"",id,NULL); - free(locales); locales=temp; } } @@ -1563,7 +1686,6 @@ void on_separate_installation_changed(GtkWidget *self, main_window *widgets){ } } -void on_near_installation_device_changed(GtkWidget *self, main_window *widgets); void on_near_installation_device_changed(GtkWidget *self, main_window *widgets){ gtk_list_store_clear(widgets->PartitionsList); GtkTreeIter iter; diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 7e3739e..a479794 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -106,7 +106,7 @@ NULL #define locale_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[locale]" #define device_format_parameter "AUTOINSTALL[device_format]" #define device_format_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[device_format]" -#define device_label_parameter "AUTOINSTALL[part_label]" +#define device_label_parameter "AUTOINSTALL[device_label]" #define device_label_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[part_label]" #define part_size_parameter "AUTOINSTALL[part_size]" #define part_size_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[part_size]" @@ -135,10 +135,10 @@ NULL #define full_log_path "/var/log/ubinstall.log" -#define yon_config_get_custom_command(target) yon_char_unite("ubconfig --source ",target," get [autoinstall] AUTOINSTALL[installer_lang] AUTOINSTALL[install_type] AUTOINSTALL[device] AUTOINSTALL[part] AUTOINSTALL[part_size] AUTOINSTALL[part_label] AUTOINSTALL[part_fs_type] AUTOINSTALL[part_format] UTOINSTALL[locale] AUTOINSTALL[lang] AUTOINSTALL[zone] AUTOINSTALL[user_name] AUTOINSTALL[user_gecos] AUTOINSTALL[user_password] AUTOINSTALL[root_password] AUTOINSTALL[autologin] AUTOINSTALL[xkbmodel] AUTOINSTALL[xkblayout] AUTOINSTALL[xkbvariant] AUTOINSTALL[xkboptions] AUTOINSTALL[hostname] AUTOINSTALL[modules] AUTOINSTALL[modules_extra]",NULL) -#define config_get_local_command "ubconfig --source system get [autoinstall] AUTOINSTALL[installer_lang] AUTOINSTALL[install_type] AUTOINSTALL[device] AUTOINSTALL[part] AUTOINSTALL[part_size] AUTOINSTALL[part_label] AUTOINSTALL[part_fs_type] AUTOINSTALL[part_format] UTOINSTALL[locale] AUTOINSTALL[lang] AUTOINSTALL[zone] AUTOINSTALL[user_name] AUTOINSTALL[user_gecos] AUTOINSTALL[user_password] AUTOINSTALL[root_password] AUTOINSTALL[autologin] AUTOINSTALL[xkbmodel] AUTOINSTALL[xkblayout] AUTOINSTALL[xkbvariant] AUTOINSTALL[xkboptions] AUTOINSTALL[hostname] AUTOINSTALL[modules] AUTOINSTALL[modules_extra]" -#define config_get_global_command yon_char_new("ubconfig --source global get [autoinstall] AUTOINSTALL[installer_lang] AUTOINSTALL[install_type] AUTOINSTALL[device] AUTOINSTALL[part] AUTOINSTALL[part_size] AUTOINSTALL[part_label] AUTOINSTALL[part_fs_type] AUTOINSTALL[part_format] UTOINSTALL[locale] AUTOINSTALL[lang] AUTOINSTALL[zone] AUTOINSTALL[user_name] AUTOINSTALL[user_gecos] AUTOINSTALL[user_password] AUTOINSTALL[root_password] AUTOINSTALL[autologin] AUTOINSTALL[xkbmodel] AUTOINSTALL[xkblayout] AUTOINSTALL[xkbvariant] AUTOINSTALL[xkboptions] AUTOINSTALL[hostname] AUTOINSTALL[modules] AUTOINSTALL[modules_extra]") -#define config_get_default_command "ubconfig --source default get [autoinstall] AUTOINSTALL[installer_lang] AUTOINSTALL[install_type] AUTOINSTALL[device] AUTOINSTALL[part] AUTOINSTALL[part_size] AUTOINSTALL[part_label] AUTOINSTALL[part_fs_type] AUTOINSTALL[part_format] UTOINSTALL[locale] AUTOINSTALL[lang] AUTOINSTALL[zone] AUTOINSTALL[user_name] AUTOINSTALL[user_gecos] AUTOINSTALL[user_password] AUTOINSTALL[root_password] AUTOINSTALL[autologin] AUTOINSTALL[xkbmodel] AUTOINSTALL[xkblayout] AUTOINSTALL[xkbvariant] AUTOINSTALL[xkboptions] AUTOINSTALL[hostname] AUTOINSTALL[modules] AUTOINSTALL[modules_extra]" +#define yon_config_get_custom_command(target) yon_char_unite("ubconfig --source ",target," get [autoinstall] AUTOINSTALL[installer_lang] AUTOINSTALL[install_type] AUTOINSTALL[device] AUTOINSTALL[part] AUTOINSTALL[part_size] AUTOINSTALL[part_label] AUTOINSTALL[part_fs_type] AUTOINSTALL[part_format] UTOINSTALL[locale] AUTOINSTALL[lang] AUTOINSTALL[zone] AUTOINSTALL[user_name] AUTOINSTALL[user_gecos] AUTOINSTALL[user_password] AUTOINSTALL[root_password] AUTOINSTALL[autologin] AUTOINSTALL[xkbmodel] AUTOINSTALL[xkblayout] AUTOINSTALL[xkbvariant] AUTOINSTALL[xkboptions] AUTOINSTALL[hostname] AUTOINSTALL[modules] AUTOINSTALL[modules_extra] AUTOINSTALL[device_label] AUTOINSTALL[locale]",NULL) +#define config_get_local_command "ubconfig --source system get [autoinstall] AUTOINSTALL[installer_lang] AUTOINSTALL[install_type] AUTOINSTALL[device] AUTOINSTALL[part] AUTOINSTALL[part_size] AUTOINSTALL[part_label] AUTOINSTALL[part_fs_type] AUTOINSTALL[part_format] UTOINSTALL[locale] AUTOINSTALL[lang] AUTOINSTALL[zone] AUTOINSTALL[user_name] AUTOINSTALL[user_gecos] AUTOINSTALL[user_password] AUTOINSTALL[root_password] AUTOINSTALL[autologin] AUTOINSTALL[xkbmodel] AUTOINSTALL[xkblayout] AUTOINSTALL[xkbvariant] AUTOINSTALL[xkboptions] AUTOINSTALL[hostname] AUTOINSTALL[modules] AUTOINSTALL[modules_extra] AUTOINSTALL[device_label] AUTOINSTALL[locale]" +#define config_get_global_command yon_char_new("ubconfig --source global get [autoinstall] AUTOINSTALL[installer_lang] AUTOINSTALL[install_type] AUTOINSTALL[device] AUTOINSTALL[part] AUTOINSTALL[part_size] AUTOINSTALL[part_label] AUTOINSTALL[part_fs_type] AUTOINSTALL[part_format] UTOINSTALL[locale] AUTOINSTALL[lang] AUTOINSTALL[zone] AUTOINSTALL[user_name] AUTOINSTALL[user_gecos] AUTOINSTALL[user_password] AUTOINSTALL[root_password] AUTOINSTALL[autologin] AUTOINSTALL[xkbmodel] AUTOINSTALL[xkblayout] AUTOINSTALL[xkbvariant] AUTOINSTALL[xkboptions] AUTOINSTALL[hostname] AUTOINSTALL[modules] AUTOINSTALL[modules_extra] AUTOINSTALL[device_label] AUTOINSTALL[locale]") +#define config_get_default_command "ubconfig --source default get [autoinstall] AUTOINSTALL[installer_lang] AUTOINSTALL[install_type] AUTOINSTALL[device] AUTOINSTALL[part] AUTOINSTALL[part_size] AUTOINSTALL[part_label] AUTOINSTALL[part_fs_type] AUTOINSTALL[part_format] UTOINSTALL[locale] AUTOINSTALL[lang] AUTOINSTALL[zone] AUTOINSTALL[user_name] AUTOINSTALL[user_gecos] AUTOINSTALL[user_password] AUTOINSTALL[root_password] AUTOINSTALL[autologin] AUTOINSTALL[xkbmodel] AUTOINSTALL[xkblayout] AUTOINSTALL[xkbvariant] AUTOINSTALL[xkboptions] AUTOINSTALL[hostname] AUTOINSTALL[modules] AUTOINSTALL[modules_extra] AUTOINSTALL[device_label] AUTOINSTALL[locale]" #define config_get_global_only_parameters "" #define config_get_local_only_parameters "" @@ -203,6 +203,8 @@ typedef struct { guint progress_thread; int configure_mode; int log_progress_buzy; + int autologin_default; + int format_default; } config; typedef struct { @@ -423,4 +425,5 @@ char* yon_debug_output(char *pattern,char*text); char *yon_save_command_prepare(char *command, char *target); void yon_interface_update(main_window *widgets); -void on_summary_log_view(GtkWidget *); \ No newline at end of file +void on_summary_log_view(GtkWidget *); +void on_near_installation_device_changed(GtkWidget *self, main_window *widgets); \ No newline at end of file diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 6153559..d1176b9 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -143,3 +143,20 @@ #define LOG_VIEW_LABEL _("Log exploration") #define SAVE_LABEL _("Save") #define LOAD_LABEL _("Load") + + +#define LOAD_GLOBAL_LABEL _("Load global configuration") +#define LOAD_LOCAL_LABEL _("Load local configuration") +#define LOAD_CUSTOM_LABEL _("Load from specific file") + +#define SAVE_ALL_LABEL _("Save configuration") +#define SAVE_GLOBAL_LABEL _("Save to global configuration") +#define SAVE_LOCAL_LABEL _("Save to local configuration") +#define SAVE_CUSTOM_LABEL _("Save to specific file") + +#define CONFIGURATION_TITLE_LABEL _("Configuration") +#define CONFIGURATION_FINISH_HEAD_LABEL _("Installer configuration has been finished") +#define CONFIGURATION_FINISH_LABEL _("Choose a save option on the header bar") + +#define CONFIGURATION_SAVE_HEAD_LABEL _("Configuration has been saved") +#define CONFIGURATION_SAVE_LABEL _("You can safely exit configurator or return and create new configuration file.") \ No newline at end of file diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index 0ef282d..8938134 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -564,6 +564,7 @@ agreement 5 5 left + False True @@ -1000,7 +1001,6 @@ and help you install UBLinux on your computer - True True False True diff --git a/ubinstall-gtk.pot b/ubinstall-gtk.pot index 3e4df4b..61832ea 100644 --- a/ubinstall-gtk.pot +++ b/ubinstall-gtk.pot @@ -549,6 +549,42 @@ msgstr "" msgid "Log exploration" msgstr "" +msgid "Load global configuration" +msgstr "" + +msgid "Load local configuration" +msgstr "" + +msgid "Load from specific file" +msgstr "" + +msgid "Save configuration" +msgstr "" + +msgid "Save to global configuration" +msgstr "" + +msgid "Save to local configuration" +msgstr "" + +msgid "Save to specific file" +msgstr "" + +msgid "Configuration" +msgstr "" + +msgid "Installer configuration has been finished" +msgstr "" + +msgid "Choose a save option on the header bar" +msgstr "" + +msgid "Configuration has been saved" +msgstr "" + +msgid "You can safely exit configurator or return and create new configuration file." +msgstr "" + msgid "Afrikaans" msgstr "" diff --git a/ubinstall-gtk_ru.po b/ubinstall-gtk_ru.po index 3f8c82b..c9bb321 100644 --- a/ubinstall-gtk_ru.po +++ b/ubinstall-gtk_ru.po @@ -332,13 +332,17 @@ msgstr "Расширенный режим установки" #: source/ubl-strings.h:72 msgid "" "Installing OS files, user data on different partitions, creating RAID, etc." -msgstr "Установка файлов ОС, пользовательских данныъ на разные разделы, создание RAID и др." +msgstr "" +"Установка файлов ОС, пользовательских данныъ на разные разделы, создание " +"RAID и др." #: source/ubl-strings.h:73 msgid "" -"Attention! The selected OS UBLinux components will be installed\n" +"Attention! The selected OC UBLinux components will be installed\n" "separately into the selected partition." -msgstr "Внимание! В выбранный раздел будет произведена раздельная установка выбранных компонентов ОС UBLinux/" +msgstr "" +"Внимание! В выбранный раздел будет произведена раздельная установка " +"выбранных компонентов ОС UBLinux/" #: source/ubl-strings.h:74 msgid "GRUB install" @@ -362,7 +366,8 @@ msgstr "Раздельная установка" #: source/ubl-strings.h:79 msgid "Installing OS components and user data on different disk partitions" -msgstr "Установка компонентов ОС и пользовательских данных на разные разделы диска" +msgstr "" +"Установка компонентов ОС и пользовательских данных на разные разделы диска" #: source/ubl-strings.h:80 msgid "OS only" @@ -571,6 +576,44 @@ msgstr "Во время процесса установки произошла msgid "Log exploration" msgstr "Просмотр лога" +msgid "Load global configuration" +msgstr "Загрузить глобальную конфигурацию" + +msgid "Load local configuration" +msgstr "Загрузить локальную конфигурацию" + +msgid "Load from specific file" +msgstr "Зашрузить из файла" + +msgid "Save configuration" +msgstr "Сохранить конфигурацию" + +msgid "Save to global configuration" +msgstr "Сохранить глобальную конфигурацию" + +msgid "Save to local configuration" +msgstr "Сохранить в локальную конфигурацию" + +msgid "Save to specific file" +msgstr "Сохранить в файл" + +msgid "Configuration" +msgstr "Конфигурация" + +msgid "Installer configuration has been finished" +msgstr "Настройка конфигурации завершена" + +msgid "Choose a save option on the header bar" +msgstr "Выберите опцию сохранения на верхней панели" + +#, fuzzy +msgid "Configuration has been saved" +msgstr "Конфигурация сохранена" + +msgid "" +"You can safely exit configurator or return and create new configuration file." +msgstr "Вы можете выйти из настройки конфигурации или настроить другой файл конфигурации." + msgid "Afrikaans" msgstr "Африканский" From 62a58570a39037fff30361a0b04a43486726c444 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 22 Jul 2024 19:35:49 +0600 Subject: [PATCH 09/10] localisation fixes --- ubinstall-gtk.glade | 5 ++--- ubinstall-gtk.pot | 6 ++++++ ubinstall-gtk_ru.po | 6 ++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index 8938134..dbb81f4 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -564,7 +564,6 @@ agreement 5 5 left - False True @@ -2595,7 +2594,7 @@ or continue working in the UBLinux Live environment. True False end - Success + Configuration has been saved @@ -2612,7 +2611,7 @@ or continue working in the UBLinux Live environment. True False start - You have successfully saved configuration. + You can safely exit configurator or return and create new configuration file. center True diff --git a/ubinstall-gtk.pot b/ubinstall-gtk.pot index 61832ea..ec770d3 100644 --- a/ubinstall-gtk.pot +++ b/ubinstall-gtk.pot @@ -573,6 +573,12 @@ msgstr "" msgid "Configuration" msgstr "" +msgid "Save" +msgstr "" + +msgid "Load" +msgstr "" + msgid "Installer configuration has been finished" msgstr "" diff --git a/ubinstall-gtk_ru.po b/ubinstall-gtk_ru.po index c9bb321..88ee4a7 100644 --- a/ubinstall-gtk_ru.po +++ b/ubinstall-gtk_ru.po @@ -600,6 +600,12 @@ msgstr "Сохранить в файл" msgid "Configuration" msgstr "Конфигурация" +msgid "Save" +msgstr "Сохранить" + +msgid "Load" +msgstr "Загрузить" + msgid "Installer configuration has been finished" msgstr "Настройка конфигурации завершена" From 8a0fc301efdb15b4fb464147b3dc95a7702c92e3 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Tue, 23 Jul 2024 18:01:26 +0600 Subject: [PATCH 10/10] Check buttons for saving disabling --- source/ubinstall-gtk.c | 39 +- ubinstall-gtk-keyboard.glade | 8 +- ubinstall-gtk.glade | 688 ++++++++++++++++++++++++++++------- 3 files changed, 587 insertions(+), 148 deletions(-) diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 175cf07..293c348 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -222,23 +222,31 @@ void yon_interface_update(main_window *widgets){ char *system_locale = config(locale_parameter); if (!yon_char_is_empty(system_locale)){ + char *chosen_langs = ""; for_iter(widgets->LanguagesList,&iter){ - char *cur=NULL; - gtk_tree_model_get(GTK_TREE_MODEL(widgets->LanguagesList),&iter,1,&cur,-1); + char *cur=NULL, *render = NULL; + gtk_tree_model_get(GTK_TREE_MODEL(widgets->LanguagesList),&iter,1,&render,2,&cur,-1); if (strstr(system_locale,cur)){ gtk_list_store_set((widgets->LanguagesList),&iter,0,1,-1); + chosen_langs = yon_char_unite(chosen_langs,!yon_char_is_empty(chosen_langs)?";":"",render,NULL); } else { gtk_list_store_set((widgets->LanguagesList),&iter,0,0,-1); } } - gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter)); + if (!yon_char_is_empty(chosen_langs)){ + gtk_entry_set_text(GTK_ENTRY(widgets->AvailableLanguagesEntry),chosen_langs); + free(chosen_langs); + } + // gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter)); } else { for_iter(widgets->LanguagesList,&iter){ gtk_list_store_set((widgets->LanguagesList),&iter,0,0,-1); } - gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter)); + // gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter)); } + + char *zone = config(zone_parameter); char *region = NULL; @@ -257,7 +265,10 @@ void yon_interface_update(main_window *widgets){ char *language = config(lang_parameter); if (!yon_char_is_empty(language)){ - gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->LanguageCombo),language); + int feasf = gtk_combo_box_set_active_id(GTK_COMBO_BOX(widgets->LanguageCombo),language); + if (feasf){ + printf("fsa\n"); + }; } else { gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->LanguageCombo),0); } @@ -276,21 +287,20 @@ void yon_interface_update(main_window *widgets){ } else gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->LayoutBindingCombo),0); if (!yon_char_is_empty(layout)){ + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->ManualLayoutRadio),1); for_iter(widgets->LayoutList,&iter){ char *cur=NULL; - gtk_tree_model_get(GTK_TREE_MODEL(widgets->LayoutList),&iter,1,&cur,-1); + gtk_tree_model_get(GTK_TREE_MODEL(widgets->LayoutList),&iter,0,&cur,-1); if (strstr(layout,cur)){ - gtk_tree_store_set(widgets->LayoutList,&iter,0,1,-1); + gtk_tree_store_set(widgets->LayoutList,&iter,3,1,-1); } else { - gtk_tree_store_set(widgets->LayoutList,&iter,0,0,-1); + gtk_tree_store_set(widgets->LayoutList,&iter,3,0,-1); } } - gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter)); } else { for_iter(widgets->LayoutList,&iter){ - gtk_tree_store_set((widgets->LayoutList),&iter,0,0,-1); + gtk_tree_store_set((widgets->LayoutList),&iter,3,0,-1); } - gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter)); } char *user_name = config(user_name_parameter); @@ -1787,6 +1797,10 @@ main_window *yon_main_window_complete(){ main_window *widgets=NULL; widgets = yon_remalloc(widgets,sizeof(main_window)); GtkBuilder *builder = gtk_builder_new_from_resource(glade_path); + gtk_builder_add_callback_symbol(builder,"yon_gtk_widget_set_sensitive_from_toggle_button",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button)); + gtk_builder_add_callback_symbol(builder,"yon_gtk_toggle_button_set_inactive_from_toggle",G_CALLBACK(yon_gtk_toggle_button_set_inactive_from_toggle)); + gtk_builder_add_callback_symbol(builder,"yon_gtk_toggle_button_set_inactive_from_entry",G_CALLBACK(yon_gtk_toggle_button_set_inactive_from_entry)); + gtk_builder_add_callback_symbol(builder,"yon_gtk_toggle_button_set_inactive_from_combo_box",G_CALLBACK(yon_gtk_toggle_button_set_inactive_from_combo_box)); // Custom widgets configuration widgets->builder = builder; @@ -1986,6 +2000,7 @@ main_window *yon_main_window_complete(){ g_signal_connect(G_OBJECT(widgets->SameInstallationFormatCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),widgets->SameInstallationFilesystemTypeCombo); // g_signal_connect(G_OBJECT(widgets->InstallationToggle),"toggled",G_CALLBACK(on_toggle_block),widgets); + gtk_tree_model_filter_set_visible_column(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter),0); gtk_tree_model_filter_refilter(GTK_TREE_MODEL_FILTER(widgets->LanguagesFilter)); @@ -2047,6 +2062,7 @@ main_window *yon_main_window_complete(){ if (layout_size){ char *layout_id = yon_char_new(layout[0]); gtk_tree_store_append(widgets->LayoutList,&iter,NULL); + yon_debug_output("%s\n",parsed[i]); gtk_tree_store_set(widgets->LayoutList,&iter,0,layout[0],1,_(layout[1]),2,1,-1); yon_char_parsed_free(layout,layout_size); layout = yon_config_load(get_layouts_local_command(layout_id),&layout_size); @@ -2106,6 +2122,7 @@ main_window *yon_main_window_complete(){ models[i+1] = yon_char_divide_search(models[i+1],"\n",-1); gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(widgets->KeyboardModelCombo),models[i],_(models[i+1])); } + gtk_builder_connect_signals(builder,NULL); yon_load_proceed(YON_CONFIG_DEFAULT); yon_interface_update(widgets); return widgets; diff --git a/ubinstall-gtk-keyboard.glade b/ubinstall-gtk-keyboard.glade index c5f6ad6..8ca6152 100644 --- a/ubinstall-gtk-keyboard.glade +++ b/ubinstall-gtk-keyboard.glade @@ -50,13 +50,13 @@ True True - False + treeviewcolumn1 - - column + + Chosen @@ -68,6 +68,7 @@ + Id @@ -78,6 +79,7 @@ + Layout diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index dbb81f4..216cb86 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -564,6 +564,7 @@ agreement 5 5 left + False True @@ -1588,40 +1589,24 @@ and help you install UBLinux on your computer True False + center 10 5 - + True False - 5 + False + True + + - - True - False - Region: - - - False - True - 0 - - - - - True - False - - - False - True - 1 - + - True - False + False + True 0 @@ -1631,33 +1616,86 @@ and help you install UBLinux on your computer False 5 - + True False - Zone: + 15 + 5 + + + True + False + Region: + + + False + True + 0 + + + + + True + False + False + + + + False + True + 1 + + - False - True + True + False 0 - + True False + 15 + 5 + + + True + False + Zone: + + + False + True + 0 + + + + + True + False + False + + + + False + True + 1 + + - False - True + True + False 1 - True - False - 1 + False + True + 3 @@ -1683,6 +1721,24 @@ and help you install UBLinux on your computer True False 5 + + + True + False + False + True + + + + + + + + False + True + 0 + + True @@ -1692,23 +1748,26 @@ and help you install UBLinux on your computer False True - 0 + 1 True + False False + True True - 1 + 2 True + False True True image6 @@ -1719,7 +1778,7 @@ and help you install UBLinux on your computer False True - 2 + 3 @@ -1734,6 +1793,23 @@ and help you install UBLinux on your computer True False 5 + + + True + False + False + True + + + + + + + False + True + 0 + + True @@ -1743,15 +1819,17 @@ and help you install UBLinux on your computer False True - 0 + 1 True + False False LanguagesFilter 2 + @@ -1762,7 +1840,7 @@ and help you install UBLinux on your computer True True - 1 + 2 @@ -1852,6 +1930,23 @@ and help you install UBLinux on your computer True False 5 + + + True + False + False + True + + + + + + + False + True + 0 + + True @@ -1861,22 +1956,24 @@ and help you install UBLinux on your computer False True - 0 + 1 True + False False 0 Default (Regular 105-key) + True True - 1 + 2 @@ -1891,6 +1988,23 @@ and help you install UBLinux on your computer True False 5 + + + True + False + False + True + + + + + + + False + True + 0 + + True @@ -1900,12 +2014,13 @@ and help you install UBLinux on your computer False True - 0 + 1 True + False False 0 @@ -1935,11 +2050,12 @@ and help you install UBLinux on your computer Scroll Lock Left Ctrl+Left Win + True True - 1 + 2 @@ -1949,6 +2065,40 @@ and help you install UBLinux on your computer 1 + + + False + True + 2 + + + + + True + False + vertical + 5 + + + True + False + False + True + + + + + + + + + + + False + True + 1 + + True @@ -1964,10 +2114,12 @@ and help you install UBLinux on your computer Default layout (ru) True + False True False True True + False @@ -1979,10 +2131,12 @@ and help you install UBLinux on your computer Define True + False True False True DefaultLayoutRadio + False @@ -2000,7 +2154,6 @@ and help you install UBLinux on your computer True - False False 5 @@ -2011,6 +2164,7 @@ and help you install UBLinux on your computer True + False True LayoutsFilter 0 @@ -2057,6 +2211,7 @@ and help you install UBLinux on your computer True + False True True image13 @@ -2073,6 +2228,7 @@ and help you install UBLinux on your computer True + False True True image14 @@ -2111,7 +2267,7 @@ and help you install UBLinux on your computer False True - 2 + 3 @@ -2176,6 +2332,23 @@ and help you install UBLinux on your computer True False 5 + + + True + False + False + True + + + + + + + False + True + 0 + + True @@ -2186,19 +2359,21 @@ and help you install UBLinux on your computer False True - 0 + 1 True + False True Super Admin + True True - 1 + 2 @@ -2213,6 +2388,23 @@ and help you install UBLinux on your computer True False 5 + + + True + False + False + True + + + + + + + False + True + 0 + + True @@ -2223,19 +2415,21 @@ and help you install UBLinux on your computer False True - 0 + 1 True + False True superadmin + True True - 1 + 2 @@ -2250,6 +2444,24 @@ and help you install UBLinux on your computer True False 5 + + + True + False + False + True + + + + + + + + False + True + 0 + + True @@ -2260,38 +2472,42 @@ and help you install UBLinux on your computer False True - 0 + 1 True + False False 0 Default Set a password + False True - 1 + 2 True + False True False ****** password + True True - 2 + 3 @@ -2306,18 +2522,37 @@ and help you install UBLinux on your computer True False 5 + + + True + False + False + True + + + + + + + False + True + 0 + + Automatic login without password prompt True + False True False True + False True - 0 + 1 @@ -2332,6 +2567,24 @@ and help you install UBLinux on your computer True False 5 + + + True + False + False + True + + + + + + + + False + True + 0 + + True @@ -2342,38 +2595,42 @@ and help you install UBLinux on your computer False True - 0 + 1 True + False False 0 Default Set a password + False True - 1 + 2 True + False True False ****** password + True True - 2 + 3 @@ -2400,11 +2657,16 @@ and help you install UBLinux on your computer False 5 - + True False - Computer name: - 0 + False + True + + + + + False @@ -2413,12 +2675,11 @@ and help you install UBLinux on your computer - - Automatically + True - True - False - True + False + Computer name: + 0 False @@ -2429,8 +2690,10 @@ and help you install UBLinux on your computer True + False True ubstation + True @@ -2438,6 +2701,22 @@ and help you install UBLinux on your computer 2 + + + Automatically + True + False + True + False + True + + + + False + True + 3 + + False @@ -2882,6 +3161,23 @@ or continue working in the UBLinux Live environment. True False 5 + + + True + False + False + True + + + + + + + False + True + 0 + + True @@ -2891,12 +3187,13 @@ or continue working in the UBLinux Live environment. False True - 0 + 1 True + False False 1 @@ -2910,11 +3207,12 @@ or continue working in the UBLinux Live environment. xfs zfs + True True - 1 + 2 @@ -2929,6 +3227,23 @@ or continue working in the UBLinux Live environment. True False 5 + + + True + False + False + True + + + + + + + False + True + 0 + + True @@ -2938,18 +3253,20 @@ or continue working in the UBLinux Live environment. False True - 0 + 1 True + False True + True True - 1 + 2 @@ -3129,42 +3446,12 @@ installed. True False vertical - 5 - + True False - 5 - - - True - False - Select device: - 0 - - - False - True - 0 - - - - - True - True - True - image36 - - - - False - True - end - 1 - - + Choose a section: + 0 False @@ -3179,17 +3466,17 @@ installed. in 128 - + True True - DevicesList + PartitionsList 0 - Device + Section @@ -3200,7 +3487,7 @@ installed. - Description + Capacity @@ -3211,7 +3498,7 @@ installed. - Mark + Free space @@ -3222,7 +3509,7 @@ installed. - Size + File system @@ -3233,7 +3520,7 @@ installed. - Serial + Mark @@ -3255,7 +3542,7 @@ installed. False True - 0 + 1 @@ -3263,12 +3550,42 @@ installed. True False vertical + 5 - + True False - Choose a section: - 0 + 5 + + + True + False + Select device: + 0 + + + False + True + 0 + + + + + True + True + True + image36 + + + + False + True + end + 1 + + False @@ -3283,17 +3600,17 @@ installed. in 128 - + True True - PartitionsList + DevicesList 0 - Section + Device @@ -3304,7 +3621,7 @@ installed. - Capacity + Description @@ -3315,7 +3632,7 @@ installed. - Free space + Mark @@ -3326,7 +3643,7 @@ installed. - File system + Size @@ -3337,7 +3654,7 @@ installed. - Mark + Serial @@ -3359,7 +3676,7 @@ installed. False True - 1 + 2 @@ -3367,6 +3684,24 @@ installed. True False 5 + + + True + False + False + True + + + + + + + + False + True + 0 + + True @@ -3376,12 +3711,13 @@ installed. False True - 0 + 1 True + False True 0,0 adjustment1 @@ -3390,12 +3726,13 @@ installed. False True - 1 + 2 True + False False 1 @@ -3403,11 +3740,12 @@ installed. Gb Tb + False True - 2 + 3 @@ -3429,6 +3767,24 @@ installed. True False 5 + + + True + False + False + True + + + + + + + + False + True + 0 + + True @@ -3438,12 +3794,13 @@ installed. False True - 0 + 1 True + False False 1 @@ -3457,26 +3814,29 @@ installed. xfs zfs + True True - 1 + 2 Format True + False True False True True + False True - 2 + 3 @@ -3491,6 +3851,23 @@ installed. True False 5 + + + True + False + False + True + + + + + + + False + True + 0 + + True @@ -3500,18 +3877,20 @@ installed. False True - 0 + 1 True + False True + True True - 1 + 2 @@ -3924,6 +4303,24 @@ installed. True False 5 + + + True + False + False + True + + + + + + + + False + True + 0 + + True @@ -3933,12 +4330,13 @@ installed. False True - 0 + 1 True + False False 1 @@ -3952,26 +4350,29 @@ installed. xfs zfs + True True - 1 + 2 Format True + False True False True True + False True - 2 + 3 @@ -3986,6 +4387,23 @@ installed. True False 5 + + + True + False + False + True + + + + + + + False + True + 0 + + True @@ -3995,18 +4413,20 @@ installed. False True - 0 + 1 True + False True + True True - 1 + 2