|
|
|
|
@ -13,7 +13,7 @@ int yon_install_common_save(main_window *widgets){
|
|
|
|
|
yon_config_remove_by_key(part_parameter);
|
|
|
|
|
gtk_tree_model_get(model,&iter,0,&device,-1);
|
|
|
|
|
yon_config_register(AUTOINSTALL_TYPE_INSTALL,AUTOINSTALL_TYPE_INSTALL_command,"fast");
|
|
|
|
|
yon_config_register(AUTOINSTALL_DEVICE,AUTOINSTALL_DEVICE_command,device);
|
|
|
|
|
yon_config_register(device_parameter,device_parameter_command,device);
|
|
|
|
|
|
|
|
|
|
char *device_name = (char*)gtk_entry_get_text(GTK_ENTRY(widgets->CommonInstallationSectionNameEntry));
|
|
|
|
|
if (!yon_char_is_empty(device_name)){
|
|
|
|
|
@ -31,7 +31,7 @@ int yon_install_common_save(main_window *widgets){
|
|
|
|
|
|
|
|
|
|
if (!main_config.configure_mode){
|
|
|
|
|
int size;
|
|
|
|
|
config_str parameters = yon_config_get_save_parameters_by_key(&size,AUTOINSTALL_TYPE_INSTALL,AUTOINSTALL_DEVICE,part_label_parameter,part_fs_type_parameter,NULL);
|
|
|
|
|
config_str parameters = yon_config_get_save_parameters_by_key(&size,AUTOINSTALL_TYPE_INSTALL,device_parameter,part_label_parameter,part_fs_type_parameter,NULL);
|
|
|
|
|
if (parameters){
|
|
|
|
|
char *command_parameters = yon_char_parsed_to_string(parameters,size," -- ");
|
|
|
|
|
char *command = yon_char_unite(ubconfig_dull_command,"--target system ",command_parameters,NULL);
|
|
|
|
|
@ -63,7 +63,7 @@ int yon_install_separate_save(main_window *widgets){
|
|
|
|
|
glong size,free_space;
|
|
|
|
|
gtk_tree_model_get(model,&iter,0,&part,5,&size,6,&free_space,-1);
|
|
|
|
|
yon_config_register(AUTOINSTALL_TYPE_INSTALL,AUTOINSTALL_TYPE_INSTALL_command,"next");
|
|
|
|
|
yon_config_register(AUTOINSTALL_DEVICE,AUTOINSTALL_DEVICE_command,device);
|
|
|
|
|
yon_config_register(device_parameter,device_parameter_command,device);
|
|
|
|
|
yon_config_register(part_parameter,part_parameter_command,part);
|
|
|
|
|
if (gtk_switch_get_active(GTK_SWITCH(widgets->NextInstallationFormatSwitch))){
|
|
|
|
|
yon_config_register(part_format_parameter,part_format_parameter_command,"yes");
|
|
|
|
|
@ -113,7 +113,7 @@ int yon_install_separate_save(main_window *widgets){
|
|
|
|
|
|
|
|
|
|
if (!main_config.configure_mode){
|
|
|
|
|
int size;
|
|
|
|
|
config_str parameters = yon_config_get_save_parameters_by_key(&size,part_format_parameter,part_label_parameter,part_fs_type_parameter,AUTOINSTALL_DEVICE,part_parameter,NULL);
|
|
|
|
|
config_str parameters = yon_config_get_save_parameters_by_key(&size,part_format_parameter,part_label_parameter,part_fs_type_parameter,device_parameter,part_parameter,NULL);
|
|
|
|
|
if (parameters){
|
|
|
|
|
char *command_parameters = yon_char_parsed_to_string(parameters,size," -- ");
|
|
|
|
|
char *command = yon_char_unite(ubconfig_dull_command,"--target system ",command_parameters,NULL);
|
|
|
|
|
@ -144,7 +144,7 @@ int yon_install_same_partition_save(main_window *widgets){
|
|
|
|
|
char *part;
|
|
|
|
|
gtk_tree_model_get(model,&iter,0,&part,-1);
|
|
|
|
|
yon_config_register(AUTOINSTALL_TYPE_INSTALL,AUTOINSTALL_TYPE_INSTALL_command,"part");
|
|
|
|
|
yon_config_register(AUTOINSTALL_DEVICE,AUTOINSTALL_DEVICE_command,device);
|
|
|
|
|
yon_config_register(device_parameter,device_parameter_command,device);
|
|
|
|
|
yon_config_register(part_parameter,part_parameter_command,part);
|
|
|
|
|
|
|
|
|
|
if (gtk_switch_get_active(GTK_SWITCH(widgets->SameInstallationFormatSwitch))){
|
|
|
|
|
@ -171,7 +171,7 @@ int yon_install_same_partition_save(main_window *widgets){
|
|
|
|
|
}
|
|
|
|
|
if (!main_config.configure_mode){
|
|
|
|
|
int size;
|
|
|
|
|
config_str parameters = yon_config_get_save_parameters_by_key(&size,part_format_parameter,part_size_parameter,part_label_parameter,part_fs_type_parameter,AUTOINSTALL_TYPE_INSTALL,AUTOINSTALL_DEVICE,part_parameter,NULL);
|
|
|
|
|
config_str parameters = yon_config_get_save_parameters_by_key(&size,part_format_parameter,part_size_parameter,part_label_parameter,part_fs_type_parameter,AUTOINSTALL_TYPE_INSTALL,device_parameter,part_parameter,NULL);
|
|
|
|
|
if (parameters){
|
|
|
|
|
char *command_parameters = yon_char_parsed_to_string(parameters,size," -- ");
|
|
|
|
|
char *command = yon_char_unite(ubconfig_dull_command,"--target system ",command_parameters,NULL);
|
|
|
|
|
@ -183,61 +183,61 @@ int yon_install_same_partition_save(main_window *widgets){
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int yon_advanced_sections_save(dictionary *dict){
|
|
|
|
|
if (!dict) return 0;
|
|
|
|
|
advanced_partition *first_section = yon_dictionary_get_data(dict->first,advanced_partition*);
|
|
|
|
|
advanced_partition *last_section = NULL;
|
|
|
|
|
if (dict->first->next){
|
|
|
|
|
last_section = yon_dictionary_get_data(dict->first->next,advanced_partition*);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
char *part_first = first_section->part;
|
|
|
|
|
char *part_last = last_section?last_section->part:NULL;
|
|
|
|
|
char *part = yon_char_unite(part_first,last_section?",":NULL,part_last,NULL);
|
|
|
|
|
yon_config_register(part_parameter,part_parameter_command,part);
|
|
|
|
|
|
|
|
|
|
int format_first_active = gtk_switch_get_active(GTK_SWITCH(first_section->FormatCombo));
|
|
|
|
|
int format_last_active = gtk_switch_get_active(GTK_SWITCH(last_section->FormatCombo));
|
|
|
|
|
char * format_first = format_first_active==1?"yes":format_first_active==2?"no":NULL;
|
|
|
|
|
char * format_last = format_last_active==1?"yes":format_last_active==2?"no":NULL;
|
|
|
|
|
char *format = yon_char_unite(format_first,part_last?",":NULL,format_last,NULL);
|
|
|
|
|
yon_config_register(part_format_parameter,part_format_parameter_command,format);
|
|
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(format)){
|
|
|
|
|
char *size_first = g_strdup_printf("%d%s",gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(first_section->SizeSpin)),yon_size_get_mod(gtk_combo_box_get_active(GTK_COMBO_BOX(first_section->SizeCombo))));
|
|
|
|
|
char *size_last = last_section&&!strcmp(format_last,"yes")?g_strdup_printf("%d%s",gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(last_section->SizeSpin)),yon_size_get_mod(gtk_combo_box_get_active(GTK_COMBO_BOX(last_section->SizeCombo)))):NULL;
|
|
|
|
|
char *size = yon_char_unite(size_first,size_last?",":NULL,size_last,NULL);
|
|
|
|
|
yon_config_register(part_size_parameter,part_size_parameter_command,size);
|
|
|
|
|
|
|
|
|
|
char *part_label_first = (char*)gtk_entry_get_text(GTK_ENTRY(first_section->PartLabelEntry));
|
|
|
|
|
char *part_label_last = last_section&&!strcmp(format_last,"yes")?(char*)gtk_entry_get_text(GTK_ENTRY(last_section->PartLabelEntry)):NULL;
|
|
|
|
|
char *part_label = yon_char_unite(part_label_first,part_label_last?",":NULL,part_label_last,NULL);
|
|
|
|
|
yon_config_register(part_label_parameter,part_label_parameter_command,part_label);
|
|
|
|
|
|
|
|
|
|
char *fs_label_first = (char*)gtk_entry_get_text(GTK_ENTRY(first_section->FileSystemLabelEntry));
|
|
|
|
|
char *fs_label_last = last_section&&!strcmp(format_last,"yes")?(char*)gtk_entry_get_text(GTK_ENTRY(last_section->FileSystemLabelEntry)):NULL;
|
|
|
|
|
char *fs_label = yon_char_unite(fs_label_first,fs_label_last?",":NULL,fs_label_last,NULL);
|
|
|
|
|
yon_config_register(part_fs_label_parameter,part_fs_label_parameter_command,fs_label);
|
|
|
|
|
|
|
|
|
|
char *fs_type_first = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(first_section->FileSystemTypeCombo));
|
|
|
|
|
char *fs_type_last = last_section&&!strcmp(format_last,"yes")?(char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(last_section->FileSystemTypeCombo)):NULL;
|
|
|
|
|
char *fs_type = yon_char_unite(fs_type_first,fs_type_last?",":NULL,fs_type_last,NULL);
|
|
|
|
|
yon_config_register(part_fs_type_parameter,part_fs_type_parameter_command,fs_type);
|
|
|
|
|
|
|
|
|
|
char *part_crypt_first = gtk_combo_box_get_active(GTK_COMBO_BOX(first_section->EncryptionCombo))?(char*)gtk_entry_get_text(GTK_ENTRY(first_section->EncryptionEntry)):NULL;
|
|
|
|
|
char *part_crypt_last = last_section&&!strcmp(format_last,"yes")&>k_combo_box_get_active(GTK_COMBO_BOX(last_section->EncryptionCombo))?(char*)gtk_entry_get_text(GTK_ENTRY(first_section->EncryptionEntry)):NULL;
|
|
|
|
|
char *part_crypt = NULL;
|
|
|
|
|
if (part_crypt_first||part_crypt_last){
|
|
|
|
|
part_crypt = yon_char_unite(part_crypt_first,part_crypt_last?",":NULL,part_crypt_last,NULL);
|
|
|
|
|
}
|
|
|
|
|
if (part_crypt){
|
|
|
|
|
yon_config_register(part_crypt_parameter,part_crypt_parameter_command,part_crypt);
|
|
|
|
|
} else {
|
|
|
|
|
yon_config_remove_by_key(part_crypt_parameter);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
// int yon_advanced_sections_save(dictionary *dict){
|
|
|
|
|
// if (!dict) return 0;
|
|
|
|
|
// advanced_part_widgets *first_section = yon_dictionary_get_data(dict->first,advanced_part_widgets*);
|
|
|
|
|
// advanced_part_widgets *last_section = NULL;
|
|
|
|
|
// if (dict->first->next){
|
|
|
|
|
// last_section = yon_dictionary_get_data(dict->first->next,advanced_part_widgets*);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// char *part_first = first_section->part;
|
|
|
|
|
// char *part_last = last_section?last_section->part:NULL;
|
|
|
|
|
// char *part = yon_char_unite(part_first,last_section?",":NULL,part_last,NULL);
|
|
|
|
|
// yon_config_register(part_parameter,part_parameter_command,part);
|
|
|
|
|
|
|
|
|
|
// int format_first_active = gtk_switch_get_active(GTK_SWITCH(first_section->FormatCombo));
|
|
|
|
|
// int format_last_active = gtk_switch_get_active(GTK_SWITCH(last_section->FormatCombo));
|
|
|
|
|
// char * format_first = format_first_active==1?"yes":format_first_active==2?"no":NULL;
|
|
|
|
|
// char * format_last = format_last_active==1?"yes":format_last_active==2?"no":NULL;
|
|
|
|
|
// char *format = yon_char_unite(format_first,part_last?",":NULL,format_last,NULL);
|
|
|
|
|
// yon_config_register(part_format_parameter,part_format_parameter_command,format);
|
|
|
|
|
|
|
|
|
|
// if (!yon_char_is_empty(format)){
|
|
|
|
|
// char *size_first = g_strdup_printf("%d%s",gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(first_section->SizeSpin)),yon_size_get_mod(gtk_combo_box_get_active(GTK_COMBO_BOX(first_section->SizeCombo))));
|
|
|
|
|
// char *size_last = last_section&&!strcmp(format_last,"yes")?g_strdup_printf("%d%s",gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(last_section->SizeSpin)),yon_size_get_mod(gtk_combo_box_get_active(GTK_COMBO_BOX(last_section->SizeCombo)))):NULL;
|
|
|
|
|
// char *size = yon_char_unite(size_first,size_last?",":NULL,size_last,NULL);
|
|
|
|
|
// yon_config_register(part_size_parameter,part_size_parameter_command,size);
|
|
|
|
|
|
|
|
|
|
// char *part_label_first = (char*)gtk_entry_get_text(GTK_ENTRY(first_section->PartLabelEntry));
|
|
|
|
|
// char *part_label_last = last_section&&!strcmp(format_last,"yes")?(char*)gtk_entry_get_text(GTK_ENTRY(last_section->PartLabelEntry)):NULL;
|
|
|
|
|
// char *part_label = yon_char_unite(part_label_first,part_label_last?",":NULL,part_label_last,NULL);
|
|
|
|
|
// yon_config_register(part_label_parameter,part_label_parameter_command,part_label);
|
|
|
|
|
|
|
|
|
|
// char *fs_label_first = (char*)gtk_entry_get_text(GTK_ENTRY(first_section->FileSystemLabelEntry));
|
|
|
|
|
// char *fs_label_last = last_section&&!strcmp(format_last,"yes")?(char*)gtk_entry_get_text(GTK_ENTRY(last_section->FileSystemLabelEntry)):NULL;
|
|
|
|
|
// char *fs_label = yon_char_unite(fs_label_first,fs_label_last?",":NULL,fs_label_last,NULL);
|
|
|
|
|
// yon_config_register(part_fs_label_parameter,part_fs_label_parameter_command,fs_label);
|
|
|
|
|
|
|
|
|
|
// char *fs_type_first = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(first_section->FileSystemTypeCombo));
|
|
|
|
|
// char *fs_type_last = last_section&&!strcmp(format_last,"yes")?(char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(last_section->FileSystemTypeCombo)):NULL;
|
|
|
|
|
// char *fs_type = yon_char_unite(fs_type_first,fs_type_last?",":NULL,fs_type_last,NULL);
|
|
|
|
|
// yon_config_register(part_fs_type_parameter,part_fs_type_parameter_command,fs_type);
|
|
|
|
|
|
|
|
|
|
// char *part_crypt_first = gtk_combo_box_get_active(GTK_COMBO_BOX(first_section->EncryptionCombo))?(char*)gtk_entry_get_text(GTK_ENTRY(first_section->EncryptionEntry)):NULL;
|
|
|
|
|
// char *part_crypt_last = last_section&&!strcmp(format_last,"yes")&>k_combo_box_get_active(GTK_COMBO_BOX(last_section->EncryptionCombo))?(char*)gtk_entry_get_text(GTK_ENTRY(first_section->EncryptionEntry)):NULL;
|
|
|
|
|
// char *part_crypt = NULL;
|
|
|
|
|
// if (part_crypt_first||part_crypt_last){
|
|
|
|
|
// part_crypt = yon_char_unite(part_crypt_first,part_crypt_last?",":NULL,part_crypt_last,NULL);
|
|
|
|
|
// }
|
|
|
|
|
// if (part_crypt){
|
|
|
|
|
// yon_config_register(part_crypt_parameter,part_crypt_parameter_command,part_crypt);
|
|
|
|
|
// } else {
|
|
|
|
|
// yon_config_remove_by_key(part_crypt_parameter);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// return 1;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
void yon_size_changed(GtkSpinButton *self, main_window *widgets){
|
|
|
|
|
int cur_page = gtk_notebook_get_current_page(GTK_NOTEBOOK(widgets->Notebook));
|
|
|
|
|
@ -276,6 +276,9 @@ void yon_size_changed(GtkSpinButton *self, main_window *widgets){
|
|
|
|
|
|
|
|
|
|
void *yon_partitions_list_load(main_window *){
|
|
|
|
|
main_config.partitions = yon_config_load(yon_debug_output("%s\n",get_parts_for_device_command),&main_config.part_size);
|
|
|
|
|
for (int i=0;i<main_config.part_size;i++){
|
|
|
|
|
yon_char_remove_last_symbol(main_config.partitions[i],'\n');
|
|
|
|
|
}
|
|
|
|
|
g_thread_exit(NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -354,6 +357,7 @@ void on_device_selection_changed(GtkWidget *self, main_window *widgets){
|
|
|
|
|
void yon_devices_setup(main_window *widgets){
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
gtk_list_store_clear(widgets->DevicesList);
|
|
|
|
|
gtk_list_store_clear(widgets->PartitionsList);
|
|
|
|
|
// int size;
|
|
|
|
|
// config_str parameters = NULL;
|
|
|
|
|
// parameters = yon_config_load(yon_debug_output("%s\n",get_devices_command),&size);
|
|
|
|
|
@ -434,7 +438,7 @@ void yon_install_init(main_window *widgets, enum YON_PAGES page){
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case YON_PAGE_INSTALL_ADVANCED:
|
|
|
|
|
yon_install_advanced_init(widgets);
|
|
|
|
|
// yon_install_advanced_init(widgets);
|
|
|
|
|
return;
|
|
|
|
|
break;
|
|
|
|
|
case YON_PAGE_RECOVERY_GRUB_INSTALL:
|
|
|
|
|
@ -475,7 +479,7 @@ void yon_install_init(main_window *widgets, enum YON_PAGES page){
|
|
|
|
|
default:return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
char *device = config(AUTOINSTALL_DEVICE);
|
|
|
|
|
char *device = config(device_parameter);
|
|
|
|
|
char *part = config(part_parameter);
|
|
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(device)){
|
|
|
|
|
|