WIP virtual device combobox changes

pull/109/head
parent 26049c72ac
commit 9a169e6f19
No known key found for this signature in database
GPG Key ID: FF1D842BF4DDE92B

@ -57,5 +57,6 @@
<file>services-list.csv</file>
<file>network-list.csv</file>
<file>filesystems-format-list.csv</file>
<file>vfs-list.csv</file>
</gresource>
</gresources>

@ -79,6 +79,7 @@ set(DEPENDFILES
../services-list.csv
../network-list.csv
../filesystems-format-list.csv
../vfs-list.csv
../icons-builtin/install_type_custom_normal.png
../icons-builtin/install_type_data_only_normal.png
../icons-builtin/install_type_fast_normal.png

@ -252,7 +252,19 @@ void on_advanced_partition_add(GtkWidget *, char *path, main_window *widgets){
}
void yon_install_advanced_init(main_window *){
void yon_install_advanced_init(main_window *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);
int size;
config_str vmf_file = yon_resource_open_file(vfs_list_path,&size);
for (int i=1;i<size;i++){
int parsed_size;
config_str parsed = yon_char_parse(vmf_file[i],&parsed_size,";");
gtk_combo_box_text_append(GTK_COMBO_BOX_TEXT(widgets->AdvancedVirtualDeviceCombo),parsed[2],parsed[0]);
yon_char_parsed_free(parsed,parsed_size);
}
yon_char_parsed_free(vmf_file,size);
}
void on_install_advanced_partition_chosen(GtkCellRenderer*, gchar *path, main_window *widgets){
@ -768,12 +780,48 @@ int yon_advanced_section_append(advanced_section *section){
void on_advanced_virtual_device_changed(GtkWidget *, main_window *widgets){
yon_advanced_section_remove_all();
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;i<size;i++){
int parsed_size;
config_str parsed = yon_char_parse(vfs_file[i],&parsed_size,";");
if (!yon_char_is_empty(device)&&!yon_char_is_empty(parsed[2])&!strcmp(parsed[2],device)){
cur_device = parsed;
gtk_label_set_text(GTK_LABEL(widgets->AdvancedVirtualDeviceLabel),parsed[1]);
}
yon_char_parsed_free(parsed,parsed_size);
}
if (!yon_char_is_empty(device)){
advanced_section *section = yon_advanced_section_new();
section->part_source = PART_SOURCE_VIRTUAL;
section->partition = device;
section->device = device;
yon_advanced_section_append(section);
GtkTreeIter iter;
GtkTreeModel *model = GTK_TREE_MODEL(widgets->DevicesList);
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[4]),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;
section->partition = device;
section->device = device;
yon_advanced_section_append(section);
}
yon_char_parsed_free(vfs_file,size);
yon_advanced_update(widgets);
}

@ -360,10 +360,12 @@ void yon_page_init(main_window *widgets, enum YON_PAGES page){
case YON_PAGE_NETWORK:
yon_network_init(widgets);
break;
case YON_PAGE_INSTALL_ADVANCED:
yon_install_advanced_init(widgets);
[[fallthrough]];
case YON_PAGE_INSTALL_COMMON:
case YON_PAGE_INSTALL_SEPARATE:
case YON_PAGE_INSTALL_SAME_PARTITION:
case YON_PAGE_INSTALL_ADVANCED:
case YON_PAGE_RECOVERY_GRUB_INSTALL:
case YON_PAGE_RECOVERY_GRUB_UPDATE:
case YON_PAGE_RECOVERY_OS_ONLY:

@ -820,6 +820,7 @@ void yon_main_window_create(main_window *widgets){
widgets->NetworkConnectionsAddButton = yon_gtk_builder_get_widget(builder,"NetworkConnectionsAddButton");
widgets->HostnameSensitiveSwitch = yon_gtk_builder_get_widget(builder,"HostnameSensitiveSwitch");
widgets->AutoHostnameCheck=yon_gtk_builder_get_widget(builder,"AutoHostnameCheck");
widgets->AdvancedVirtualDeviceLabel = yon_gtk_builder_get_widget(builder,"AdvancedVirtualDeviceLabel");
widgets->network_connections = NULL;
widgets->pacmanchosen = g_hash_table_new_full(g_str_hash,g_str_equal,free,NULL);

@ -71,6 +71,7 @@
#define services_list_path "resource:///com/ublinux/csv/services-list.csv"
#define network_path "resource:///com/ublinux/csv/network-list.csv"
#define fs_types_path "resource:///com/ublinux/csv/filesystems-format-list.csv"
#define vfs_list_path "resource:///com/ublinux/csv/vfs-list.csv"
#define encryptions_list "luks1","luks2"
@ -92,6 +93,7 @@
"/com/ublinux/images/slide-12.png", \
NULL
#define get_modules_command "pacman --color never -Ss ^ubm- | sed -Enr -e 'N;s/\\n/ ;/' -e \"s/^([^\\/]+)\\/([^[:blank:]]+)[[:blank:]]+([^[:blank:]]+)[[:blank:]]+(\\(([^\\)]+)\\)[^\\;]+|[^\\;]*);[[:blank:]]*(.*)/\\2;\\3;\\5;\\6/p\""
#define get_local_module_info_command(target) yon_char_unite("pacman --color never -Sp $(pacman -Ssq '",target,"') --print-format '%n;%v;%d' | grep -v \"^::\"",NULL);
@ -677,6 +679,7 @@ typedef struct {
GtkWidget *AdvancedSwapFixedSizeSwitch;
GtkWidget *AdvancedSwapRevealer;
GtkWidget *AdvancedLoadTypeRevealer;
GtkWidget *AdvancedVirtualDeviceLabel;
dictionary *advanced_sections;
GSequence *advanced_partition_order;

@ -212,6 +212,10 @@
#define CONFIGURATION_MODE_TITLE_LABEL _("Choose installation configuration file")
#define SAVE_AND_EXIT_LABEL _("Save and exit")
#define NO_LABEL _("No")
#define PARITY_INVALID_LABEL(target) yon_char_unite(_("Cu"),target)
#define COUNT_INVALID_LABEL(target) yon_char_unite(_("Cu"),target)
// #define _LABEL _("New section at")
// #define _LABEL _("\"/ublinux-data/\" user data section")
@ -323,7 +327,6 @@
// #define _LABEL _("Common Installation")
// #define _LABEL _("Select partiton:")
// #define _LABEL _("Installation on same partition")
// #define _LABEL _("No")
// #define _LABEL _("Advanced section")
// #define _LABEL _("Recovery section")
// #define _LABEL _("Start installation scenario")

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.40.0 -->
<!-- Generated with glade 3.38.2 -->
<interface domain="ubinstall-gtk">
<requires lib="gtk+" version="3.24"/>
<!-- interface-css-provider-path ubinstall-gtk.css -->
@ -6842,6 +6842,55 @@ separately into the selected partition.</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">5</property>
<child>
<object class="GtkBox">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="spacing">5</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Virtual device type:</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="GtkComboBoxText" id="AdvancedVirtualDeviceCombo">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">False</property>
<property name="active">0</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="AdvancedVirtualDeviceLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkBox">
<property name="visible">True</property>
@ -6991,54 +7040,6 @@ separately into the selected partition.</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</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="spacing">5</property>
<child>
<object class="GtkLabel">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="label" translatable="yes">Virtual device type:</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="GtkComboBoxText" id="AdvancedVirtualDeviceCombo">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">False</property>
<property name="active">0</property>
<items>
<item translatable="yes">No</item>
<item id="raid0" translatable="yes">RAID0</item>
<item id="raid1" translatable="yes">RAID1</item>
<item id="raid4" translatable="yes">DAID4</item>
<item id="raid5" translatable="yes">RAID5</item>
<item id="raid6" translatable="yes">RAID6</item>
<item id="lvm" translatable="yes">LVM</item>
<item id="lvm_dynamic" translatable="yes">LVM_DYNAMIC</item>
</items>
</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>

@ -0,0 +1,9 @@
VFS_NAME;VFS_DESCRIPTION;VFS_CONFIG;VFS_MIN;VSF_PATITY
RAID0;raid0 description;raid0;2;
RAID1;raid1 description;raid1;2;2
RAID4;raid4 description;raid4;2;
RAID5;raid5 description;raid5;3;
RAID6;raid5 description;raid6;2;
RAID10;raid10 description;raid10;4;2
LVM;lvm description;lvm;2;
LVM DYNAMIC;lvm_dynamic description;lvm_dynamic;2;
1 VFS_NAME VFS_DESCRIPTION VFS_CONFIG VFS_MIN VSF_PATITY
2 RAID0 raid0 description raid0 2
3 RAID1 raid1 description raid1 2 2
4 RAID4 raid4 description raid4 2
5 RAID5 raid5 description raid5 3
6 RAID6 raid5 description raid6 2
7 RAID10 raid10 description raid10 4 2
8 LVM lvm description lvm 2
9 LVM DYNAMIC lvm_dynamic description lvm_dynamic 2
Loading…
Cancel
Save