|
|
|
|
@ -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_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;
|
|
|
|
|
}
|
|
|
|
|
// 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);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|