|
|
|
|
@ -79,11 +79,6 @@ int yon_install_separate_save(main_window *widgets){
|
|
|
|
|
yon_config_register(part_format_parameter,part_format_parameter_command,"yes");
|
|
|
|
|
double part_size = gtk_spin_button_get_value(GTK_SPIN_BUTTON(widgets->NextInstallationSizeSpin));
|
|
|
|
|
int mod = yon_get_size_get_from_letter(gtk_combo_box_get_active_id(GTK_COMBO_BOX(widgets->NextInstallationSizeTypeSpin))[0]);
|
|
|
|
|
// if (yon_size_to_bytes(part_size,mod+1)>free_space){
|
|
|
|
|
// yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),NOT_ENOUGH_SPACE_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
// yon_ubl_status_highlight_incorrect(gtk_widget_get_parent(widgets->NextInstallationSizeSpin));
|
|
|
|
|
// return 0;
|
|
|
|
|
// }
|
|
|
|
|
if (yon_size_to_bytes(part_size,mod+1)>size){
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),NOT_ENOUGH_SPACE_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
yon_ubl_status_highlight_incorrect(gtk_widget_get_parent(widgets->NextInstallationSizeSpin));
|
|
|
|
|
@ -281,117 +276,14 @@ void yon_size_changed(GtkSpinButton *self, main_window *widgets){
|
|
|
|
|
chosen_size = yon_size_to_bytes(chosen_size,mod+1);
|
|
|
|
|
if (chosen_size>free_space&&size>chosen_size){
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),NOT_ENOUGH_FREE_SPACE_LABEL,5,BACKGROUND_IMAGE_INFO_TYPE);
|
|
|
|
|
// yon_ubl_status_highlight_incorrect(gtk_widget_get_parent(widgets->CommonInstallationDevicesTree));
|
|
|
|
|
return;
|
|
|
|
|
} else if (chosen_size>free_space&&chosen_size>size){
|
|
|
|
|
yon_ubl_status_box_spawn(GTK_CONTAINER(widgets->StatusBox),NOT_ENOUGH_SPACE_LABEL,5,BACKGROUND_IMAGE_FAIL_TYPE);
|
|
|
|
|
// yon_ubl_status_highlight_incorrect(gtk_widget_get_parent(widgets->CommonInstallationDevicesTree));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// void on_partition_size_changed(GtkWidget *self, main_window *widgets){
|
|
|
|
|
// GtkAdjustment *adj = NULL;
|
|
|
|
|
// GtkWidget *tree = NULL;
|
|
|
|
|
// if (self == widgets->OSFormatSizeCombo){
|
|
|
|
|
// adj = gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(widgets->OSFormatSizeSpin));
|
|
|
|
|
// tree = widgets->OSDevicesTree;
|
|
|
|
|
// } else if (self == widgets->UserdataFormatSizeCombo){
|
|
|
|
|
// adj = gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(widgets->UserdataFormatSizeSpin));
|
|
|
|
|
// tree = widgets->UserdataDevicesTree;
|
|
|
|
|
// } else if (self == widgets->NextInstallationSizeTypeSpin){
|
|
|
|
|
// adj = gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(widgets->NextInstallationSizeSpin));
|
|
|
|
|
// tree = widgets->NextInstallationSysSectionTree;
|
|
|
|
|
// }
|
|
|
|
|
// GtkTreeModel *model;
|
|
|
|
|
// GtkTreeIter iter;
|
|
|
|
|
// if (!gtk_tree_selection_get_selected(gtk_tree_view_get_selection(GTK_TREE_VIEW(tree)),&model,&iter)) return;
|
|
|
|
|
// long selected_size = 0;
|
|
|
|
|
|
|
|
|
|
// gtk_tree_model_get(model,&iter,6,&selected_size,-1);
|
|
|
|
|
// if (!selected_size){
|
|
|
|
|
// gtk_tree_model_get(model,&iter,5,&selected_size,-1);
|
|
|
|
|
// }
|
|
|
|
|
// const char *sizemod = gtk_combo_box_get_active_id(GTK_COMBO_BOX(self));
|
|
|
|
|
// double old_size = gtk_adjustment_get_value(adj);
|
|
|
|
|
// double new_size = yon_size_long_convert_to_mod(selected_size,sizemod[0]);
|
|
|
|
|
// gtk_adjustment_set_upper(adj,new_size);
|
|
|
|
|
// if (new_size<old_size){
|
|
|
|
|
// gtk_adjustment_set_value(adj,new_size);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// void yon_set_max_size_from_partition(GtkTreeView *table, GtkSpinButton *spin_button, GtkComboBox *spin_combo){
|
|
|
|
|
// GtkTreeModel *model;
|
|
|
|
|
// GtkTreeIter iter;
|
|
|
|
|
// long selected_size;
|
|
|
|
|
// if (gtk_tree_selection_get_selected(gtk_tree_view_get_selection(table),&model,&iter)){
|
|
|
|
|
// gtk_tree_model_get(model,&iter,6,&selected_size,-1);
|
|
|
|
|
// if (!selected_size){
|
|
|
|
|
// gtk_tree_model_get(model,&iter,5,&selected_size,-1);
|
|
|
|
|
// }
|
|
|
|
|
// if (selected_size){
|
|
|
|
|
// GtkAdjustment *adj = gtk_spin_button_get_adjustment(spin_button);
|
|
|
|
|
// const char *sizemod = gtk_combo_box_get_active_id(spin_combo);
|
|
|
|
|
// double new_size = yon_size_long_convert_to_mod(selected_size,sizemod[0]);
|
|
|
|
|
// gtk_adjustment_set_upper(adj,new_size);
|
|
|
|
|
// char *command = yon_config_parameter_prepare_command(part_size_parameter_command,"default",NULL,NULL);
|
|
|
|
|
// int size=0;
|
|
|
|
|
// config_str parsed = yon_config_load(command,&size);
|
|
|
|
|
// if (size&&strcmp(parsed[0],"(null)\n")){
|
|
|
|
|
// yon_char_remove_last_symbol(parsed[0],'\n');
|
|
|
|
|
// free(yon_char_divide_search(parsed[0],"=",-1));
|
|
|
|
|
// yon_char_remove_brackets(parsed[0]);
|
|
|
|
|
// char *parameter = parsed[0];
|
|
|
|
|
// if (!yon_char_is_empty(parameter)){
|
|
|
|
|
// gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin_button),atol(parameter));
|
|
|
|
|
// gtk_combo_box_set_active(GTK_COMBO_BOX(spin_combo),yon_get_size_get_from_letter(parameter[strlen(parameter)-1])-1);
|
|
|
|
|
// } else {
|
|
|
|
|
// gtk_spin_button_set_value(GTK_SPIN_BUTTON(spin_button),3);
|
|
|
|
|
// gtk_combo_box_set_active(GTK_COMBO_BOX(spin_combo),2);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// void yon_partition_default_size_set(GtkWidget *self, main_window *widgets){
|
|
|
|
|
// char *cur_size = config(part_size_parameter);
|
|
|
|
|
// if (yon_char_is_empty(cur_size)&&!yon_char_is_empty(main_config.part_size_default)) cur_size = main_config.part_size_default;
|
|
|
|
|
// if(yon_char_is_empty(cur_size)) return;
|
|
|
|
|
|
|
|
|
|
// GtkWidget *SizeSpin = NULL;
|
|
|
|
|
// GtkWidget *SizeCombo = NULL;
|
|
|
|
|
// if (self == widgets->OSSysSectionTree){
|
|
|
|
|
// SizeSpin = widgets->OSFormatSizeSpin;
|
|
|
|
|
// SizeCombo = widgets->OSFormatSizeCombo;
|
|
|
|
|
// } else if (self == widgets->UserdataSysSectionTree){
|
|
|
|
|
// SizeSpin = widgets->UserdataFormatSizeSpin;
|
|
|
|
|
// SizeCombo = widgets->UserdataFormatSizeCombo;
|
|
|
|
|
// } else if (self == widgets->NextInstallationSysSectionTree){
|
|
|
|
|
// SizeSpin = widgets->NextInstallationSizeSpin;
|
|
|
|
|
// SizeCombo = widgets->NextInstallationSizeTypeSpin;
|
|
|
|
|
// }
|
|
|
|
|
// if (!SizeSpin||!SizeCombo) return;
|
|
|
|
|
|
|
|
|
|
// char *sizemode = yon_char_new("\n");
|
|
|
|
|
// sizemode[0] = cur_size[strlen(cur_size)-1];
|
|
|
|
|
// gtk_combo_box_set_active_id(GTK_COMBO_BOX(SizeCombo),sizemode);
|
|
|
|
|
// // on_partition_size_changed(SizeCombo,widgets);
|
|
|
|
|
// long size = atol(cur_size);
|
|
|
|
|
// gtk_spin_button_set_value(GTK_SPIN_BUTTON(SizeSpin),size);
|
|
|
|
|
// free(sizemode);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// void on_partition_changed(GtkWidget *self, main_window *widgets){
|
|
|
|
|
// if (self==widgets->NextInstallationSysSectionTree||self == widgets->NextInstallationSizeTypeSpin){
|
|
|
|
|
// yon_partition_default_size_set(self,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);
|
|
|
|
|
g_thread_exit(NULL);
|
|
|
|
|
@ -435,14 +327,6 @@ void on_device_selection_changed(GtkWidget *self, main_window *widgets){
|
|
|
|
|
capacity = yon_char_unite(temp," ", size_str,NULL);
|
|
|
|
|
free(temp);
|
|
|
|
|
}
|
|
|
|
|
// if (parsed_size>8&&!yon_char_is_empty(parsed[8])){
|
|
|
|
|
// char sizemod='\0';
|
|
|
|
|
// free_space_long = capacity_long-atol(parsed[8]);
|
|
|
|
|
// char *temp = yon_char_from_double(yon_size_long_convert_automatic(free_space_long,&sizemod));
|
|
|
|
|
// char *size_str = yon_size_get_name_from_letter(sizemod);
|
|
|
|
|
// capacity = yon_char_unite(temp," ", size_str,parsed_size>9?" ":NULL,parsed[9],NULL);
|
|
|
|
|
// free(temp);
|
|
|
|
|
// }
|
|
|
|
|
if (parsed_size>4){
|
|
|
|
|
fs_type = parsed[4];
|
|
|
|
|
}
|
|
|
|
|
@ -474,8 +358,6 @@ void on_device_selection_changed(GtkWidget *self, main_window *widgets){
|
|
|
|
|
yon_char_parsed_free(parsed,parsed_size);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// gtk_spin_button_set_value(GTK_SPIN_BUTTON(widgets->NextInstallationSizeSpin),0.0);
|
|
|
|
|
// gtk_adjustment_set_upper(gtk_spin_button_get_adjustment(GTK_SPIN_BUTTON(widgets->NextInstallationSizeSpin)),0.0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -501,7 +383,6 @@ void yon_devices_setup(main_window *widgets){
|
|
|
|
|
3,yon_char_return_if_exist(size_string,""),
|
|
|
|
|
4,yon_char_return_if_exist(parsed[3],""),
|
|
|
|
|
6,1,-1);
|
|
|
|
|
// gtk_list_store_set(widgets->DevicesList,&iter,,1,json_object_get_string(model),2,json_object_get_string(serial),3,size_final_string,4,json_object_get_string(vendor),6,1,-1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
yon_char_parsed_free(parsed,parsed_size);
|
|
|
|
|
|