diff --git a/locale/ubinstall-gtk.pot b/locale/ubinstall-gtk.pot index 8aa54a8..8014d98 100644 --- a/locale/ubinstall-gtk.pot +++ b/locale/ubinstall-gtk.pot @@ -1874,6 +1874,30 @@ msgstr "" msgid "Reboot" msgstr "" +#: source/ubl-strings.h:543 +msgid "Invalid devices parity. Needed:" +msgstr "" + +#: source/ubl-strings.h:543 +msgid "Invalid devices chosen. Needed:" +msgstr "" + +#: source/ubl-strings.h:543 +msgid "The size of the new partition exceeds the free space of the selected partition" +msgstr "" + +#: source/ubl-strings.h:543 +msgid "The size of the new disk partition is larger than the size of the selected partition" +msgstr "" + +#: source/ubl-strings.h:543 +msgid "There is not enough space to install modules" +msgstr "" + +#: source/ubl-strings.h:543 +msgid "There is not enough space to install packages" +msgstr "" + #: source/ubl-strings.h:543 msgid "Shudown" msgstr "" diff --git a/locale/ubinstall-gtk_ru.po b/locale/ubinstall-gtk_ru.po index 07a08ca..e6268b4 100644 --- a/locale/ubinstall-gtk_ru.po +++ b/locale/ubinstall-gtk_ru.po @@ -1865,6 +1865,30 @@ msgstr "" msgid "Reboot" msgstr "Перезагрузить" +#: source/ubl-strings.h:543 +msgid "Invalid devices parity. Needed:" +msgstr "Неверная проверка четности устройств. Требуется:" + +#: source/ubl-strings.h:543 +msgid "Invalid devices chosen. Needed:" +msgstr "Выбраны недействительные устройства. Требуется:" + +#: source/ubl-strings.h:543 +msgid "The size of the new partition exceeds the free space of the selected partition" +msgstr "Размер нового раздела превышает свободное место выбранного раздела" + +#: source/ubl-strings.h:543 +msgid "The size of the new disk partition is larger than the size of the selected partition" +msgstr "Размер нового раздела диска превышает размер выбранного раздела" + +#: source/ubl-strings.h:543 +msgid "There is not enough space to install modules" +msgstr "Недостаточно места для установки модулей" + +#: source/ubl-strings.h:543 +msgid "There is not enough space to install packages" +msgstr "Недостаточно места для установки пакетов" + #: source/ubl-strings.h:543 msgid "Shudown" msgstr "Выключить" diff --git a/locale/vfs-list.pot b/locale/vfs-list.pot new file mode 100644 index 0000000..53ea2fc --- /dev/null +++ b/locale/vfs-list.pot @@ -0,0 +1,23 @@ +msgid "RAID 0 (Striping). Combines two or more drives to increase read/write speed. Failure of one disk leads to a complete loss of all data." +msgstr "" + +msgid "RAID 1 (Mirroring). Data is written identically to two or more drives." +msgstr "" + +msgid "RAID 4 (Striping with dedicated parity). It uses block striping of data across multiple disks and a dedicated parity disk to ensure fault tolerance." +msgstr "" + +msgid "RAID 5 (Striping with distributed parity). Data striping with a checksum distributed over all disks (parity). It allows you to survive a single disk failure without data loss, but requires at least 3 disks and suffers from slower writes." +msgstr "" + +msgid "RAID 6 (Striping with double distributed parity). It provides high fault tolerance, allowing you to survive the simultaneous failure of two disks by using two independent parity schemes (P and Q) distributed across all disks." +msgstr "" + +msgid "RAID 1+0 (Striping from of mirrored drives). Combines mirroring (RAID 1) for reliability and interleaving (RAID 0) for performance. It requires at least 4 disks (an even number), creating mirrored pairs (RAID 1), which are then combined into a single array using striping (RAID 0)." +msgstr "" + +msgid "LVM (Logical Volume Manager). Allows you to flexibly combine multiple disks or partitions into shared pools (volume groups, VG) and create logical volumes (LV) from them." +msgstr "" + +msgid "LVM DYNAMIC (Logical Volume Manager DYNAMIC). Allows you to flexibly dynamically combine multiple disks or partitions into shared pools (volume groups, VG) and dynamically create logical volumes (LV) from them." +msgstr "" diff --git a/locale/vfs-list_ru.po b/locale/vfs-list_ru.po new file mode 100644 index 0000000..af6b18a --- /dev/null +++ b/locale/vfs-list_ru.po @@ -0,0 +1,42 @@ +# Language translations for ubinstal package. +# Copyright (C) 2022, UBTech LLC +# This file is distributed under the same license as the ubinstal package. +# UBLinux Team , 2022 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: ubinstal 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2023-05-22 16:12+0600\n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "RAID 0 (Striping). Combines two or more drives to increase read/write speed. Failure of one disk leads to a complete loss of all data." +msgstr "RAID 0 (чередование). Объединяет два или более дисков для увеличения скорости чтения/записи. Выход из строя одного диска приводит к полной потере всех данных." + +msgid "RAID 1 (Mirroring). Data is written identically to two or more drives." +msgstr "RAID 1 (зеркалирование). Данные записываются идентично на два или более дисков." + +msgid "RAID 4 (Striping with dedicated parity). It uses block striping of data across multiple disks and a dedicated parity disk to ensure fault tolerance." +msgstr "RAID 4 (чередование с выделенным контролем четности). Использует блочное чередование данных по нескольким дискам и выделенный диск контроля четности для обеспечения отказоустойчивости." + +msgid "RAID 5 (Striping with distributed parity). Data striping with a checksum distributed over all disks (parity). It allows you to survive a single disk failure without data loss, but requires at least 3 disks and suffers from slower writes." +msgstr "RAID 5 (чередование с распределенным контролем четности). Чередование данных с контрольной суммой, распределенной по всем дискам (контроль четности). Позволяет пережить отказ одного диска без потери данных, но требует как минимум 3 дисков и имеет более низкую скорость записи." + +msgid "RAID 6 (Striping with double distributed parity). It provides high fault tolerance, allowing you to survive the simultaneous failure of two disks by using two independent parity schemes (P and Q) distributed across all disks." +msgstr "RAID 6 (чередование с двойным распределенным контролем четности). Обеспечивает высокую отказоустойчивость, позволяя пережить одновременный отказ двух дисков за счет использования двух независимых схем контроля четности (P и Q), распределенных по всем дискам." + +msgid "RAID 1+0 (Striping from of mirrored drives). Combines mirroring (RAID 1) for reliability and interleaving (RAID 0) for performance. It requires at least 4 disks (an even number), creating mirrored pairs (RAID 1), which are then combined into a single array using striping (RAID 0)." +msgstr "RAID 1+0 (чередование из зеркалированных дисков). Сочетает зеркалирование (RAID 1) для надежности и чередование (RAID 0) для повышения производительности. Требует как минимум 4 дисков (четное число), создавая зеркальные пары (RAID 1), которые затем объединяются в один массив с использованием чередования (RAID 0)." + +msgid "LVM (Logical Volume Manager). Allows you to flexibly combine multiple disks or partitions into shared pools (volume groups, VG) and create logical volumes (LV) from them." +msgstr "LVM (Logical Volume Manager). Позволяет гибко объединять несколько дисков или разделов в общие пулы (группы томов, VG) и создавать из них логические тома (LV)." + +msgid "LVM DYNAMIC (Logical Volume Manager DYNAMIC). Allows you to flexibly dynamically combine multiple disks or partitions into shared pools (volume groups, VG) and dynamically create logical volumes (LV) from them." +msgstr "LVM DYNAMIC (Logical Volume Manager DYNAMIC). Позволяет гибко динамически объединять несколько дисков или разделов в общие пулы (группы томов, VG) и динамически создавать из них логические тома (LV)." diff --git a/source/ubinstall-gtk-advanced.c b/source/ubinstall-gtk-advanced.c index c7859c2..ee838ac 100644 --- a/source/ubinstall-gtk-advanced.c +++ b/source/ubinstall-gtk-advanced.c @@ -116,7 +116,7 @@ void yon_advanced_partition_set_from_section(advanced_partition *part, advanced_ if (!yon_char_is_empty(part->part)) part->part_type = ADVANCED_PART_NEW; else part->part_type = ADVANCED_PART_EXISTING; if (section->format){ - gtk_switch_set_active(GTK_SWITCH(part->FormatCombo),1); + gtk_combo_box_set_active(GTK_COMBO_BOX(part->FormatCombo),section->format); if (section->size){ gtk_spin_button_set_value(GTK_SPIN_BUTTON(part->SizeSpin),section->size); gtk_combo_box_set_active(GTK_COMBO_BOX(part->SizeCombo),yon_get_size_get_from_letter(section->size_letter)-1); @@ -147,7 +147,7 @@ void yon_advanced_update(main_window *widgets){ g_signal_connect(G_OBJECT(part->RemoveButton),"clicked",G_CALLBACK(on_advanced_part_remove),widgets); g_signal_connect(G_OBJECT(part->SystemSectionToggle),"clicked",G_CALLBACK(on_advanced_section_toggled),widgets); g_signal_connect(G_OBJECT(part->UserDataSectionToggle),"clicked",G_CALLBACK(on_advanced_section_toggled),widgets); - g_signal_connect(G_OBJECT(part->SizeCombo),"changed",G_CALLBACK(on_advanced_size_changed),widgets); + // g_signal_connect(G_OBJECT(part->SizeCombo),"changed",G_CALLBACK(on_advanced_size_changed),widgets); if (i==0){ gtk_widget_set_sensitive(part->SystemSectionToggle,0); gtk_widget_set_sensitive(part->UserDataSectionToggle,0); @@ -157,7 +157,7 @@ void yon_advanced_update(main_window *widgets){ gtk_image_set_from_icon_name(GTK_IMAGE(UserImage),toggled_icon_name,GTK_ICON_SIZE_BUTTON); } yon_advanced_partition_set_from_section(part,sections[i]); - yon_advanced_set_max_size_from_partition(part,widgets); + // yon_advanced_set_max_size_from_partition(part,widgets); gtk_box_pack_start(GTK_BOX(widgets->AdvancedPartitionAddBox),part->MainBox,0,0,0); g_signal_handlers_block_by_func(G_OBJECT(widgets->AdvancedVirtualDeviceCombo),G_CALLBACK(on_advanced_virtual_device_changed),widgets); if (!virtual_found&>k_combo_box_set_active_id(GTK_COMBO_BOX(widgets->AdvancedVirtualDeviceCombo),sections[i]->part_source==PART_SOURCE_PART?sections[i]->partition:sections[i]->device)){ @@ -191,9 +191,10 @@ void yon_advanced_update(main_window *widgets){ } void on_advanced_partition_create(GtkWidget *, main_window *widgets){ - GtkTreeIter iter, *last_unvalid = NULL; int found = 0; - for_iter(GTK_TREE_MODEL(widgets->DevicesList),&iter){ + GtkTreeIter iter, *last_unvalid = NULL; + GtkTreeModel *model; + if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(widgets->AdvancedDeviceTree)),&model,&iter)){ char *target; int active; gtk_tree_model_get(GTK_TREE_MODEL(widgets->DevicesList),&iter,0,&target,5,&active,-1); @@ -202,16 +203,16 @@ void on_advanced_partition_create(GtkWidget *, main_window *widgets){ last_unvalid = gtk_tree_iter_copy(&iter); } else { found=1; - if (sections_size==2) break; + if (sections_size==2) return; advanced_section *section = yon_advanced_section_new(); section->part_source = PART_SOURCE_DEVICE; section->device = target; section->partition = NULL; sections[sections_size]=section; sections_size++; - break; } } + } if (!found&&last_unvalid){ char *target; @@ -253,6 +254,7 @@ void on_advanced_partition_add(GtkWidget *, char *path, main_window *widgets){ } void yon_install_advanced_init(main_window *widgets){ + g_signal_handlers_block_by_func(G_OBJECT(widgets->AdvancedVirtualDeviceCombo),G_CALLBACK(on_advanced_virtual_device_changed),widgets); gtk_combo_box_text_remove_all(GTK_COMBO_BOX_TEXT(widgets->AdvancedVirtualDeviceCombo)); gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(widgets->AdvancedVirtualDeviceCombo),NO_LABEL); gtk_combo_box_set_active(GTK_COMBO_BOX(widgets->AdvancedVirtualDeviceCombo),0); @@ -265,6 +267,7 @@ void yon_install_advanced_init(main_window *widgets){ yon_char_parsed_free(parsed,parsed_size); } yon_char_parsed_free(vmf_file,size); + g_signal_handlers_unblock_by_func(G_OBJECT(widgets->AdvancedVirtualDeviceCombo),G_CALLBACK(on_advanced_virtual_device_changed),widgets); } void on_install_advanced_partition_chosen(GtkCellRenderer*, gchar *path, main_window *widgets){ @@ -277,22 +280,24 @@ void on_install_advanced_partition_chosen(GtkCellRenderer*, gchar *path, main_wi gtk_tree_model_get_iter_from_string(model,&iter,path); int status; char *target_part, *device; - gtk_tree_model_get(model,&iter,0,&target_part,7,&status,9,&device,-1); + gulong part_size; + gtk_tree_model_get(model,&iter,0,&target_part,5,&part_size,7,&status,9,&device,-1); if (!status){ if (chosen<2){ - gtk_list_store_set(widgets->PartitionsList,&iter,7,!status,-1); + gtk_list_store_set(widgets->PartitionsList,&iter,7,1,-1); chosen++; advanced_section *section = yon_advanced_section_new(); section->part_source = PART_SOURCE_PART; section->partition = target_part; section->device = NULL; + section->full_part_size = part_size; sections[sections_size]=section; sections_size++; } } else { - gtk_list_store_set(widgets->PartitionsList,&iter,7,!status,-1); yon_advanced_section_remove_by_name(target_part); + gtk_list_store_set(widgets->PartitionsList,&iter,7,0,-1); } yon_advanced_update(widgets); } @@ -387,9 +392,9 @@ void yon_advanced_set_max_size_from_partition(advanced_partition *part, main_win } } -void on_advanced_size_changed(GtkWidget *self,main_window *widgets){ - advanced_partition *part = g_object_get_data(G_OBJECT(self),"advanced_partition"); - yon_advanced_set_max_size_from_partition(part,widgets); +void on_advanced_size_changed(GtkWidget *,main_window *){ + // advanced_partition *part = g_object_get_data(G_OBJECT(self),"advanced_partition"); + // yon_advanced_set_max_size_from_partition(part,widgets); } void on_install_advanced_device_chosen(GtkCellRenderer *, gchar *path, main_window *widgets){ @@ -419,7 +424,7 @@ void on_install_advanced_device_chosen(GtkCellRenderer *, gchar *path, main_wind gtk_tree_model_get(model,&iter,5,&status,-1); if (status)chosen_amount++; } - gtk_widget_set_sensitive(widgets->AdvancedVirtualDeviceCombo,chosen_amount>=2); + // gtk_widget_set_sensitive(widgets->AdvancedVirtualDeviceCombo,chosen_amount>=2); // if (chosen) gtk_widget_set_sensitive(widgets->AdvancedAddButton,1); // else gtk_widget_set_sensitive(widgets->AdvancedAddButton,0); yon_advanced_parts_update(widgets); @@ -517,9 +522,57 @@ int yon_advanced_save(main_window *widgets){ char *encryption[2] = {NULL}; char *format[2] = {NULL}; if (!sections_size){ + yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),NOTHING_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); return 0; } advanced_section *cur_section = sections[0]->sys_section?sections[0]:sections[1]; + if (cur_section->part_source == PART_SOURCE_VIRTUAL){ + + char *device = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->AdvancedVirtualDeviceCombo)); + int size; + config_str vfs_file = yon_resource_open_file(vfs_list_path,&size); + config_str cur_device = NULL; + for (int i=0;iDevicesList); + int active_devices=0; + for_iter(model,&iter){ + int status; + gtk_tree_model_get(model,&iter,5,&status,-1); + if (status) active_devices++; + } + if (atoi(cur_device[3])>active_devices){ + yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),COUNT_INVALID_LABEL(cur_device[3]),5,BACKGROUND_IMAGE_INFO_TYPE); + yon_ubl_status_highlight_incorrect(widgets->AdvancedVirtualDeviceCombo); + yon_char_parsed_free(cur_device,4); + return 0; + } + + if (atoi(cur_device[4])%active_devices!=0){ + yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),PARITY_INVALID_LABEL(cur_device[4]),5,BACKGROUND_IMAGE_INFO_TYPE); + yon_ubl_status_highlight_incorrect(widgets->AdvancedVirtualDeviceCombo); + yon_char_parsed_free(cur_device,4); + return 0; + } + } + } + + if (cur_section->format==2){ + format[0]="yes"; + } else if (cur_section->format == 1){ + format[0]="no"; + } else { + format[0]=NULL; + } if (!yon_char_is_empty(cur_section->partition)){ if (!yon_char_is_empty(cur_section->partition)){ parts[0]=cur_section->partition; @@ -540,60 +593,64 @@ int yon_advanced_save(main_window *widgets){ devices[1]=cur_section->device; } } - if (cur_section->size){ - char *size_str = yon_char_from_long(cur_section->size); - char *sz_str = yon_char_append_c(size_str,cur_section->size_letter); - part_size[0]=sz_str; - } - if (!yon_char_is_empty(cur_section->part_label)){ - part_label[0]=cur_section->part_label; - } - if (!yon_char_is_empty(cur_section->fs_type)){ - fs_type[0]=cur_section->fs_type; - } - if (!yon_char_is_empty(cur_section->fs_label)){ - fs_label[0]=cur_section->fs_label; - } - if (cur_section->format){ - format[0]="yes"; - } else { - format[0]="no"; - } - if (!yon_char_is_empty(cur_section->encryption)){ - char *encrypt_str = yon_char_unite(cur_section->encryption,":",cur_section->encryption_password,NULL); - encryption[0]=encrypt_str; - } - if (sections_size>1){ - cur_section = sections[0]->sys_section?sections[1]:sections[0]; - devices[1]=cur_section->device; - if (!yon_char_is_empty(cur_section->partition)){ - parts[1]=cur_section->partition; - } else { - parts[1]=""; - } - if (cur_section->size){ + if (cur_section->format==2){ + if (cur_section->size&&yon_size_long_convert_to_mod(cur_section->full_part_size,cur_section->size_letter)>cur_section->size){ + char *size_str = yon_char_from_long(cur_section->size); char *sz_str = yon_char_append_c(size_str,cur_section->size_letter); - part_size[1]=sz_str; + part_size[0]=sz_str; + } else { + yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),NOT_ENOUGH_SPACE_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE); + return 0; } if (!yon_char_is_empty(cur_section->part_label)){ - part_label[1]=cur_section->part_label; + part_label[0]=cur_section->part_label; } if (!yon_char_is_empty(cur_section->fs_type)){ - fs_type[1]=cur_section->fs_type; + fs_type[0]=cur_section->fs_type; } if (!yon_char_is_empty(cur_section->fs_label)){ - fs_label[1]=cur_section->fs_label; + fs_label[0]=cur_section->fs_label; } - if (cur_section->format){ + } + if (sections_size>1){ + cur_section = sections[0]->sys_section?sections[1]:sections[0]; + + if (cur_section->format==2){ format[1]="yes"; - } else { + } else if (cur_section->format==1){ format[1]="no"; + } else { + format[1] = NULL; } - if (!yon_char_is_empty(cur_section->encryption)){ - char *encrypt_str = yon_char_unite(cur_section->encryption,":",cur_section->encryption_password,NULL); - encryption[1]=encrypt_str; + + devices[1]=cur_section->device; + if (!yon_char_is_empty(cur_section->partition)){ + parts[1]=cur_section->partition; + } else { + parts[1]=""; + } + + if (cur_section->format==2){ + if (cur_section->size){ + char *size_str = yon_char_from_long(cur_section->size); + char *sz_str = yon_char_append_c(size_str,cur_section->size_letter); + part_size[1]=sz_str; + } + if (!yon_char_is_empty(cur_section->part_label)){ + part_label[1]=cur_section->part_label; + } + if (!yon_char_is_empty(cur_section->fs_type)){ + fs_type[1]=cur_section->fs_type; + } + if (!yon_char_is_empty(cur_section->fs_label)){ + fs_label[1]=cur_section->fs_label; + } + if (!yon_char_is_empty(cur_section->encryption)){ + char *encrypt_str = yon_char_unite(cur_section->encryption,":",cur_section->encryption_password,NULL); + encryption[1]=encrypt_str; + } } } @@ -731,6 +788,7 @@ void on_format_changed(GtkWidget *self, advanced_partition *part){ advanced_partition *yon_advanced_partition_new(){ advanced_partition *part = new(advanced_partition); GtkBuilder *builder = gtk_builder_new_from_resource(glade_path_advanced_part); + yon_scroll_block_for_builder(builder); part->MainBox = yon_gtk_builder_get_widget(builder,"MainBox"); part->SectionLabel = yon_gtk_builder_get_widget(builder,"SectionLabel"); part->SystemSectionToggle = yon_gtk_builder_get_widget(builder,"SystemSectionToggle"); @@ -813,14 +871,16 @@ void on_advanced_virtual_device_changed(GtkWidget *, main_window *widgets){ char *device = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->AdvancedVirtualDeviceCombo)); int size; config_str vfs_file = yon_resource_open_file(vfs_list_path,&size); - config_str cur_device = NULL; for (int i=0;iAdvancedVirtualDeviceLabel),parsed[1]); + if (!yon_char_is_empty(device)&&!yon_char_is_empty(parsed[2])&&!strcmp(parsed[2],device)){ + gtk_label_set_text(GTK_LABEL(widgets->AdvancedVirtualDeviceLabel),_(parsed[1])); + gtk_widget_show(gtk_widget_get_parent(widgets->AdvancedVirtualDeviceLabel)); + yon_char_parsed_free(parsed,parsed_size); + break; } else { + gtk_widget_hide(gtk_widget_get_parent(widgets->AdvancedVirtualDeviceLabel)); yon_char_parsed_free(parsed,parsed_size); } } @@ -833,19 +893,6 @@ void on_advanced_virtual_device_changed(GtkWidget *, main_window *widgets){ gtk_tree_model_get(model,&iter,5,&status,-1); if (status) active_devices++; } - if (atoi(cur_device[3])>active_devices){ - yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),COUNT_INVALID_LABEL(cur_device[3]),5,BACKGROUND_IMAGE_INFO_TYPE); - yon_ubl_status_highlight_incorrect(widgets->AdvancedVirtualDeviceCombo); - yon_char_parsed_free(cur_device,4); - return; - } - - if (atoi(cur_device[4])%active_devices!=0){ - yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),PARITY_INVALID_LABEL(cur_device[4]),5,BACKGROUND_IMAGE_INFO_TYPE); - yon_ubl_status_highlight_incorrect(widgets->AdvancedVirtualDeviceCombo); - yon_char_parsed_free(cur_device,4); - return; - } advanced_section *section = yon_advanced_section_new(); section->part_source = PART_SOURCE_VIRTUAL; diff --git a/source/ubinstall-gtk-components.c b/source/ubinstall-gtk-components.c index b730643..a74bd29 100644 --- a/source/ubinstall-gtk-components.c +++ b/source/ubinstall-gtk-components.c @@ -164,6 +164,9 @@ void *yon_modules_list_load(main_window *widgets){ g_idle_add((GSourceFunc)yon_os_component_insert,row); } g_idle_add((GSourceFunc)yon_spinner_switch_off,widgets->OSSpinner); + if (main_config.modules_size) yon_char_parsed_free(main_config.modules,main_config.modules_size); + main_config.modules = modules; + main_config.modules_size = size; g_thread_exit(NULL); } diff --git a/source/ubinstall-gtk-config-hub.c b/source/ubinstall-gtk-config-hub.c index 6843526..9920f73 100644 --- a/source/ubinstall-gtk-config-hub.c +++ b/source/ubinstall-gtk-config-hub.c @@ -2,8 +2,8 @@ config_str yon_os_components_get_modules(int *size){ (*size) = 0; - int modules_size = main_config.devices_size; - config_str modules_list = main_config.devices; + int modules_size = main_config.modules_size; + config_str modules_list = main_config.modules; config_str module_names = NULL; for (int i=1;iDevicesList,&iter){ + char *target; + long disk_size; + gtk_tree_model_get(GTK_TREE_MODEL(widgets->DevicesList),&iter,0,&target,7,&disk_size,-1); + if (!strcmp(device,target)){ + part_size = disk_size; + } + } + } else if (!strcmp(install_mode,"advanced")) { char *part = config(part_parameter); + part = yon_char_new(part); + char *sys_part = yon_char_divide_search(part,",",-1); + free(part); + part = sys_part; for (int i=0;iDevicesList,&iter){ - char *target; - long disk_size; - gtk_tree_model_get(GTK_TREE_MODEL(widgets->DevicesList),&iter,0,&target,7,&disk_size,-1); - if (!strcmp(device,target)){ - part_size = disk_size; + char *part = config(part_parameter); + for (int i=0;i3&&!yon_char_is_empty(parsed[3])){ + part_size = atol(parsed[3]); + + yon_char_parsed_free(parsed,parsed_size); + break; } + yon_char_parsed_free(parsed,parsed_size); } } long packages_size = 0; diff --git a/source/ubinstall-gtk-configuration-mode.c b/source/ubinstall-gtk-configuration-mode.c index f4c1f06..7fc9e84 100644 --- a/source/ubinstall-gtk-configuration-mode.c +++ b/source/ubinstall-gtk-configuration-mode.c @@ -30,6 +30,8 @@ int yon_configuration_path_check(const char *path){ struct passwd *user = getpwnam(yon_ubl_root_user_get()); if (chown(full_path,user->pw_uid,user->pw_gid)){}; + } else { + return 0; } } main_config.config_load_path = full_path; @@ -45,9 +47,13 @@ void configuration_mode_accept(GtkWidget *,configuration_window *window){ yon_ubl_status_highlight_incorrect(window->PathEntry); return; } - yon_configuration_path_check(path); - - gtk_widget_destroy(window->Window); + main_window *widgets = g_object_get_data(G_OBJECT(window->Window),"widgets"); + if (yon_configuration_path_check(path)){ + gtk_widget_destroy(window->Window); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->ConfigurationModeCheck),1); + } else { + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->ConfigurationModeCheck),0); + } } void on_path_choose(GtkWidget *,configuration_window *window){ @@ -62,25 +68,15 @@ void on_path_choose(GtkWidget *,configuration_window *window){ void on_configuration_exit(GtkWidget *,configuration_window *window){ main_window *widgets = g_object_get_data(G_OBJECT(window->Window),"widgets"); - GList *box = gtk_container_get_children(GTK_CONTAINER(widgets->ConfigurationModeMenuItem)); - GList *children = gtk_container_get_children(GTK_CONTAINER(box->data)); - GtkWidget *Check = GTK_WIDGET(g_list_nth_data(children,1)); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(Check),0); - g_list_free(box); - g_list_free(children); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widgets->ConfigurationModeCheck),0); gtk_widget_destroy(window->Window); if (getuid()){ gtk_main_quit(); } } -void on_configuration_mode_switch(GtkWidget *self,main_window *widgets){ - - GList *box = gtk_container_get_children(GTK_CONTAINER(self)); - GList *children = gtk_container_get_children(GTK_CONTAINER(box->data)); - - GtkWidget *Check = GTK_WIDGET(g_list_nth_data(children,0)); - int active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(Check)); +void on_configuration_mode_switch(GtkWidget *,main_window *widgets){ + int active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widgets->ConfigurationModeCheck)); if (!active){ GtkBuilder *builder = gtk_builder_new_from_resource(glade_path_configuration_mode); configuration_window *window = malloc(sizeof(configuration_window)); @@ -94,11 +90,12 @@ void on_configuration_mode_switch(GtkWidget *self,main_window *widgets){ g_signal_connect(G_OBJECT(window->CancelButton),"clicked",G_CALLBACK(on_configuration_exit),window); g_signal_connect(G_OBJECT(window->Window),"destroy",G_CALLBACK(gtk_main_quit),NULL); g_signal_connect(G_OBJECT(window->ChooseButton),"clicked",G_CALLBACK(configuration_mode_accept),window); + g_object_set_data(G_OBJECT(window->Window),"widgets",widgets); g_signal_connect(G_OBJECT(window->PathButton),"clicked",G_CALLBACK(on_path_choose),window); g_object_set_data(G_OBJECT(window->Window),"widgets",widgets); yon_gtk_window_setup(GTK_WINDOW(window->Window),GTK_WINDOW(widgets->MainWindow),CONFIGURATION_MODE_TITLE_LABEL,icon_path,"configuration_window"); if (getuid()){ - yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(window->StatusBox),"force_configure_mode",ROOT_FORCE_CONFIGURATION_MODE_LABEL,BACKGROUND_IMAGE_INFO_TYPE); + yon_ubl_status_box_spawn(GTK_CONTAINER(window->StatusBox),ROOT_FORCE_CONFIGURATION_MODE_LABEL,0,BACKGROUND_IMAGE_INFO_TYPE); } if (!yon_char_is_empty(main_config.config_save_path)) gtk_entry_set_text(GTK_ENTRY(window->PathEntry),main_config.config_save_path); @@ -106,8 +103,8 @@ void on_configuration_mode_switch(GtkWidget *self,main_window *widgets){ gtk_main(); if (main_config.config_save_path){ - yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(widgets->StatusBox),"config_mode",CONFIGURATION_MODE_STATUS_LABEL,BACKGROUND_IMAGE_INFO_TYPE); - yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(widgets->StatusBox2),"config_mede",CONFIG_PATH_LABEL(main_config.config_save_path),BACKGROUND_IMAGE_INFO_TYPE); + yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),CONFIGURATION_MODE_STATUS_LABEL,0,BACKGROUND_IMAGE_INFO_TYPE); + yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox2),CONFIG_PATH_LABEL(main_config.config_save_path),0,BACKGROUND_IMAGE_INFO_TYPE); GList *revealerlist = gtk_container_get_children(GTK_CONTAINER(widgets->StatusBox2)); GList *list = gtk_container_get_children(GTK_CONTAINER(g_list_nth_data(revealerlist,0))); GtkWidget *box = GTK_WIDGET(list->data); @@ -122,15 +119,11 @@ void on_configuration_mode_switch(GtkWidget *self,main_window *widgets){ gtk_widget_destroy(window->Window); } else { - yon_ubl_status_box_despawn_infinite(GTK_CONTAINER(widgets->StatusBox)); + yon_ubl_status_box_despawn(GTK_CONTAINER(widgets->StatusBox)); GList *revealerlist = gtk_container_get_children(GTK_CONTAINER(widgets->StatusBox2)); gtk_widget_destroy(GTK_WIDGET(g_list_nth_data(revealerlist,0))); g_list_free(revealerlist); main_config.configure_mode = 0; } - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(Check),!active); - g_list_free(box); - g_list_free(children); - } diff --git a/source/ubinstall-gtk.c b/source/ubinstall-gtk.c index 8158699..d731b25 100644 --- a/source/ubinstall-gtk.c +++ b/source/ubinstall-gtk.c @@ -288,9 +288,21 @@ void yon_licence_load(main_window *widgets){ } } +void yon_scroll_block_for_builder(GtkBuilder *builder){ + GSList *list = gtk_builder_get_objects(builder); + GSList *iter; + for (iter = list; iter; iter=iter->next){ + if (GTK_IS_COMBO_BOX(iter->data)||GTK_IS_SPIN_BUTTON(iter->data)){ + yon_gtk_combo_box_block_scroll((GtkComboBox*)iter->data); + } + } + g_slist_free(list); +} + void yon_main_window_create(main_window *widgets){ __attribute__((unused)) char *locale = setlocale(LC_ALL, "en_US.UTF-8"); - GtkBuilder *builder = gtk_builder_new_from_resource(glade_path); + GtkBuilder *builder = gtk_builder_new_from_resource(glade_path); + yon_scroll_block_for_builder(builder); yon_translation_init(builder); 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,"on_toggle_button_switch_on",G_CALLBACK(on_toggle_button_switch_on)); @@ -844,8 +856,8 @@ void yon_main_window_create(main_window *widgets){ widgets->ConfigurationModeMenuItem = gtk_menu_item_new(); GtkWidget *Box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,5); GtkWidget *Label = gtk_label_new(CONFIGURATION_MODE_LABEL); - GtkWidget *Check = gtk_check_button_new(); - gtk_box_pack_start(GTK_BOX(Box),Check,0,0,0); + widgets->ConfigurationModeCheck = gtk_check_button_new(); + gtk_box_pack_start(GTK_BOX(Box),widgets->ConfigurationModeCheck,0,0,0); gtk_box_pack_start(GTK_BOX(Box),Label,0,0,0); gtk_container_add(GTK_CONTAINER(widgets->ConfigurationModeMenuItem),Box); g_signal_connect(G_OBJECT(widgets->ConfigurationModeMenuItem),"activate",G_CALLBACK(on_configuration_mode_switch),widgets); @@ -884,8 +896,8 @@ void yon_main_window_create(main_window *widgets){ GtkWidget *Check = GTK_WIDGET(g_list_nth_data(children,1)); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(Check),1); - yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(widgets->StatusBox),"config_mode",CONFIGURATION_MODE_STATUS_LABEL,BACKGROUND_IMAGE_INFO_TYPE); - yon_ubl_status_box_spawn_infinite(GTK_CONTAINER(widgets->StatusBox2),"config_mede",CONFIG_PATH_LABEL(main_config.config_save_path),BACKGROUND_IMAGE_INFO_TYPE); + yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),CONFIGURATION_MODE_STATUS_LABEL,0,BACKGROUND_IMAGE_INFO_TYPE); + yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox2),CONFIG_PATH_LABEL(main_config.config_save_path),0,BACKGROUND_IMAGE_INFO_TYPE); } else { exit (1); } diff --git a/source/ubinstall-gtk.h b/source/ubinstall-gtk.h index 8b19523..8c229be 100755 --- a/source/ubinstall-gtk.h +++ b/source/ubinstall-gtk.h @@ -468,6 +468,9 @@ typedef struct int devices_size; char *part_size_default; + + config_str modules; + int modules_size; } config; extern config main_config; @@ -607,6 +610,7 @@ typedef struct GtkWidget *ReadFullLogButton; GtkWidget *ConfigurationModeMenuItem; + GtkWidget *ConfigurationModeCheck; GtkWidget *EnableVNCMenuItem; GtkWidget *EnableRDPMenuItem; GtkWidget *AboutMenuItem; @@ -1093,7 +1097,8 @@ typedef struct char *device; int sys_section; int user_section; - gboolean format; + int format; + gulong full_part_size; unsigned long size; char size_letter; char *part_label; @@ -1525,4 +1530,5 @@ int yon_os_components_check_packages_size(GtkWidget *, main_window *widgets); void on_pacman_search_enter(GtkEntry *self, main_window *widgets); gboolean yon_log_scroll(log_window *window); gboolean on_log_window_exit(GtkWidget *,GdkEvent*, log_window *window); -void yon_modules_missed_func(main_window *widgets); \ No newline at end of file +void yon_modules_missed_func(main_window *widgets); +void yon_scroll_block_for_builder(GtkBuilder *builder); \ No newline at end of file diff --git a/source/ubl-strings.h b/source/ubl-strings.h index aaf748d..37bc047 100644 --- a/source/ubl-strings.h +++ b/source/ubl-strings.h @@ -206,8 +206,8 @@ NULL) #define SAVE_AND_EXIT_LABEL _("Save and exit") #define NO_LABEL _("No") -#define PARITY_INVALID_LABEL(target) yon_char_unite("Cu",target,NULL) -#define COUNT_INVALID_LABEL(target) yon_char_unite("Cues",target,NULL) +#define PARITY_INVALID_LABEL(target) yon_char_unite(_("Invalid devices parity. Needed:")," ",target,NULL) +#define COUNT_INVALID_LABEL(target) yon_char_unite(_("Invalid devices chosen. Needed:")," ",target,NULL) #define ABOUT_TITLE_LABEL _("About system installation") #define VALUE_REPEAT_LABEL _("Repeating values") diff --git a/ubinstall-gtk-advanced-box.glade b/ubinstall-gtk-advanced-box.glade index 495fb2b..035138d 100644 --- a/ubinstall-gtk-advanced-box.glade +++ b/ubinstall-gtk-advanced-box.glade @@ -4,7 +4,8 @@ - 100 + 1 + 9999999999999 1 10 @@ -402,6 +403,11 @@ Default + + + False + + False @@ -460,25 +466,32 @@ - - - - - - - - + - + + + + + + + + + + + + + + + diff --git a/ubinstall-gtk.glade b/ubinstall-gtk.glade index ce69dfb..1a30674 100644 --- a/ubinstall-gtk.glade +++ b/ubinstall-gtk.glade @@ -8054,7 +8054,7 @@ or continue working in the system Live environment. True - True + False True 4 @@ -8085,7 +8085,7 @@ or continue working in the system Live environment. - True + False True 6 @@ -9484,7 +9484,7 @@ or continue working in the system Live environment. True - True + False True 4 @@ -9516,7 +9516,7 @@ or continue working in the system Live environment. - True + False True 6 @@ -9749,7 +9749,6 @@ separately into the selected partition. True - False False 0 @@ -9759,22 +9758,44 @@ separately into the selected partition. 1 + + + False + True + 0 + + + + + False + vertical True False + 5 + 5 + 5 + 5 + True + word-char + 0 False True - 2 + 0 + False True - 0 + 1 @@ -9946,7 +9967,7 @@ separately into the selected partition. False True - 1 + 2 @@ -9988,6 +10009,9 @@ separately into the selected partition. + + 7 + @@ -10092,7 +10116,7 @@ separately into the selected partition. False True - 2 + 3 @@ -10137,7 +10161,7 @@ separately into the selected partition. False True - 3 + 4 @@ -10653,7 +10677,7 @@ separately into the selected partition. False True - 4 + 5