|
|
|
@ -517,9 +517,49 @@ int yon_advanced_save(main_window *widgets){
|
|
|
|
char *encryption[2] = {NULL};
|
|
|
|
char *encryption[2] = {NULL};
|
|
|
|
char *format[2] = {NULL};
|
|
|
|
char *format[2] = {NULL};
|
|
|
|
if (!sections_size){
|
|
|
|
if (!sections_size){
|
|
|
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_COMBO_BOX(widgets->StatusBox),NOTHING_CHOSEN_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
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];
|
|
|
|
|
|
|
|
if (cur_section->part_source == PART_SOURCE_VIRTUAL){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
yon_char_parsed_free(parsed,parsed_size);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!yon_char_is_empty(device)){
|
|
|
|
|
|
|
|
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[3]),5,BACKGROUND_IMAGE_INFO_TYPE);
|
|
|
|
|
|
|
|
yon_ubl_status_highlight_incorrect(widgets->AdvancedVirtualDeviceCombo);
|
|
|
|
|
|
|
|
yon_char_parsed_free(cur_device,4);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
if (!yon_char_is_empty(cur_section->partition)){
|
|
|
|
if (!yon_char_is_empty(cur_section->partition)){
|
|
|
|
if (!yon_char_is_empty(cur_section->partition)){
|
|
|
|
if (!yon_char_is_empty(cur_section->partition)){
|
|
|
|
parts[0]=cur_section->partition;
|
|
|
|
parts[0]=cur_section->partition;
|
|
|
|
@ -814,12 +854,10 @@ void on_advanced_virtual_device_changed(GtkWidget *, main_window *widgets){
|
|
|
|
char *device = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->AdvancedVirtualDeviceCombo));
|
|
|
|
char *device = (char*)gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->AdvancedVirtualDeviceCombo));
|
|
|
|
int size;
|
|
|
|
int size;
|
|
|
|
config_str vfs_file = yon_resource_open_file(vfs_list_path,&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++){
|
|
|
|
for (int i=0;i<size;i++){
|
|
|
|
int parsed_size;
|
|
|
|
int parsed_size;
|
|
|
|
config_str parsed = yon_char_parse(vfs_file[i],&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)){
|
|
|
|
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]);
|
|
|
|
gtk_label_set_text(GTK_LABEL(widgets->AdvancedVirtualDeviceLabel),parsed[1]);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
yon_char_parsed_free(parsed,parsed_size);
|
|
|
|
yon_char_parsed_free(parsed,parsed_size);
|
|
|
|
@ -834,19 +872,6 @@ void on_advanced_virtual_device_changed(GtkWidget *, main_window *widgets){
|
|
|
|
gtk_tree_model_get(model,&iter,5,&status,-1);
|
|
|
|
gtk_tree_model_get(model,&iter,5,&status,-1);
|
|
|
|
if (status) active_devices++;
|
|
|
|
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[3]),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();
|
|
|
|
advanced_section *section = yon_advanced_section_new();
|
|
|
|
section->part_source = PART_SOURCE_VIRTUAL;
|
|
|
|
section->part_source = PART_SOURCE_VIRTUAL;
|
|
|
|
|