diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 5409958..fab9f97 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -1817,13 +1817,21 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ } char *cur_device; gtk_tree_model_get(model,&iter,0,&cur_device,-1); + if (!gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->GrubInstallPartitionTree)),&model,&iter)){ + yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),NO_DEVICE_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + yon_ubl_status_highlight_incorrect(gtk_widget_get_parent(widgets->GrubInstallPartitionTree)); + return; + } + char *partition; + gtk_tree_model_get(model,&iter,0,&partition,-1); yon_config_register(AUTOINSTALL_DEVICE,AUTOINSTALL_DEVICE_command,cur_device); + yon_config_register(part_parameter,part_parameter_command,partition); 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); + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_CONFIGURE_END); } break; @@ -1837,13 +1845,21 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ } char *cur_device; gtk_tree_model_get(model,&iter,0,&cur_device,-1); + if (!gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->GrubUpdatePartitionTree)),&model,&iter)){ + yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),NO_DEVICE_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + yon_ubl_status_highlight_incorrect(gtk_widget_get_parent(widgets->GrubUpdatePartitionTree)); + return; + } + char *partition; + gtk_tree_model_get(model,&iter,0,&partition,-1); yon_config_register(AUTOINSTALL_DEVICE,AUTOINSTALL_DEVICE_command,cur_device); + yon_config_register(part_parameter,part_parameter_command,partition); 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); + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_CONFIGURE_END); }break; case YON_PAGE_OPTIONS_SEPARATE:{ @@ -1939,7 +1955,15 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ break; case YON_PAGE_CONFIGURE_END:{ - gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_USERS); + if (main_config.install_mode==3&&(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->GrubInstallRadio))||gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->GrubUpdateRadio)))){ + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALL_OPTIONS); + gtk_widget_set_sensitive(widgets->BackButton,1); + gtk_widget_set_sensitive(widgets->NextButton,1); + gtk_widget_set_sensitive(widgets->CancelInstallButton,1); + + } else { //||gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->OSRadio))||gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->UserDataOnlyRadio)) + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_USERS); + } } break; case YON_PAGE_COMPLETED:{ @@ -2405,9 +2429,11 @@ main_window *yon_main_window_complete(){ widgets->GpartedGrubInstallButton = yon_gtk_builder_get_widget(builder,"GpartedGrubInstallButton"); widgets->GrubInstallDevicesTree = yon_gtk_builder_get_widget(builder,"GrubInstallDevicesTree"); + widgets->GrubInstallPartitionTree = yon_gtk_builder_get_widget(builder,"GrubInstallPartitionTree"); widgets->GpartedGrubUpdateButton = yon_gtk_builder_get_widget(builder,"GpartedGrubUpdateButton"); widgets->GrubUpdateDevicesTree = yon_gtk_builder_get_widget(builder,"GrubUpdateDevicesTree"); + widgets->GrubUpdatePartitionTree = yon_gtk_builder_get_widget(builder,"GrubUpdatePartitionTree"); widgets->GpartedSeparateButton = yon_gtk_builder_get_widget(builder,"GpartedSeparateButton"); widgets->SeparateDevicesTree = yon_gtk_builder_get_widget(builder,"SeparateDevicesTree"); @@ -2496,6 +2522,8 @@ main_window *yon_main_window_complete(){ g_signal_connect(G_OBJECT(widgets->AddButton),"clicked",G_CALLBACK(on_keyboard_clicked),widgets); g_signal_connect(G_OBJECT(widgets->RemoveButton),"clicked",G_CALLBACK(on_keyboard_removed),widgets); + g_signal_connect(G_OBJECT(widgets->GrubInstallDevicesTree),"cursor-changed",G_CALLBACK(on_separate_installation_changed),widgets); + g_signal_connect(G_OBJECT(widgets->GrubUpdateDevicesTree),"cursor-changed",G_CALLBACK(on_separate_installation_changed),widgets); 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->UserdataDevicesTree),"cursor-changed",G_CALLBACK(on_near_installation_device_changed),widgets); diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index b79da64..6deb980 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -337,9 +337,11 @@ typedef struct { GtkWidget *GpartedGrubInstallButton; GtkWidget *GrubInstallDevicesTree; + GtkWidget *GrubInstallPartitionTree; GtkWidget *GpartedGrubUpdateButton; GtkWidget *GrubUpdateDevicesTree; + GtkWidget *GrubUpdatePartitionTree; GtkWidget *GpartedSeparateButton; GtkWidget *SeparateDevicesTree; diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index eb2f302..27f6c66 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -5156,6 +5156,110 @@ separately into the selected partition. 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 + + @@ -5427,6 +5531,110 @@ separately into the selected partition. 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 + +