|
|
|
|
@ -212,7 +212,6 @@ void on_advanced_partition_create(GtkWidget *, main_window *widgets){
|
|
|
|
|
sections_size++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (!found&&last_unvalid){
|
|
|
|
|
char *target;
|
|
|
|
|
@ -253,7 +252,36 @@ void on_advanced_partition_add(GtkWidget *, char *path, main_window *widgets){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_advanced_device_choose(main_window *widgets, const char *device){
|
|
|
|
|
if (yon_char_is_empty(device)) return;
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
GtkTreeModel *model = GTK_TREE_MODEL(widgets->DevicesList);
|
|
|
|
|
for_iter(model, &iter){
|
|
|
|
|
char *target;
|
|
|
|
|
gtk_tree_model_get(model,&iter,0,&target,-1);
|
|
|
|
|
if (!yon_char_is_empty(target)&&strstr(device,target)){
|
|
|
|
|
char *path = gtk_tree_model_get_string_from_iter(model,&iter);
|
|
|
|
|
g_signal_emit_by_name(G_OBJECT(widgets->AdvancedDeviceChosenCell),"toggled",path,NULL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_advanced_part_choose(main_window *widgets, const char *part){
|
|
|
|
|
if (yon_char_is_empty(part)) return;
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
GtkTreeModel *model = GTK_TREE_MODEL(widgets->PartitionsList);
|
|
|
|
|
for_iter(model, &iter){
|
|
|
|
|
char *target;
|
|
|
|
|
gtk_tree_model_get(model,&iter,0,&target,-1);
|
|
|
|
|
if (!yon_char_is_empty(target)&&strstr(part,target)){
|
|
|
|
|
char *path = gtk_tree_model_get_string_from_iter(model,&iter);
|
|
|
|
|
g_signal_emit_by_name(G_OBJECT(widgets->AdvancedPartChosenCell),"toggled",path,NULL);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void yon_install_advanced_init(main_window *widgets){
|
|
|
|
|
yon_advanced_partition_clear(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);
|
|
|
|
|
@ -268,6 +296,146 @@ void yon_install_advanced_init(main_window *widgets){
|
|
|
|
|
}
|
|
|
|
|
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);
|
|
|
|
|
char *device = config(device_parameter);
|
|
|
|
|
char *parts = config(part_parameter);
|
|
|
|
|
char *part_size = config(part_size_parameter);
|
|
|
|
|
char *part_label = config(part_label_parameter);
|
|
|
|
|
char *part_fs_type = config(part_fs_type_parameter);
|
|
|
|
|
char *part_fs_label = config(part_fs_label_parameter);
|
|
|
|
|
char *part_crypt = config(part_crypt_parameter);
|
|
|
|
|
char *part_format = config(part_format_parameter);
|
|
|
|
|
char *boot = config(boot_parameter);
|
|
|
|
|
char *swap = config(swap_parameter);
|
|
|
|
|
char *swap_size = config(swap_size_parameter);
|
|
|
|
|
if (yon_char_is_empty(device)&&yon_char_is_empty(parts)) return;
|
|
|
|
|
{
|
|
|
|
|
int size;
|
|
|
|
|
config_str device_parsed = yon_char_parse(device,&size,",");
|
|
|
|
|
if (size>0&&!yon_char_is_empty(device_parsed[0])){
|
|
|
|
|
yon_advanced_device_choose(widgets,device_parsed[0]);
|
|
|
|
|
// sections[0] = yon_advanced_section_new();
|
|
|
|
|
while(gtk_events_pending()) gtk_main_iteration();
|
|
|
|
|
sections[0]->device=device_parsed[0];
|
|
|
|
|
on_advanced_partition_create(NULL,widgets);
|
|
|
|
|
if (size>1&&!yon_char_is_empty(device_parsed[1])){
|
|
|
|
|
yon_advanced_device_choose(widgets,device_parsed[1]);
|
|
|
|
|
// sections[1] = yon_advanced_section_new();
|
|
|
|
|
while(gtk_events_pending()) gtk_main_iteration();
|
|
|
|
|
sections[1]->device=device_parsed[1];
|
|
|
|
|
on_advanced_partition_create(NULL,widgets);
|
|
|
|
|
}
|
|
|
|
|
free(device_parsed);
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
int size;
|
|
|
|
|
config_str part_parsed = yon_char_parse(parts,&size,",");
|
|
|
|
|
if (size>0){
|
|
|
|
|
// sections[0] = yon_advanced_section_new();
|
|
|
|
|
yon_advanced_device_choose(widgets,part_parsed[0]);
|
|
|
|
|
yon_advanced_part_choose(widgets,part_parsed[0]);
|
|
|
|
|
while(gtk_events_pending()) gtk_main_iteration();
|
|
|
|
|
sections[0]->partition=part_parsed[0];
|
|
|
|
|
if (size>1&&!yon_char_is_empty(part_parsed[1])){
|
|
|
|
|
// sections[1] = yon_advanced_section_new();
|
|
|
|
|
yon_advanced_device_choose(widgets,part_parsed[1]);
|
|
|
|
|
yon_advanced_part_choose(widgets,part_parsed[1]);
|
|
|
|
|
while(gtk_events_pending()) gtk_main_iteration();
|
|
|
|
|
sections[1]->device=part_parsed[1];
|
|
|
|
|
}
|
|
|
|
|
free(part_parsed);
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
{
|
|
|
|
|
if (!yon_char_is_empty(part_size)){
|
|
|
|
|
int size;
|
|
|
|
|
config_str parsed = yon_char_parse(part_size,&size,",");
|
|
|
|
|
if (size>0&&!yon_char_is_empty(parsed[0])){
|
|
|
|
|
sections[0]->size = atol(parsed[0]);
|
|
|
|
|
sections[0]->size_letter = parsed[0][strlen(parsed[0])-1];
|
|
|
|
|
if (size>1&&!yon_char_is_empty(parsed[1])){
|
|
|
|
|
|
|
|
|
|
sections[1]->size = atol(parsed[1]);
|
|
|
|
|
sections[1]->size_letter = parsed[1][strlen(parsed[1])-1];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
free(parsed);
|
|
|
|
|
}
|
|
|
|
|
if (!yon_char_is_empty(part_label)){
|
|
|
|
|
int size;
|
|
|
|
|
config_str parsed = yon_char_parse(part_label,&size,",");
|
|
|
|
|
if (size>0&&!yon_char_is_empty(parsed[0])){
|
|
|
|
|
sections[0]->part_label = parsed[0];
|
|
|
|
|
if (size>1&&!yon_char_is_empty(parsed[1])){
|
|
|
|
|
sections[1]->part_label = parsed[1];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
free(parsed);
|
|
|
|
|
}
|
|
|
|
|
if (!yon_char_is_empty(part_fs_type)){
|
|
|
|
|
int size;
|
|
|
|
|
config_str parsed = yon_char_parse(part_fs_type,&size,",");
|
|
|
|
|
if (size>0&&!yon_char_is_empty(parsed[0])){
|
|
|
|
|
sections[0]->fs_type = parsed[0];
|
|
|
|
|
if (size>1&&!yon_char_is_empty(parsed[1])){
|
|
|
|
|
sections[1]->fs_type = parsed[1];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
free(parsed);
|
|
|
|
|
}
|
|
|
|
|
if (!yon_char_is_empty(part_fs_label)){
|
|
|
|
|
int size;
|
|
|
|
|
config_str parsed = yon_char_parse(part_fs_label,&size,",");
|
|
|
|
|
if (size>0&&!yon_char_is_empty(parsed[0])){
|
|
|
|
|
sections[0]->fs_label = parsed[0];
|
|
|
|
|
if (size>1&&!yon_char_is_empty(parsed[1])){
|
|
|
|
|
sections[1]->fs_label = parsed[1];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
free(parsed);
|
|
|
|
|
}
|
|
|
|
|
if (!yon_char_is_empty(part_crypt)){
|
|
|
|
|
int size;
|
|
|
|
|
config_str parsed = yon_char_parse(part_crypt,&size,",");
|
|
|
|
|
if (size>0&&!yon_char_is_empty(parsed[0])){
|
|
|
|
|
sections[0]->encryption = parsed[0];
|
|
|
|
|
if (size>1&&!yon_char_is_empty(parsed[1])){
|
|
|
|
|
sections[1]->encryption = parsed[1];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
free(parsed);
|
|
|
|
|
}
|
|
|
|
|
if (!yon_char_is_empty(part_format)){
|
|
|
|
|
int size;
|
|
|
|
|
config_str parsed = yon_char_parse(part_format,&size,",");
|
|
|
|
|
if (size>0&&!yon_char_is_empty(parsed[0])){
|
|
|
|
|
if (!strcmp(parsed[0],"yes")){
|
|
|
|
|
sections[0]->format = 2;
|
|
|
|
|
} else if (!strcmp(parsed[0],"no")){
|
|
|
|
|
sections[0]->format = 1;
|
|
|
|
|
}
|
|
|
|
|
if (size>1&&!yon_char_is_empty(parsed[1])){
|
|
|
|
|
if (!strcmp(parsed[1],"yes")){
|
|
|
|
|
sections[1]->format = 2;
|
|
|
|
|
} else if (!strcmp(parsed[1],"no")){
|
|
|
|
|
sections[1]->format = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
free(parsed);
|
|
|
|
|
}
|
|
|
|
|
if (!yon_char_is_empty(boot)){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (!yon_char_is_empty(swap)){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (!yon_char_is_empty(swap_size)){
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
yon_advanced_update(widgets);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void on_install_advanced_partition_chosen(GtkCellRenderer*, gchar *path, main_window *widgets){
|
|
|
|
|
@ -656,7 +824,7 @@ int yon_advanced_save(main_window *widgets){
|
|
|
|
|
|
|
|
|
|
if (devices[0]||devices[1]){
|
|
|
|
|
char *devices_str = yon_char_parsed_to_string_full(devices,2,",");
|
|
|
|
|
yon_config_register(AUTOINSTALL_DEVICE,AUTOINSTALL_DEVICE_command,devices_str);
|
|
|
|
|
yon_config_register(device_parameter,device_parameter_command,devices_str);
|
|
|
|
|
}
|
|
|
|
|
if (!yon_char_is_empty(parts[0])||!yon_char_is_empty(parts[1])){
|
|
|
|
|
char *parts_str = yon_char_parsed_to_string_full(parts,2,",");
|
|
|
|
|
|