Fixed GRUB install and GRUB update installation

pull/74/head
parent 61ddb71578
commit 24d0188208

@ -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);

@ -337,9 +337,11 @@ typedef struct {
GtkWidget *GpartedGrubInstallButton;
GtkWidget *GrubInstallDevicesTree;
GtkWidget *GrubInstallPartitionTree;
GtkWidget *GpartedGrubUpdateButton;
GtkWidget *GrubUpdateDevicesTree;
GtkWidget *GrubUpdatePartitionTree;
GtkWidget *GpartedSeparateButton;
GtkWidget *SeparateDevicesTree;

@ -5156,6 +5156,110 @@ separately into the selected partition.</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Choose a section:</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<property name="min-content-height">128</property>
<child>
<object class="GtkTreeView" id="GrubInstallPartitionTree">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="model">PartitionsList</property>
<property name="search-column">0</property>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Section</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Capacity</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Free space</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">2</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">File system</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">3</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Mark</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">4</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>
@ -5427,6 +5531,110 @@ separately into the selected partition.</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Choose a section:</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="shadow-type">in</property>
<property name="min-content-height">128</property>
<child>
<object class="GtkTreeView" id="GrubUpdatePartitionTree">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="model">PartitionsList</property>
<property name="search-column">0</property>
<child internal-child="selection">
<object class="GtkTreeSelection"/>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Section</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">0</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Capacity</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Free space</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">2</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">File system</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">3</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn">
<property name="title" translatable="yes">Mark</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">4</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</object>

Loading…
Cancel
Save