diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index ff57779..60905b7 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -89,9 +89,15 @@ add_definitions(-DVTE_INCLUDE) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror -Wmissing-declarations -fdiagnostics-color=always \ -O2 -pipe -fno-plt -fexceptions \ - -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \ + -Wformat -Werror=format-security \ -fstack-clash-protection -fcf-protection") +string(FIND "${CMAKE_CXX_FLAGS}" "-D_FORTIFY_SOURCE" FORTIFY_FOUND) + +if(FORTIFY_FOUND EQUAL -1) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wp,-D_FORTIFY_SOURCE=2") +endif() + set(SOURCE_FILES ubinstall-gtk.c ubinstall-gtk.h diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 97cafcb..f4a9619 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -586,7 +586,14 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ yon_config_register(AUTOINSTALL_DEVICE,AUTOINSTALL_DEVICE_command,device); yon_config_register(AUTOSTART_PARTS,AUTOSTART_PARTS_command,part); 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 (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->NextInstallationFormatCheck))){ + yon_config_register(device_format_parameter,device_format_parameter_command,"no"); + yon_config_remove_by_key(part_type_parameter); + } else { + char *file_system_type = (char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(widgets->NextInstallationFilesystemTypeCombo)); + yon_config_register(part_type_parameter,part_type_parameter_command,file_system_type); + yon_config_remove_by_key(device_format_parameter); + } if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->NextInstallationFormatCheck))) yon_config_register(device_format_parameter,device_format_parameter_command,"no"); @@ -609,13 +616,7 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ yon_ubl_status_highlight_incorrect(gtk_widget_get_parent(widgets->CommonInstallationDevicesTree)); return; } - double part_size = gtk_spin_button_get_value(GTK_SPIN_BUTTON(widgets->SamePlaceSizeSpin)); - if (part_size){ - char *size_letter = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->SamePlaceSizeTypeSpin)); - char *size_final = yon_char_append(yon_char_from_long((long)part_size),size_letter); - yon_config_register(part_size_parameter,part_size_parameter_command,size_final); - } else yon_config_remove_by_key(part_size_parameter); - char *file_system_type = (char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(widgets->SameInstallationFilesystemTypeCombo)); + yon_config_remove_by_key(part_size_parameter); char *device_name = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->SameInstallationSectionNameEntry)); char *part; gtk_tree_model_get(model,&iter,0,&part,-1); @@ -623,9 +624,16 @@ void on_page_navigation_clicked(GtkWidget *self, main_window *widgets){ yon_config_register(AUTOINSTALL_DEVICE,AUTOINSTALL_DEVICE_command,device); yon_config_register(AUTOSTART_PARTS,AUTOSTART_PARTS_command,part); 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 (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->NextInstallationFormatCheck))) + + if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->SameInstallationFormatCheck))){ yon_config_register(device_format_parameter,device_format_parameter_command,"no"); + yon_config_remove_by_key(part_type_parameter); + } else { + char *file_system_type = (char*)gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(widgets->SameInstallationFilesystemTypeCombo)); + yon_config_register(part_type_parameter,part_type_parameter_command,file_system_type); + yon_config_remove_by_key(device_format_parameter); + } + gtk_notebook_set_current_page(GTK_NOTEBOOK(widgets->Notebook),YON_PAGE_INSTALLATION_BEGIN); }break; @@ -782,6 +790,7 @@ void on_region_changed(GtkComboBox *self, main_window *widgets){ for (int i=0;iZoneCombo),parsed[i],_(parsed[i])); } + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->ZoneCombo),0); } } @@ -836,10 +845,7 @@ void on_partition_changed(GtkWidget *self, main_window *widgets); void on_partition_changed(GtkWidget *self, main_window *widgets){ if (self==widgets->InstallationNearSysSectionTree) yon_set_max_size_from_partition(GTK_TREE_VIEW(widgets->InstallationNearSysSectionTree),GTK_SPIN_BUTTON(widgets->InstallationNearSizeSpin),GTK_COMBO_BOX(widgets->InstallationNearSizeTypeSpin)); - else if (self == widgets->SamePlacePartTree){ - yon_set_max_size_from_partition(GTK_TREE_VIEW(widgets->SamePlacePartTree),GTK_SPIN_BUTTON(widgets->SamePlaceSizeSpin),GTK_COMBO_BOX(widgets->SamePlaceSizeTypeSpin)); - - } + } void on_near_installation_device_changed(GtkWidget *self, main_window *widgets); @@ -922,8 +928,6 @@ void on_same_installation_device_changed(GtkWidget *, main_window *widgets){ json_object_object_get_ex(device, "vendor", &vendor); json_object_object_get_ex(device, "serial", &serial); - gtk_spin_button_set_value(GTK_SPIN_BUTTON(widgets->SamePlaceSizeSpin),0.0); - gtk_adjustment_set_upper(gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(widgets->SamePlaceSizeSpin)),0.0); gtk_list_store_append(widgets->PartitionsList,&iter); gtk_list_store_set(widgets->PartitionsList,&iter,0,json_object_get_string(path),1,json_object_get_string(model),2,json_object_get_string(serial),3,json_object_get_string(size),4,json_object_get_string(vendor),-1); } @@ -1009,8 +1013,6 @@ main_window *yon_main_window_complete(){ widgets->SamePlaceDeviceTree = yon_gtk_builder_get_widget(builder,"SamePlaceDeviceTree"); widgets->SamePlacePartTree = yon_gtk_builder_get_widget(builder,"SamePlacePartTree"); - widgets->SamePlaceSizeSpin = yon_gtk_builder_get_widget(builder,"SamePlaceSizeSpin"); - widgets->SamePlaceSizeTypeSpin = yon_gtk_builder_get_widget(builder,"SamePlaceSizeTypeSpin"); widgets->InstallationNearSysDevicesTree = yon_gtk_builder_get_widget(builder,"InstallationNearSysDevicesTree"); widgets->InstallationNearSysSectionTree = yon_gtk_builder_get_widget(builder,"InstallationNearSysSectionTree"); @@ -1077,6 +1079,9 @@ main_window *yon_main_window_complete(){ g_signal_connect(G_OBJECT(widgets->ManualLayoutRadio),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),gtk_widget_get_parent(gtk_widget_get_parent(widgets->AddButton))); g_signal_connect(G_OBJECT(widgets->AutoHostnameCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button_inversed),widgets->HotnameEntry); + + g_signal_connect(G_OBJECT(widgets->NextInstallationFormatCheck),"toggled",G_CALLBACK(yon_gtk_widget_set_sensitive_from_toggle_button),widgets->NextInstallationFilesystemTypeCombo); + 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); @@ -1129,6 +1134,7 @@ main_window *yon_main_window_complete(){ free(path); } } + gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->RegionCombo),0); yon_char_parsed_free(parsed,size); parsed = yon_config_load(get_layouts_command,&size); GtkTreeIter itar; diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 576b4c4..a567ad2 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -112,7 +112,7 @@ NULL #define save_config_command(parameters) yon_char_unite("pkexec bash -c 'ubconfig set [autoinstall] ",parameters, "; nice ubinstall2 --test --config /etc/ublinux/autoinstall'", NULL) -#define set_user_config_command(parameters) yon_char_unite("pkexec bash -c 'ubconfig --target system set [autoinstall] ",parameters,";nice ubinstall2 --autoconfig'",NULL) +#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" @@ -254,8 +254,6 @@ typedef struct { GtkWidget *SamePlaceDeviceTree; GtkWidget *SamePlacePartTree; - GtkWidget *SamePlaceSizeSpin; - GtkWidget *SamePlaceSizeTypeSpin; GtkWidget *InstallationProgress; GtkWidget *InstallationLabel; diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index 11c91f5..4555779 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -1356,6 +1356,7 @@ and help you install UBLinux on your computer True False + 10 5 @@ -2813,7 +2814,8 @@ installed. - + + True True True image36 @@ -3347,7 +3349,7 @@ installed. - + True True image1 @@ -3547,60 +3549,6 @@ installed. 1 - - - True - False - 5 - - - True - False - Specify the size of the new partition for UBLinux OS: - - - False - True - 0 - - - - - True - True - 0 - adjustment1 - - - False - True - 1 - - - - - True - False - 1 - - Mb - Gb - Tb - - - - False - True - 2 - - - - - False - True - 2 - - False