diff --git a/gresource.xml b/gresource.xml index 359f308..9844d18 100644 --- a/gresource.xml +++ b/gresource.xml @@ -31,6 +31,7 @@ language.png in_part_install_disk.png clear_install_disk.png + manual_install_disk.png modules.csv diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 96f05bf..f4b0dd8 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -56,6 +56,7 @@ set(DEPENDFILES ../images/near_install_disk.png ../images/in_part_install_disk.png ../images/clear_install_disk.png + ../images/manual_install_disk.png ../images/language.png ../ubinstall-gtk.glade ../ubinstall-gtk-language.glade diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 9374685..cd688b0 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -227,6 +227,12 @@ void config_init(){ main_config.progress_thread=0; main_config.install_complete=0; main_config.save_done=0; + main_config.configure_mode=0; +} + +void on_configuration_mode_switch(GtkWidget *self); +void on_configuration_mode_switch(GtkWidget *self){ + main_config.configure_mode = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(self)); } int yon_image_resize_from_container(GtkImage *target, GdkPixbuf *pixbuf_unscaled); @@ -405,37 +411,45 @@ 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); } break; + case YON_PAGE_LICENCE:{ gtk_widget_set_sensitive(widgets->CancelInstallButton,1); gtk_widget_set_sensitive(widgets->BackButton,1); } break; + case YON_PAGE_REGION: { yon_image_resize_from_container(GTK_IMAGE(widgets->RegionImage), widgets->regions_original); } break; + case YON_PAGE_KEYBOARD: { yon_image_resize_from_container(GTK_IMAGE(widgets->KeyboardImage), widgets->keyboard_original); } break; + case YON_PAGE_INSTALLATION:{ gtk_widget_set_sensitive(widgets->BackButton,0); - if (main_config.config_save_thread) + if (main_config.config_save_thread&&!main_config.configure_mode) g_thread_join(main_config.config_save_thread); - if (!main_config.progress_thread) + if (!main_config.progress_thread&&!main_config.configure_mode) main_config.progress_thread = gdk_threads_add_timeout(500,(GSourceFunc)yon_installation_progress_update,widgets); - if (!main_config.slider_thread) + if (!main_config.slider_thread&&!main_config.configure_mode) main_config.slider_thread = g_timeout_add(5000,(GSourceFunc)on_image_slide,widgets); gtk_widget_show(gtk_widget_get_parent(widgets->InstallationProgress)); } break; + case YON_PAGE_OS_COMPONENTS: case YON_PAGE_SOFTWARE: yon_switch_page_render(widgets,3); break; + case YON_PAGE_USERS: gtk_widget_set_sensitive(widgets->NextButton,1); break; + case YON_PAGE_INSTALL_ERROR: case YON_PAGE_COMPLETION:{ gtk_widget_set_sensitive(widgets->BackButton,0); @@ -451,6 +465,7 @@ void on_page_changed(GtkWidget *,GtkWidget *,int page, main_window *widgets){ 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); } break; + case YON_PAGE_INSTALL_COMMON: case YON_PAGE_INSTALL_SEPARATE: case YON_PAGE_INSTALL_SAME_PARTITION: { @@ -489,6 +504,32 @@ void *on_setup_system_configuration(void * data){ return NULL; } +void yon_install_options_save(GtkWidget *device_tree, GtkWidget *part_tree,char *mode,main_window *widgets); +void yon_install_options_save(GtkWidget *device_tree, GtkWidget *part_tree,char *mode,main_window *widgets){ + GtkTreeIter iter,itar; + GtkTreeModel *model,*model2; + if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(device_tree)),&model,&iter)){ + if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(part_tree)),&model2,&itar)){ + char *cur_device, *cur_section; + gtk_tree_model_get(model,&iter,0,&cur_device,-1); + gtk_tree_model_get(model2,&itar,0,&cur_section,-1); + yon_config_register(AUTOINSTALL_DEVICE,AUTOINSTALL_DEVICE_command,cur_device); + yon_config_register(AUTOINSTALL_TYPE_INSTALL,AUTOINSTALL_TYPE_INSTALL_command,mode); + yon_config_register(part_parameter,part_parameter_command,cur_section); + if (!main_config.configure_mode) + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALLATION_BEGIN); + else + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_REGION); + } else { + yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),NO_DEVICE_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + yon_ubl_status_highlight_incorrect(part_tree); + } + } else { + yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),NO_DEVICE_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + yon_ubl_status_highlight_incorrect(device_tree); + } +} + void on_page_navigation_clicked(GtkWidget *self, main_window *widgets); void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ int mode = self==widgets->NextButton ? 1 : self == widgets->BackButton ? -1 : self==widgets->CancelInstallButton?-2:0; @@ -496,6 +537,11 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ switch (mode){ case 1: { // Next 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); + } break; + case YON_PAGE_SECTIONS:{ //sections int active_id=-1; if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->InstallationRadio))) @@ -504,8 +550,8 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ active_id=1; else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->InstallationLinuxRadio))) active_id=2; - // else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->InstallationRadio))) - // active_id=3; + else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->InstallationWindowsRadio))) + active_id=3; // else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->InstallationRadio))) // active_id=4; main_config.install_mode=active_id; @@ -518,6 +564,9 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ break; case 2: gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALL_SAME_PARTITION); + break; + case 3: + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALL_OPTIONS); } }break; case YON_PAGE_REGION:{ //region @@ -556,6 +605,7 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),page+1); }break; + case YON_PAGE_KEYBOARD: { //keyboard gtk_widget_set_sensitive(widgets->BackButton,1); if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->ManualLayoutRadio))){ @@ -593,10 +643,12 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),page+1); } break; + default:{ // all other pages gtk_widget_set_sensitive(widgets->BackButton,1); gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),page+1); }break; + case YON_PAGE_INSTALL_COMMON: { GtkTreeModel *model; GtkTreeIter iter; @@ -608,15 +660,19 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ char *file_system_type = (char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(widgets->CommonInstallationFilesystemTypeCombo)); char *device_name = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->CommonInstallationSectionNameEntry)); char *device; - yon_config_remove_by_key(AUTOSTART_PARTS); + yon_config_remove_by_key(part_parameter); gtk_tree_model_get(model,&iter,0,&device,-1); yon_config_register(AUTOINSTALL_TYPE_INSTALL,AUTOINSTALL_TYPE_INSTALL_command,"fast"); yon_config_register(AUTOINSTALL_DEVICE,AUTOINSTALL_DEVICE_command,device); yon_config_register(device_label_parameter,device_label_parameter_command,device_name); yon_config_register(part_type_parameter,part_type_parameter_command,file_system_type); + if (!main_config.configure_mode) gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALLATION_BEGIN); + else + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_REGION); }break; + case YON_PAGE_INSTALL_SEPARATE: { GtkTreeModel *model; @@ -644,7 +700,7 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ gtk_tree_model_get(model,&iter,0,&part,-1); yon_config_register(AUTOINSTALL_TYPE_INSTALL,AUTOINSTALL_TYPE_INSTALL_command,"next"); yon_config_register(AUTOINSTALL_DEVICE,AUTOINSTALL_DEVICE_command,device); - yon_config_register(AUTOSTART_PARTS,AUTOSTART_PARTS_command,part); + yon_config_register(part_parameter,part_parameter_command,part); yon_config_register(device_label_parameter,device_label_parameter_command,device_name); if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->NextInstallationFormatCheck))){ yon_config_register(device_format_parameter,device_format_parameter_command,"no"); @@ -657,9 +713,13 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->NextInstallationFormatCheck))) yon_config_register(device_format_parameter,device_format_parameter_command,"no"); + if (!main_config.configure_mode) gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALLATION_BEGIN); + else + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_REGION); } break; + case YON_PAGE_INSTALL_SAME_PARTITION: { GtkTreeModel *model; @@ -682,7 +742,7 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ gtk_tree_model_get(model,&iter,0,&part,-1); yon_config_register(AUTOINSTALL_TYPE_INSTALL,AUTOINSTALL_TYPE_INSTALL_command,"part"); yon_config_register(AUTOINSTALL_DEVICE,AUTOINSTALL_DEVICE_command,device); - yon_config_register(AUTOSTART_PARTS,AUTOSTART_PARTS_command,part); + yon_config_register(part_parameter,part_parameter_command,part); yon_config_register(device_label_parameter,device_label_parameter_command,device_name); if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->SameInstallationFormatCheck))){ @@ -695,8 +755,12 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ } + if (!main_config.configure_mode) gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALLATION_BEGIN); + else + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_REGION); }break; + case YON_PAGE_USERS:{ //users if (yon_char_is_empty(gtk_entry_get_text(GTK_ENTRY(widgets->UserNameEntry)))){ @@ -790,51 +854,152 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ } else { yon_config_remove_by_key(xkboptions_parameter); } - if (!main_config.install_complete){ - gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALLATION); + if (!main_config.configure_mode){ + if (!main_config.install_complete){ + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALLATION); + } else { + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_COMPLETION); + } + if (gtk_progress_bar_get_fraction(GTK_PROGRESS_BAR(widgets->InstallationProgress))>0.9){ + pthread_t tid; + pthread_create(&tid,NULL,on_setup_system_configuration,widgets); + } + main_config.save_done=1; + yon_debug_output("Save changed to: %s\n",yon_char_from_int(main_config.save_done)); + + yon_debug_output("Install state: %s\n",yon_char_from_int(main_config.install_complete)); + if (main_config.install_complete) + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_COMPLETION); + else { + gtk_widget_set_sensitive(widgets->CancelInstallButton,0); + gtk_widget_set_sensitive(widgets->NextButton,0); + gtk_widget_set_sensitive(widgets->BackButton,0); + } } else { - gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_COMPLETION); - } - if (gtk_progress_bar_get_fraction(GTK_PROGRESS_BAR(widgets->InstallationProgress))>0.9){ - pthread_t tid; - pthread_create(&tid,NULL,on_setup_system_configuration,widgets); - } - main_config.save_done=1; - yon_debug_output("Save changed to: %s\n",yon_char_from_int(main_config.save_done)); - - yon_debug_output("Install state: %s\n",yon_char_from_int(main_config.install_complete)); - if (main_config.install_complete) - gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_COMPLETION); - else { - gtk_widget_set_sensitive(widgets->CancelInstallButton,0); - gtk_widget_set_sensitive(widgets->NextButton,0); - gtk_widget_set_sensitive(widgets->BackButton,0); + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_CONFIGURE_END); } }break; + case YON_PAGE_INSTALLATION_BEGIN:{ pthread_t tid; pthread_create(&tid,NULL,on_config_save,widgets); gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALLATION); } break; + case YON_PAGE_COMPLETION: if (!system("reboot")) return; break; + + case YON_PAGE_INSTALL_OPTIONS: { + int mode = -1; + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->GrubInstallRadio))){ + mode = 0; + } else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->GrubUpdateRadio))){ + mode = 1; + } else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->SeparateRadio))){ + mode = 2; + } else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->OSRadio))){ + mode = 3; + } else if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->UserDataOnlyRadio))){ + mode = 4; + } + switch(mode){ + case 0: gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_OPTIONS_GRUB_INSTALL); + break; + case 1: gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_OPTIONS_GRUB_UPDATE); + break; + case 2: gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_OPTIONS_SEPARATE); + break; + case 3: gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_OPTIONS_OS_ONLY); + break; + case 4: gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_OPTIONS_USRDATA_ONLY); + break; + } + } break; + + case YON_PAGE_OPTIONS_GRUB_INSTALL:{ + GtkTreeIter iter; + GtkTreeModel *model; + if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->GrubInstallDevicesTree)),&model,&iter)){ + char *cur_device; + gtk_tree_model_get(model,&iter,0,&cur_device,-1); + yon_config_register(AUTOINSTALL_DEVICE,AUTOINSTALL_DEVICE_command,cur_device); + yon_config_register(AUTOINSTALL_TYPE_INSTALL,AUTOINSTALL_TYPE_INSTALL_command,"grub_install"); + yon_config_remove_by_key(part_parameter); + if (!main_config.configure_mode) + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALLATION_BEGIN); + else + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_REGION); + } else { + yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),NO_DEVICE_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + yon_ubl_status_highlight_incorrect(widgets->GrubInstallDevicesTree); + } + } break; + + case YON_PAGE_OPTIONS_GRUB_UPDATE:{ + GtkTreeIter iter; + GtkTreeModel *model; + if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->GrubUpdateDevicesTree)),&model,&iter)){ + char *cur_device; + gtk_tree_model_get(model,&iter,0,&cur_device,-1); + yon_config_register(AUTOINSTALL_DEVICE,AUTOINSTALL_DEVICE_command,cur_device); + yon_config_register(AUTOINSTALL_TYPE_INSTALL,AUTOINSTALL_TYPE_INSTALL_command,"grub_update"); + yon_config_remove_by_key(part_parameter); + if (!main_config.configure_mode) + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALLATION_BEGIN); + else + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_REGION); + } else { + yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),NO_DEVICE_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + yon_ubl_status_highlight_incorrect(widgets->GrubUpdateDevicesTree); + } + }break; + + case YON_PAGE_OPTIONS_SEPARATE:{ + yon_install_options_save(widgets->SeparateDevicesTree,widgets->SeparateSysSectionTree,"system_only",widgets); + }break; + + case YON_PAGE_OPTIONS_SEPARATE_USRDATA:{ + yon_install_options_save(widgets->SeparateUserDevicesTree,widgets->SeparateUserSysSectionTree,"system_only",widgets); + } break; + + case YON_PAGE_OPTIONS_OS_ONLY:{ + yon_install_options_save(widgets->OSDevicesTree,widgets->OSSysSectionTree,"system_only",widgets); + } break; + + case YON_PAGE_OPTIONS_USRDATA_ONLY:{ + yon_install_options_save(widgets->UserdataDevicesTree,widgets->UserdataSysSectionTree,"data_only",widgets); + } break; } } break; case -1: { // Previous switch (page){ case YON_PAGE_REGION: { - - gtk_widget_set_sensitive(widgets->BackButton,0); - gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),page-1); + if (!main_config.configure_mode){ + gtk_widget_set_sensitive(widgets->BackButton,0); + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),page-1); + } else { + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_SECTIONS); + } }break; + case YON_PAGE_INSTALL_COMMON: case YON_PAGE_INSTALL_SEPARATE: case YON_PAGE_INSTALL_SAME_PARTITION: + case YON_PAGE_INSTALL_OPTIONS: { - gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),2); + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_SECTIONS); } break; + + case YON_PAGE_OPTIONS_GRUB_INSTALL: + case YON_PAGE_OPTIONS_GRUB_UPDATE: + case YON_PAGE_OPTIONS_SEPARATE: + case YON_PAGE_OPTIONS_OS_ONLY: + case YON_PAGE_OPTIONS_USRDATA_ONLY: + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALL_OPTIONS); + break; + default:{ gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),page-1); } @@ -1112,12 +1277,40 @@ main_window *yon_main_window_complete(){ widgets->GpartedNearButton = yon_gtk_builder_get_widget(builder,"GpartedNearButton"); widgets->GpartedSameButton = yon_gtk_builder_get_widget(builder,"GpartedSameButton"); + widgets->ConfigurationModeMenuItem = yon_gtk_builder_get_widget(builder,"ConfigurationModeMenuItem"); widgets->DocumentationMenuItem = yon_gtk_builder_get_widget(builder,"DocumentationMenuItem"); widgets->AboutMenuItem = yon_gtk_builder_get_widget(builder,"AboutMenuItem"); widgets->StatusBox = yon_gtk_builder_get_widget(builder,"StatusBox"); widgets->AdditionalSoftwareCell = GTK_CELL_RENDERER(gtk_builder_get_object(builder,"AdditionalSoftwareCell")); + widgets->GrubInstallRadio = yon_gtk_builder_get_widget(builder,"GrubInstallRadio"); + widgets->GrubUpdateRadio = yon_gtk_builder_get_widget(builder,"GrubUpdateRadio"); + widgets->SeparateRadio = yon_gtk_builder_get_widget(builder,"SeparateRadio"); + widgets->OSRadio = yon_gtk_builder_get_widget(builder,"OSRadio"); + widgets->UserDataOnlyRadio = yon_gtk_builder_get_widget(builder,"UserDataOnlyRadio"); + + widgets->GpartedGrubInstallButton = yon_gtk_builder_get_widget(builder,"GpartedGrubInstallButton"); + widgets->GrubInstallDevicesTree = yon_gtk_builder_get_widget(builder,"GrubInstallDevicesTree"); + + widgets->GpartedGrubUpdateButton = yon_gtk_builder_get_widget(builder,"GpartedGrubUpdateButton"); + widgets->GrubUpdateDevicesTree = yon_gtk_builder_get_widget(builder,"GrubUpdateDevicesTree"); + + widgets->GpartedSeparateButton = yon_gtk_builder_get_widget(builder,"GpartedSeparateButton"); + widgets->SeparateDevicesTree = yon_gtk_builder_get_widget(builder,"SeparateDevicesTree"); + widgets->SeparateSysSectionTree = yon_gtk_builder_get_widget(builder,"SeparateSysSectionTree"); + widgets->GpartedSeparateUserButton = yon_gtk_builder_get_widget(builder,"GpartedSeparateUserButton"); + widgets->SeparateUserDevicesTree = yon_gtk_builder_get_widget(builder,"SeparateUserDevicesTree"); + widgets->SeparateUserSysSectionTree = yon_gtk_builder_get_widget(builder,"SeparateUse-rSysSectionTree"); + + widgets->GpartedOSButton = yon_gtk_builder_get_widget(builder,"GpartedOSButton"); + widgets->OSDevicesTree = yon_gtk_builder_get_widget(builder,"OSDevicesTree"); + widgets->OSSysSectionTree = yon_gtk_builder_get_widget(builder,"OSSysSectionTree"); + + widgets->GpartedUserdataButton = yon_gtk_builder_get_widget(builder,"GpartedUserdataButton"); + widgets->UserdataDevicesTree = yon_gtk_builder_get_widget(builder,"UserdataDevicesTree"); + widgets->UserdataSysSectionTree = yon_gtk_builder_get_widget(builder,"UserdataSysSectionTree"); + 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")); @@ -1149,6 +1342,7 @@ main_window *yon_main_window_complete(){ g_signal_connect(G_OBJECT(widgets->InstallationNearSysDevicesTree),"cursor-changed",G_CALLBACK(on_near_installation_device_changed),widgets); g_signal_connect(G_OBJECT(widgets->SamePlaceDeviceTree),"cursor-changed",G_CALLBACK(on_near_installation_device_changed),widgets); + g_signal_connect(G_OBJECT(widgets->ConfigurationModeMenuItem),"toggled",G_CALLBACK(on_configuration_mode_switch),widgets); g_signal_connect(G_OBJECT(widgets->DocumentationMenuItem),"activate",G_CALLBACK(on_open_documentation_confirmation),widgets); g_signal_connect(G_OBJECT(widgets->AboutMenuItem),"activate",G_CALLBACK(on_about),widgets); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 707b82e..10d3858 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -75,7 +75,7 @@ NULL #define AUTOINSTALL_TYPE_INSTALL "AUTOINSTALL[install_type]" #define AUTOINSTALL_DEVICE "AUTOINSTALL[device]" -#define AUTOSTART_PARTS "AUTOINSTALL[part]" +#define part_parameter "AUTOINSTALL[part]" #define user_name_parameter "AUTOINSTALL[user_name]" #define user_name_parameter_command "ubconfig --source global get [autoinstall] AUTOINSTALL[user_name]" @@ -120,7 +120,7 @@ NULL #define AUTOINSTALL_TYPE_INSTALL_command "ubconfig --source global get autoinstall AUTOINSTALL[install_type]" #define AUTOINSTALL_DEVICE_command "ubconfig --source global get autoinstall AUTOINSTALL[device]" -#define AUTOSTART_PARTS_command "ubconfig --source global get autoinstall AUTOINSTALL[part]" +#define part_parameter_command "ubconfig --source global get autoinstall AUTOINSTALL[part]" #define PASSWORD_DEFAULT "ublinux" @@ -155,8 +155,11 @@ enum YON_PAGES { YON_PAGE_OPTIONS_GRUB_INSTALL, YON_PAGE_OPTIONS_GRUB_UPDATE, YON_PAGE_OPTIONS_SEPARATE, + YON_PAGE_OPTIONS_SEPARATE_USRDATA, YON_PAGE_OPTIONS_OS_ONLY, - YON_PAGE_INSTALL_ERROR + YON_PAGE_OPTIONS_USRDATA_ONLY, + YON_PAGE_INSTALL_ERROR, + YON_PAGE_CONFIGURE_END }; typedef struct { @@ -182,6 +185,7 @@ typedef struct { GThread *config_save_thread; GThread *install_thread; guint progress_thread; + int configure_mode; } config; typedef struct { @@ -274,6 +278,7 @@ typedef struct { GtkWidget *GpartedNearButton; GtkWidget *GpartedSameButton; + GtkWidget *ConfigurationModeMenuItem; GtkWidget *AboutMenuItem; GtkWidget *DocumentationMenuItem; @@ -281,6 +286,33 @@ typedef struct { GtkWidget *CommonInstallationDevicesTree; GtkWidget *AdditionalSoftwareTree; + + GtkWidget *GrubInstallRadio; + GtkWidget *GrubUpdateRadio; + GtkWidget *SeparateRadio; + GtkWidget *OSRadio; + GtkWidget *UserDataOnlyRadio; + + GtkWidget *GpartedGrubInstallButton; + GtkWidget *GrubInstallDevicesTree; + + GtkWidget *GpartedGrubUpdateButton; + GtkWidget *GrubUpdateDevicesTree; + + GtkWidget *GpartedSeparateButton; + GtkWidget *SeparateDevicesTree; + GtkWidget *SeparateSysSectionTree; + GtkWidget *GpartedSeparateUserButton; + GtkWidget *SeparateUserDevicesTree; + GtkWidget *SeparateUserSysSectionTree; + + GtkWidget *GpartedOSButton; + GtkWidget *OSDevicesTree; + GtkWidget *OSSysSectionTree; + + GtkWidget *GpartedUserdataButton; + GtkWidget *UserdataDevicesTree; + GtkWidget *UserdataSysSectionTree; GtkTreeModel *LanguagesFilter; GtkTreeModel *LayoutsFilter; diff --git a/source/ubl-strings.h b/source/ubl-strings.h index 84a4a37..ab2ed2f 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -68,6 +68,19 @@ #define INSTALLATION_PARAMETERS_LABEL _("Installation parameters") +#define ADVANCED_INSTALLATION_HEAD_LABEL _("Advanced installation mode") +#define ADVANCED_INSTALLATION_LABEL _("Installing OS files, user data on different partitions, creating RAID, etc.") +#define ADVANCED_INSTALLATION_ATTENTION_LABEL _("Attention! The selected OC UBLinux components will be installed\nseparately into the selected partition.") +#define GRUB_INSTALL_HEAD_LABEL _("GRUB install") +#define GRUB_INSTALL_LABEL _("Install the GRUB bootloader") +#define GRUB_UPDATE_HEAD_LABEL _("GRUB update") +#define GRUN_UPDATE_LABEL _("Update (reinstall) the GRUB bootloader") +#define SEPARATE_INSTALL_HEAD_LABEL _("Separate installation") +#define SEPARATE_INSTALL_LABEL _("Installing OS components and user data on different disk partitions") +#define OS_ONLY_HEAD_LABEL _("OS only") +#define OS_ONLY_LABEL _("Installing only OS components without user data") +#define USER_DATA_HEAD_LABEL _("User data only") +#define USER_DATA_LABEL _("Installing only user data without OS components") #define KEYBOARD__LABEL _("Keyboard layout language") diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index 877c6dc..76dd6c9 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -1,6 +1,6 @@ - + @@ -81,6 +81,21 @@ False com.ublinux.libublsettingsui-gtk3.properties-symbolic + + True + False + com.ublinux.libublsettingsui-gtk3.properties-symbolic + + + True + False + com.ublinux.libublsettingsui-gtk3.properties-symbolic + + + True + False + com.ublinux.libublsettingsui-gtk3.properties-symbolic + True False @@ -91,11 +106,26 @@ False com.ublinux.libublsettingsui-gtk3.trash-symbolic + + True + False + com.ublinux.libublsettingsui-gtk3.properties-symbolic + + + True + False + com.ublinux.libublsettingsui-gtk3.properties-symbolic + True False com.ublinux.libublsettingsui-gtk3.properties-symbolic + + True + False + com.ublinux.libublsettingsui-gtk3.properties-symbolic + True False @@ -129,6 +159,14 @@ True False False + + + True + False + Configuration mode + True + + True @@ -867,6 +905,7 @@ and help you install UBLinux on your computer + True True False True @@ -880,7 +919,7 @@ and help you install UBLinux on your computer True False - gtk-missing-image + /com/ublinux/images/manual_install_disk.png False @@ -1097,6 +1136,9 @@ and help you install UBLinux on your computer True AdditionalSoftwareList 0 + + + Chosen @@ -1225,6 +1267,9 @@ and help you install UBLinux on your computer True AdditionalSoftwareList 0 + + + Chosen @@ -1875,6 +1920,9 @@ and help you install UBLinux on your computer True LayoutsFilter 0 + + + Layout @@ -2626,6 +2674,9 @@ or continue working in the UBLinux Live environment. True DevicesList 0 + + + Device @@ -3004,6 +3055,9 @@ installed. True DevicesList 0 + + + Device @@ -3105,6 +3159,9 @@ installed. True PartitionsList 0 + + + Section @@ -3559,6 +3616,9 @@ installed. True DevicesList 0 + + + Device @@ -3649,6 +3709,9 @@ installed. True PartitionsList 0 + + + Section @@ -3903,7 +3966,7 @@ installed. True False - gtk-missing-image + /com/ublinux/images/manual_install_disk.png False @@ -3921,7 +3984,7 @@ installed. True False - Additional installation options + Advanced installation mode 0 @@ -3937,7 +4000,7 @@ installed. True False - Separate installation of bootloader, system files, user data, etc. + Installing OS files, user data on different partitions, creating RAID, etc. 0 @@ -3988,7 +4051,7 @@ separately into the selected partition. vertical 5 - + True True False @@ -4021,7 +4084,7 @@ separately into the selected partition. True False - Installing GRUB + GRUB install 0 @@ -4064,12 +4127,13 @@ separately into the selected partition. - + True True False True True + GrubInstallRadio True @@ -4140,12 +4204,13 @@ separately into the selected partition. - + True True False True True + GrubInstallRadio True @@ -4216,12 +4281,13 @@ separately into the selected partition. - + True True False True True + GrubInstallRadio True @@ -4292,12 +4358,13 @@ separately into the selected partition. - + True True False True True + GrubInstallRadio True @@ -4394,7 +4461,7 @@ separately into the selected partition. True False - Install with more options + Advanced installation 15 @@ -4408,228 +4475,2070 @@ separately into the selected partition. vertical 5 - - True - False - Installation parameters - - - - - - - - False - True - 0 - - - - - - - - 16 - - - - - True - False - GRUB install - - - 16 - False - - - - - True - False - vertical - 5 - - - True - False - Installation parameters - - - - - - - - False - True - 0 - - - - - - - - - - - 17 - - - - - True - False - GRUB update - - - 17 - False - - - - - True - False - vertical - 5 - - - True - False - Installation parameters - - - - - - - - False - True - 0 - - - - - - - - 18 - - - - - True - False - Separate installation - - - 18 - False - - - - - True - False - vertical - 5 - - - True - False - Installation parameters - - - - - - - - False - True - 0 - - - - - - - - 19 - - - - - True - False - OS only - - - 19 - False - - - - - True - False - vertical - 5 - - - True - False - Installation error - - - - - - - - - False - True - 0 - - - - - False - - - False - True - 1 - - - - - True - False - end - Error - - - - - - - True - True - 2 - - - - + True False - start - Error has occured while installation process - center + vertical + 5 + + + True + False + Installation parameters + + + + + + + + False + True + 0 + + + + + True + True + + + True + False + + + True + False + vertical + 5 + + + True + False + vertical + 5 + + + True + False + 5 + + + True + False + /com/ublinux/images/clear_install_disk.png + + + False + True + 0 + + + + + True + False + vertical + 5 + + + True + False + GRUB install + 0 + + + + + + False + True + 0 + + + + + True + False + Install the GRUB bootloader + 0 + + + False + True + 1 + + + + + True + True + 1 + + + + + False + True + 0 + + + + + True + False + 5 + + + True + False + Select device: + 0 + + + False + True + 0 + + + + + True + True + True + image2 + + + + False + True + end + 1 + + + + + False + True + 1 + + + + + True + True + in + 128 + + + True + True + DevicesList + 0 + + + + + + Device + + + + 0 + + + + + + + Description + + + + 1 + + + + + + + Mark + + + + 2 + + + + + + + Size + + + + 3 + + + + + + + Free + + + + 4 + + + + + + + + + False + True + 2 + + + + + False + True + 0 + + + + + + + + + True + True + 1 + + + + + True + True + 1 + + + + + 16 + + + + + True + False + GRUB install + + + 16 + False + + + + + True + False + vertical + 5 + + + True + False + Installation parameters + + + + + + + + False + True + 0 + + + + + True + True + + + True + False + + + True + False + vertical + 5 + + + True + False + vertical + 5 + + + True + False + 5 + + + True + False + /com/ublinux/images/clear_install_disk.png + + + False + True + 0 + + + + + True + False + vertical + 5 + + + True + False + GRUB update + 0 + + + + + + False + True + 0 + + + + + True + False + Update (reinstall) the GRUB bootloader + 0 + + + False + True + 1 + + + + + True + True + 1 + + + + + False + True + 0 + + + + + True + False + 5 + + + True + False + Select device: + 0 + + + False + True + 0 + + + + + True + True + True + image3 + + + + False + True + end + 1 + + + + + False + True + 1 + + + + + True + True + in + 128 + + + True + True + DevicesList + 0 + + + + + + Device + + + + 0 + + + + + + + Description + + + + 1 + + + + + + + Mark + + + + 2 + + + + + + + Size + + + + 3 + + + + + + + Free + + + + 4 + + + + + + + + + False + True + 2 + + + + + False + True + 0 + + + + + + + + + True + True + 1 + + + + + 17 + + + + + True + False + GRUB update + + + 17 + False + + + + + True + False + vertical + 5 + + + True + False + Installation parameters + + + + + + + + False + True + 0 + + + + + True + True + + + True + False + + + True + False + vertical + 5 + + + True + False + vertical + 5 + + + True + False + 5 + + + True + False + /com/ublinux/images/clear_install_disk.png + + + False + True + 0 + + + + + True + False + vertical + 5 + + + True + False + Separate installation + 0 + + + + + + False + True + 0 + + + + + True + False + Installing OS components and user data on different disk partitions + 0 + + + False + True + 1 + + + + + True + True + 1 + + + + + False + True + 0 + + + + + True + False + 5 + + + True + False + Select device: + 0 + + + False + True + 0 + + + + + True + True + True + image4 + + + + False + True + end + 1 + + + + + False + True + 1 + + + + + True + True + in + 128 + + + True + True + DevicesList + 0 + + + + + + Device + + + + 0 + + + + + + + Description + + + + 1 + + + + + + + Mark + + + + 2 + + + + + + + Size + + + + 3 + + + + + + + Free + + + + 4 + + + + + + + + + False + True + 2 + + + + + False + True + 0 + + + + + True + False + vertical + + + True + False + Choose a section: + 0 + + + False + True + 0 + + + + + True + True + in + 128 + + + True + True + PartitionsList + 0 + + + + + + Section + + + + 0 + + + + + + + Capacity + + + + 1 + + + + + + + Free space + + + + 2 + + + + + + + File system + + + + 3 + + + + + + + Mark + + + + 4 + + + + + + + + + False + True + 1 + + + + + False + True + 1 + + + + + + + + + True + True + 1 + + + + + 18 + + + + + True + False + Separate installation + + + 18 + False + + + + + True + False + vertical + 5 + + + True + False + Installation parameters + + + + + + + + False + True + 0 + + + + + True + True + + + True + False + + + True + False + vertical + 5 + + + True + False + vertical + 5 + + + True + False + 5 + + + True + False + /com/ublinux/images/clear_install_disk.png + + + False + True + 0 + + + + + True + False + vertical + 5 + + + True + False + Separate installation + 0 + + + + + + False + True + 0 + + + + + True + False + Installing OS components and user data on different disk partitions + 0 + + + False + True + 1 + + + + + True + True + 1 + + + + + False + True + 0 + + + + + True + False + 5 + + + True + False + Select device: + 0 + + + False + True + 0 + + + + + True + True + True + image10 + + + + False + True + end + 1 + + + + + False + True + 1 + + + + + True + True + in + 128 + + + True + True + DevicesList + 0 + + + + + + Device + + + + 0 + + + + + + + Description + + + + 1 + + + + + + + Mark + + + + 2 + + + + + + + Size + + + + 3 + + + + + + + Free + + + + 4 + + + + + + + + + False + True + 2 + + + + + False + True + 0 + + + + + True + False + vertical + + + True + False + Choose a section: + 0 + + + False + True + 0 + + + + + True + True + in + 128 + + + True + True + PartitionsList + 0 + + + + + + Section + + + + 0 + + + + + + + Capacity + + + + 1 + + + + + + + Free space + + + + 2 + + + + + + + File system + + + + 3 + + + + + + + Mark + + + + 4 + + + + + + + + + False + True + 1 + + + + + False + True + 1 + + + + + + + + + True + True + 1 + + + + + 19 + + + + + True + False + Separate installation - userdata + + + 19 + False + + + + + True + False + vertical + 5 + + + True + False + Installation parameters + + + + + + + + False + True + 0 + + + + + True + True + + + True + False + + + True + False + vertical + 5 + + + True + False + vertical + 5 + + + True + False + 5 + + + True + False + /com/ublinux/images/clear_install_disk.png + + + False + True + 0 + + + + + True + False + vertical + 5 + + + True + False + Separate installation + 0 + + + + + + False + True + 0 + + + + + True + False + Installing OS components and user data on different disk partitions + 0 + + + False + True + 1 + + + + + True + True + 1 + + + + + False + True + 0 + + + + + True + False + 5 + + + True + False + Select device: + 0 + + + False + True + 0 + + + + + True + True + True + image11 + + + + False + True + end + 1 + + + + + False + True + 1 + + + + + True + True + in + 128 + + + True + True + DevicesList + 0 + + + + + + Device + + + + 0 + + + + + + + Description + + + + 1 + + + + + + + Mark + + + + 2 + + + + + + + Size + + + + 3 + + + + + + + Free + + + + 4 + + + + + + + + + False + True + 2 + + + + + False + True + 0 + + + + + True + False + vertical + + + True + False + Choose a section: + 0 + + + False + True + 0 + + + + + True + True + in + 128 + + + True + True + PartitionsList + 0 + + + + + + Section + + + + 0 + + + + + + + Capacity + + + + 1 + + + + + + + Free space + + + + 2 + + + + + + + File system + + + + 3 + + + + + + + Mark + + + + 4 + + + + + + + + + False + True + 1 + + + + + False + True + 1 + + + + + + + + + True + True + 1 + + + + + 20 + + + + + True + False + OS only + + + 20 + False + + + + + True + False + vertical + 5 + + + True + False + Installation parameters + + + + + + + + False + True + 0 + + + + + True + True + + + True + False + + + True + False + vertical + 5 + + + True + False + vertical + 5 + + + True + False + 5 + + + True + False + /com/ublinux/images/clear_install_disk.png + + + False + True + 0 + + + + + True + False + vertical + 5 + + + True + False + Separate installation + 0 + + + + + + False + True + 0 + + + + + True + False + Installing OS components and user data on different disk partitions + 0 + + + False + True + 1 + + + + + True + True + 1 + + + + + False + True + 0 + + + + + True + False + 5 + + + True + False + Select device: + 0 + + + False + True + 0 + + + + + True + True + True + image12 + + + + False + True + end + 1 + + + + + False + True + 1 + + + + + True + True + in + 128 + + + True + True + DevicesList + 0 + + + + + + Device + + + + 0 + + + + + + + Description + + + + 1 + + + + + + + Mark + + + + 2 + + + + + + + Size + + + + 3 + + + + + + + Free + + + + 4 + + + + + + + + + False + True + 2 + + + + + False + True + 0 + + + + + True + False + vertical + + + True + False + Choose a section: + 0 + + + False + True + 0 + + + + + True + True + in + 128 + + + True + True + PartitionsList + 0 + + + + + + Section + + + + 0 + + + + + + + Capacity + + + + 1 + + + + + + + Free space + + + + 2 + + + + + + + File system + + + + 3 + + + + + + + Mark + + + + 4 + + + + + + + + + False + True + 1 + + + + + False + True + 1 + + + + + + + + + True + True + 1 + + + + + 21 + + + + + True + False + User data only + + + 21 + False + + + + + True + False + vertical + 5 + + + True + False + Installation error + + + + + + + + + False + True + 0 + + + + + False + + + False + True + 1 + + + + + True + False + end + Error + + + + + + + True + True + 2 + + + + + True + False + start + Error has occured while installation process + center True @@ -4643,7 +6552,7 @@ separately into the selected partition. - 20 + 22 @@ -4653,7 +6562,177 @@ separately into the selected partition. Installation error - 20 + 22 + False + + + + + True + False + vertical + 5 + + + True + False + Configuration + + + + + + + + + False + True + 0 + + + + + False + + + False + True + 1 + + + + + True + False + end + Installer configuration has been finished + + + + + + + True + True + 2 + + + + + True + False + start + Choose a save option on the header bar + center + True + + + + + + True + True + 3 + + + + + 23 + + + + + True + False + Configuration ended + + + 23 + False + + + + + True + False + vertical + 5 + + + True + False + Configuration + + + + + + + + + False + True + 0 + + + + + False + + + False + True + 1 + + + + + True + False + end + Configuration has been saved + + + + + + + True + True + 2 + + + + + True + False + start + You can safely exit configurator or return and create new configuration file. + center + True + + + + + + True + True + 3 + + + + + 24 + + + + + True + False + Configuration saved + + + 24 False