|
|
|
@ -168,7 +168,7 @@ void yon_advanced_update(main_window *widgets){
|
|
|
|
gtk_list_store_set(widgets->PartitionsList,&itar,7,0,-1);
|
|
|
|
gtk_list_store_set(widgets->PartitionsList,&itar,7,0,-1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (sections_size==2){
|
|
|
|
if (sections_size>=2){
|
|
|
|
gtk_widget_hide(widgets->AdvancedAddButton);
|
|
|
|
gtk_widget_hide(widgets->AdvancedAddButton);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
gtk_widget_show(widgets->AdvancedAddButton);
|
|
|
|
gtk_widget_show(widgets->AdvancedAddButton);
|
|
|
|
@ -192,7 +192,7 @@ void on_advanced_partition_create(GtkWidget *, main_window *widgets){
|
|
|
|
advanced_section *section = yon_advanced_section_new();
|
|
|
|
advanced_section *section = yon_advanced_section_new();
|
|
|
|
section->part_source = PART_SOURCE_DEVICE;
|
|
|
|
section->part_source = PART_SOURCE_DEVICE;
|
|
|
|
section->device = target;
|
|
|
|
section->device = target;
|
|
|
|
section->partition = target;
|
|
|
|
section->partition = NULL;
|
|
|
|
sections[sections_size]=section;
|
|
|
|
sections[sections_size]=section;
|
|
|
|
sections_size++;
|
|
|
|
sections_size++;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
@ -208,7 +208,7 @@ void on_advanced_partition_create(GtkWidget *, main_window *widgets){
|
|
|
|
advanced_section *section = yon_advanced_section_new();
|
|
|
|
advanced_section *section = yon_advanced_section_new();
|
|
|
|
section->part_source = PART_SOURCE_DEVICE;
|
|
|
|
section->part_source = PART_SOURCE_DEVICE;
|
|
|
|
section->device = target;
|
|
|
|
section->device = target;
|
|
|
|
section->partition = target;
|
|
|
|
section->partition = NULL;
|
|
|
|
sections[sections_size]=section;
|
|
|
|
sections[sections_size]=section;
|
|
|
|
sections_size++;
|
|
|
|
sections_size++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -226,7 +226,7 @@ void on_advanced_partition_add(GtkWidget *, char *path, main_window *widgets){
|
|
|
|
if (sections_size==2) return;
|
|
|
|
if (sections_size==2) return;
|
|
|
|
advanced_section *section = yon_advanced_section_new();
|
|
|
|
advanced_section *section = yon_advanced_section_new();
|
|
|
|
section->part_source = PART_SOURCE_PART;
|
|
|
|
section->part_source = PART_SOURCE_PART;
|
|
|
|
section->device = device;
|
|
|
|
section->device = NULL;
|
|
|
|
section->partition = target = device;
|
|
|
|
section->partition = target = device;
|
|
|
|
sections[sections_size]=section;
|
|
|
|
sections[sections_size]=section;
|
|
|
|
sections_size++;
|
|
|
|
sections_size++;
|
|
|
|
@ -260,8 +260,7 @@ void on_install_advanced_partition_chosen(GtkCellRenderer*, gchar *path, main_wi
|
|
|
|
advanced_section *section = yon_advanced_section_new();
|
|
|
|
advanced_section *section = yon_advanced_section_new();
|
|
|
|
section->part_source = PART_SOURCE_PART;
|
|
|
|
section->part_source = PART_SOURCE_PART;
|
|
|
|
section->partition = target_part;
|
|
|
|
section->partition = target_part;
|
|
|
|
section->device = device;
|
|
|
|
section->device = NULL;
|
|
|
|
section->device = device;
|
|
|
|
|
|
|
|
sections[sections_size]=section;
|
|
|
|
sections[sections_size]=section;
|
|
|
|
sections_size++;
|
|
|
|
sections_size++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -325,7 +324,7 @@ void yon_advanced_parts_update(main_window *widgets){
|
|
|
|
|
|
|
|
|
|
|
|
GtkTreeIter itar;
|
|
|
|
GtkTreeIter itar;
|
|
|
|
gtk_list_store_append(widgets->PartitionsList,&itar);
|
|
|
|
gtk_list_store_append(widgets->PartitionsList,&itar);
|
|
|
|
gtk_list_store_set(widgets->PartitionsList,&itar,0,name,1,capacity,2,free_space,3,fs_type,4,label,5,capacity_long,6,free_space_long,8,1,-1);
|
|
|
|
gtk_list_store_set(widgets->PartitionsList,&itar,0,name,1,capacity,2,free_space,3,fs_type,4,label,5,capacity_long,6,free_space_long,8,1,9,disk_path,-1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yon_char_parsed_free(parsed,parsed_size);
|
|
|
|
yon_char_parsed_free(parsed,parsed_size);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -394,7 +393,7 @@ void on_install_advanced_device_chosen(GtkCellRenderer *, gchar *path, main_wind
|
|
|
|
gtk_tree_model_get(model,&iter,5,&status,-1);
|
|
|
|
gtk_tree_model_get(model,&iter,5,&status,-1);
|
|
|
|
if (status)chosen_amount++;
|
|
|
|
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);
|
|
|
|
// if (chosen) gtk_widget_set_sensitive(widgets->AdvancedAddButton,1);
|
|
|
|
// else gtk_widget_set_sensitive(widgets->AdvancedAddButton,0);
|
|
|
|
// else gtk_widget_set_sensitive(widgets->AdvancedAddButton,0);
|
|
|
|
yon_advanced_parts_update(widgets);
|
|
|
|
yon_advanced_parts_update(widgets);
|
|
|
|
@ -483,129 +482,120 @@ void on_advanced_section_toggled(GtkWidget *self, main_window *widgets){
|
|
|
|
|
|
|
|
|
|
|
|
int yon_advanced_save(main_window *widgets){
|
|
|
|
int yon_advanced_save(main_window *widgets){
|
|
|
|
yon_config_register(AUTOINSTALL_TYPE_INSTALL,AUTOINSTALL_TYPE_INSTALL_command,"custom");
|
|
|
|
yon_config_register(AUTOINSTALL_TYPE_INSTALL,AUTOINSTALL_TYPE_INSTALL_command,"custom");
|
|
|
|
int devices_size;
|
|
|
|
char *devices[2] = {NULL};
|
|
|
|
config_str devices = NULL;
|
|
|
|
char *parts[2] = {NULL};
|
|
|
|
int parts_size;
|
|
|
|
char *part_size[2] = {NULL};
|
|
|
|
config_str parts = NULL;
|
|
|
|
char *part_label[2] = {NULL};
|
|
|
|
int part_size_size;
|
|
|
|
char *fs_type[2] = {NULL};
|
|
|
|
config_str part_size = NULL;
|
|
|
|
char *fs_label[2] = {NULL};
|
|
|
|
int part_label_size;
|
|
|
|
char *encryption[2] = {NULL};
|
|
|
|
config_str part_label = NULL;
|
|
|
|
char *format[2] = {NULL};
|
|
|
|
int fs_type_size;
|
|
|
|
|
|
|
|
config_str fs_type = NULL;
|
|
|
|
|
|
|
|
int fs_label_size;
|
|
|
|
|
|
|
|
config_str fs_label = NULL;
|
|
|
|
|
|
|
|
int encryption_size;
|
|
|
|
|
|
|
|
config_str encryption = NULL;
|
|
|
|
|
|
|
|
int format_size;
|
|
|
|
|
|
|
|
config_str format = NULL;
|
|
|
|
|
|
|
|
if (!sections_size){
|
|
|
|
if (!sections_size){
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
advanced_section *cur_section = sections[0]->sys_section?sections[0]:sections[1];
|
|
|
|
advanced_section *cur_section = sections[0]->sys_section?sections[0]:sections[1];
|
|
|
|
yon_char_parsed_add_or_create_if_exists(devices,&devices_size,cur_section->device);
|
|
|
|
devices[0]=cur_section->device;
|
|
|
|
if (cur_section->device){
|
|
|
|
if (cur_section->user_section){
|
|
|
|
yon_char_parsed_add_or_create_if_exists(devices,&devices_size,cur_section->device);
|
|
|
|
devices[1]=cur_section->device;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!yon_char_is_empty(cur_section->partition)){
|
|
|
|
if (!yon_char_is_empty(cur_section->partition)){
|
|
|
|
yon_char_parsed_add_or_create_if_exists(parts,&parts_size,cur_section->partition);
|
|
|
|
parts[0]=cur_section->partition;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
yon_char_parsed_add_or_create_if_exists(parts,&parts_size,"");
|
|
|
|
parts[0]="";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (cur_section->size){
|
|
|
|
if (cur_section->size){
|
|
|
|
char *size_str = yon_char_from_long(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);
|
|
|
|
char *sz_str = yon_char_append_c(size_str,cur_section->size_letter);
|
|
|
|
yon_char_parsed_add_or_create_if_exists(part_size,&part_size_size,sz_str);
|
|
|
|
part_size[0]=sz_str;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!yon_char_is_empty(cur_section->part_label)){
|
|
|
|
if (!yon_char_is_empty(cur_section->part_label)){
|
|
|
|
yon_char_parsed_add_or_create_if_exists(part_label,&part_label_size,cur_section->part_label);
|
|
|
|
part_label[0]=cur_section->part_label;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!yon_char_is_empty(cur_section->fs_type)){
|
|
|
|
if (!yon_char_is_empty(cur_section->fs_type)){
|
|
|
|
yon_char_parsed_add_or_create_if_exists(fs_type,&fs_type_size,cur_section->fs_type);
|
|
|
|
fs_type[0]=cur_section->fs_type;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!yon_char_is_empty(cur_section->fs_label)){
|
|
|
|
if (!yon_char_is_empty(cur_section->fs_label)){
|
|
|
|
yon_char_parsed_add_or_create_if_exists(fs_label,&fs_label_size,cur_section->fs_label);
|
|
|
|
fs_label[0]=cur_section->fs_label;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (cur_section->format){
|
|
|
|
if (cur_section->format){
|
|
|
|
yon_char_parsed_add_or_create_if_exists(format,&format_size,"yes");
|
|
|
|
format[0]="yes";
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
yon_char_parsed_add_or_create_if_exists(format,&format_size,"no");
|
|
|
|
format[0]="no";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!yon_char_is_empty(cur_section->encryption)){
|
|
|
|
if (!yon_char_is_empty(cur_section->encryption)){
|
|
|
|
char *encrypt_str = yon_char_unite(cur_section->encryption,":",cur_section->encryption_password,NULL);
|
|
|
|
char *encrypt_str = yon_char_unite(cur_section->encryption,":",cur_section->encryption_password,NULL);
|
|
|
|
yon_char_parsed_add_or_create_if_exists(encryption,&encryption_size,encrypt_str);
|
|
|
|
encryption[0]=encrypt_str;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (sections_size>1){
|
|
|
|
if (sections_size>1){
|
|
|
|
cur_section = sections[0]->sys_section?sections[1]:sections[0];
|
|
|
|
cur_section = sections[0]->sys_section?sections[1]:sections[0];
|
|
|
|
|
|
|
|
|
|
|
|
yon_char_parsed_add_or_create_if_exists(devices,&devices_size,cur_section->device);
|
|
|
|
devices[1]=cur_section->device;
|
|
|
|
if (!yon_char_is_empty(cur_section->partition)){
|
|
|
|
if (!yon_char_is_empty(cur_section->partition)){
|
|
|
|
yon_char_parsed_add_or_create_if_exists(parts,&parts_size,cur_section->partition);
|
|
|
|
parts[1]=cur_section->partition;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
yon_char_parsed_add_or_create_if_exists(parts,&parts_size,"");
|
|
|
|
parts[1]="";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (cur_section->size){
|
|
|
|
if (cur_section->size){
|
|
|
|
char *size_str = yon_char_from_long(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);
|
|
|
|
char *sz_str = yon_char_append_c(size_str,cur_section->size_letter);
|
|
|
|
yon_char_parsed_add_or_create_if_exists(part_size,&part_size_size,sz_str);
|
|
|
|
part_size[1]=sz_str;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!yon_char_is_empty(cur_section->part_label)){
|
|
|
|
if (!yon_char_is_empty(cur_section->part_label)){
|
|
|
|
yon_char_parsed_add_or_create_if_exists(part_label,&part_label_size,cur_section->part_label);
|
|
|
|
part_label[1]=cur_section->part_label;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!yon_char_is_empty(cur_section->fs_type)){
|
|
|
|
if (!yon_char_is_empty(cur_section->fs_type)){
|
|
|
|
yon_char_parsed_add_or_create_if_exists(fs_type,&fs_type_size,cur_section->fs_type);
|
|
|
|
fs_type[1]=cur_section->fs_type;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!yon_char_is_empty(cur_section->fs_label)){
|
|
|
|
if (!yon_char_is_empty(cur_section->fs_label)){
|
|
|
|
yon_char_parsed_add_or_create_if_exists(fs_label,&fs_label_size,cur_section->fs_label);
|
|
|
|
fs_label[1]=cur_section->fs_label;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (cur_section->format){
|
|
|
|
if (cur_section->format){
|
|
|
|
yon_char_parsed_add_or_create_if_exists(format,&format_size,"yes");
|
|
|
|
format[1]="yes";
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
yon_char_parsed_add_or_create_if_exists(format,&format_size,"no");
|
|
|
|
format[1]="no";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!yon_char_is_empty(cur_section->encryption)){
|
|
|
|
if (!yon_char_is_empty(cur_section->encryption)){
|
|
|
|
char *encrypt_str = yon_char_unite(cur_section->encryption,":",cur_section->encryption_password,NULL);
|
|
|
|
char *encrypt_str = yon_char_unite(cur_section->encryption,":",cur_section->encryption_password,NULL);
|
|
|
|
yon_char_parsed_add_or_create_if_exists(encryption,&encryption_size,encrypt_str);
|
|
|
|
encryption[1]=encrypt_str;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (devices_size){
|
|
|
|
if (devices[0]||devices[1]){
|
|
|
|
char *devices_str = yon_char_parsed_to_string(devices,devices_size,",");
|
|
|
|
char *devices_str = yon_char_parsed_to_string_full(devices,2,",");
|
|
|
|
yon_config_register(AUTOINSTALL_DEVICE,AUTOINSTALL_DEVICE_command,devices_str);
|
|
|
|
yon_config_register(AUTOINSTALL_DEVICE,AUTOINSTALL_DEVICE_command,devices_str);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (parts_size){
|
|
|
|
if (parts[0]||parts[1]){
|
|
|
|
char *parts_str = yon_char_parsed_to_string(parts,parts_size,",");
|
|
|
|
char *parts_str = yon_char_parsed_to_string_full(parts,2,",");
|
|
|
|
yon_config_register(part_parameter,part_parameter_command,parts_str);
|
|
|
|
yon_config_register(part_parameter,part_parameter_command,parts_str);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (part_size_size){
|
|
|
|
if (part_size[0]||part_size[1]){
|
|
|
|
char *part_size_str = yon_char_parsed_to_string(part_size,part_size_size,",");
|
|
|
|
char *part_size_str = yon_char_parsed_to_string_full(part_size,2,",");
|
|
|
|
yon_config_register(part_size_parameter,part_size_parameter_command,part_size_str);
|
|
|
|
yon_config_register(part_size_parameter,part_size_parameter_command,part_size_str);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (part_label_size){
|
|
|
|
if (part_label[0]||part_label[1]){
|
|
|
|
char *part_label_str = yon_char_parsed_to_string(part_label,part_label_size,",");
|
|
|
|
char *part_label_str = yon_char_parsed_to_string_full(part_label,2,",");
|
|
|
|
yon_config_register(part_label_parameter,part_label_parameter_command,part_label_str);
|
|
|
|
yon_config_register(part_label_parameter,part_label_parameter_command,part_label_str);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (fs_type_size){
|
|
|
|
if (fs_type[0]||fs_type[1]){
|
|
|
|
char *fs_type_str = yon_char_parsed_to_string(fs_type,fs_type_size,",");
|
|
|
|
char *fs_type_str = yon_char_parsed_to_string_full(fs_type,2,",");
|
|
|
|
yon_config_register(part_fs_type_parameter,part_fs_type_parameter_command,fs_type_str);
|
|
|
|
yon_config_register(part_fs_type_parameter,part_fs_type_parameter_command,fs_type_str);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (fs_label_size){
|
|
|
|
if (fs_label[0]||fs_label[1]){
|
|
|
|
char *fs_label_str = yon_char_parsed_to_string(fs_label,fs_label_size,",");
|
|
|
|
char *fs_label_str = yon_char_parsed_to_string_full(fs_label,2,",");
|
|
|
|
yon_config_register(part_fs_label_parameter,part_fs_label_parameter_command,fs_label_str);
|
|
|
|
yon_config_register(part_fs_label_parameter,part_fs_label_parameter_command,fs_label_str);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (encryption_size){
|
|
|
|
if (encryption[0]||encryption[1]){
|
|
|
|
char *encryption_str = yon_char_parsed_to_string(encryption,encryption_size,",");
|
|
|
|
char *encryption_str = yon_char_parsed_to_string_full(encryption,2,",");
|
|
|
|
yon_config_register(part_crypt_parameter,part_crypt_parameter_command,encryption_str);
|
|
|
|
yon_config_register(part_crypt_parameter,part_crypt_parameter_command,encryption_str);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (format_size){
|
|
|
|
if (format[0]||format[1]){
|
|
|
|
char *format_str = yon_char_parsed_to_string(format,format_size,",");
|
|
|
|
char *format_str = yon_char_parsed_to_string_full(format,2,",");
|
|
|
|
yon_config_register(part_format_parameter,part_format_parameter_command,format_str);
|
|
|
|
yon_config_register(part_format_parameter,part_format_parameter_command,format_str);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -758,7 +748,6 @@ void on_advanced_virtual_device_changed(GtkWidget *, main_window *widgets){
|
|
|
|
section->part_source = PART_SOURCE_VIRTUAL;
|
|
|
|
section->part_source = PART_SOURCE_VIRTUAL;
|
|
|
|
section->partition = device;
|
|
|
|
section->partition = device;
|
|
|
|
section->device = device;
|
|
|
|
section->device = device;
|
|
|
|
section->device = device;
|
|
|
|
|
|
|
|
yon_advanced_section_append(section);
|
|
|
|
yon_advanced_section_append(section);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
yon_advanced_update(widgets);
|
|
|
|
yon_advanced_update(widgets);
|
|
|
|
|