|
|
|
@ -100,10 +100,9 @@ void edit_show(GtkWidget *self, char* glade_path) {
|
|
|
|
|
void wrapper_edit_init_windows_size_memory() {
|
|
|
|
|
philos_temp_add_disk(edit_widgets, &obj_edit_config, 0);
|
|
|
|
|
philos_temp_add_disk(edit_widgets, &obj_edit_config, 1);
|
|
|
|
|
philos_temp_del_disk(edit_widgets, &obj_edit_config, 0);
|
|
|
|
|
philos_temp_del_disk(edit_widgets, &obj_edit_config, 1);
|
|
|
|
|
//philos_temp_del_disk(edit_widgets, &obj_edit_config, 0);
|
|
|
|
|
//philos_temp_del_disk(edit_widgets, &obj_edit_config, 1);
|
|
|
|
|
edit_init_windows();
|
|
|
|
|
philos_temp_generate_cmd(edit_widgets, &obj_edit_config);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void edit_init_windows() {
|
|
|
|
@ -126,6 +125,7 @@ void combo_box_device_edit() {
|
|
|
|
|
g_signal_handlers_block_by_func(G_OBJECT(edit_widgets->chbTempWrite), G_CALLBACK(wrapper_edit_init_windows_size_memory), NULL);
|
|
|
|
|
philos_update_device_to_entry(edit_widgets, &obj_edit_config, 0);
|
|
|
|
|
philos_update_device_to_entry(edit_widgets, &obj_edit_config, 1);
|
|
|
|
|
obj_edit_config.block_table = 1;
|
|
|
|
|
g_signal_handlers_unblock_by_func(G_OBJECT(edit_widgets->cbtTempDevice), G_CALLBACK(combo_box_device_edit), NULL);
|
|
|
|
|
g_signal_handlers_unblock_by_func(G_OBJECT(edit_widgets->cbtTempRead), G_CALLBACK(wrapper_edit_init_windows_size_memory), NULL);
|
|
|
|
|
g_signal_handlers_unblock_by_func(G_OBJECT(edit_widgets->cbtTempWrite), G_CALLBACK(wrapper_edit_init_windows_size_memory), NULL);
|
|
|
|
@ -133,6 +133,7 @@ void combo_box_device_edit() {
|
|
|
|
|
g_signal_handlers_unblock_by_func(G_OBJECT(edit_widgets->spinTempWrite), G_CALLBACK(wrapper_edit_init_windows_size_memory), NULL);
|
|
|
|
|
g_signal_handlers_unblock_by_func(G_OBJECT(edit_widgets->chbTempRead), G_CALLBACK(wrapper_edit_init_windows_size_memory), NULL);
|
|
|
|
|
g_signal_handlers_unblock_by_func(G_OBJECT(edit_widgets->chbTempWrite), G_CALLBACK(wrapper_edit_init_windows_size_memory), NULL);
|
|
|
|
|
obj_edit_config.block_table = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int edit_get_soft_size() {
|
|
|
|
@ -212,10 +213,6 @@ void edit_set_select_read_device(char*** str_value) {
|
|
|
|
|
if (str_value) {
|
|
|
|
|
if ((*str_value)) {
|
|
|
|
|
yon_char_parsed_copy(&obj_edit_config.disk_read, str_value);
|
|
|
|
|
if ((*str_value)[0] != NULL && strstr((*str_value)[0], "-") == NULL) {
|
|
|
|
|
int index = yon_gtk_combo_box_text_find(edit_widgets->cbtTempDevice, (*str_value)[0]);
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(edit_widgets->cbtTempDevice), index);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -223,34 +220,54 @@ void edit_set_select_write_device(char*** str_value) {
|
|
|
|
|
if (str_value) {
|
|
|
|
|
if ((*str_value)) {
|
|
|
|
|
yon_char_parsed_copy(&obj_edit_config.disk_write, str_value);
|
|
|
|
|
if ((*str_value)[0] != NULL && strstr((*str_value)[0], "-") == NULL) {
|
|
|
|
|
int index = yon_gtk_combo_box_text_find(edit_widgets->cbtTempDevice, (*str_value)[0]);
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(edit_widgets->cbtTempDevice), index);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void edit_set_read_device(int* str_value, int* pow_mem) {
|
|
|
|
|
if (str_value && pow_mem) {
|
|
|
|
|
if (str_value[0] >=0 && pow_mem[0] >=0) {
|
|
|
|
|
int set_template_gui_device(int flag_check_array) {
|
|
|
|
|
int index = -1;
|
|
|
|
|
if (flag_check_array==0) {
|
|
|
|
|
index = yon_gtk_combo_box_text_find(edit_widgets->cbtTempDevice, obj_edit_config.disk_read[0]);
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(edit_widgets->cbtTempDevice), index);
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(edit_widgets->chbTempRead), 1);
|
|
|
|
|
edit_temp_set(str_value[0],pow_mem[0], edit_widgets->chbTempRead,
|
|
|
|
|
edit_temp_set(obj_edit_config.i_o_limit_read[0],
|
|
|
|
|
obj_edit_config.i_o_limit_read_size[0], edit_widgets->chbTempRead,
|
|
|
|
|
edit_widgets->spinTempRead,
|
|
|
|
|
edit_widgets->cbtTempRead);
|
|
|
|
|
}
|
|
|
|
|
else if (flag_check_array==1) {
|
|
|
|
|
index = yon_gtk_combo_box_text_find(edit_widgets->cbtTempDevice, obj_edit_config.disk_write[0]);
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(edit_widgets->cbtTempDevice), index);
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(edit_widgets->chbTempWrite), 1);
|
|
|
|
|
edit_temp_set(obj_edit_config.i_o_limit_write[0],
|
|
|
|
|
obj_edit_config.i_o_limit_write_size[0],
|
|
|
|
|
edit_widgets->chbTempWrite,
|
|
|
|
|
edit_widgets->spinTempWrite,
|
|
|
|
|
edit_widgets->cbtTempWrite);
|
|
|
|
|
}
|
|
|
|
|
return index;
|
|
|
|
|
}
|
|
|
|
|
void set_gui_device() {
|
|
|
|
|
int flag = -1;
|
|
|
|
|
if (obj_edit_config.disk_read && flag == -1) {
|
|
|
|
|
if (obj_edit_config.disk_read[0] != NULL && strstr(obj_edit_config.disk_read[0], "-") == NULL) {
|
|
|
|
|
flag = set_template_gui_device(0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (obj_edit_config.disk_write && flag == -1) {
|
|
|
|
|
if (obj_edit_config.disk_write[0] != NULL && strstr(obj_edit_config.disk_write[0], "-") == NULL) {
|
|
|
|
|
flag = set_template_gui_device(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void edit_set_read_device(int* str_value, int* pow_mem) {
|
|
|
|
|
if (str_value && pow_mem) {
|
|
|
|
|
philos_array_int_copy(&obj_edit_config.i_o_limit_read, &str_value);
|
|
|
|
|
philos_array_int_copy(&obj_edit_config.i_o_limit_read_size, &pow_mem);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
void edit_set_write_device(int* str_value, int* pow_mem) {
|
|
|
|
|
if (str_value && pow_mem) {
|
|
|
|
|
if (str_value[0] >=0 && pow_mem[0] >=0) {
|
|
|
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(edit_widgets->chbTempWrite), 1);
|
|
|
|
|
edit_temp_set(str_value[0],pow_mem[0], edit_widgets->chbTempWrite,
|
|
|
|
|
edit_widgets->spinTempWrite,
|
|
|
|
|
edit_widgets->cbtTempWrite);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
philos_array_int_copy(&obj_edit_config.i_o_limit_write, &str_value);
|
|
|
|
|
philos_array_int_copy(&obj_edit_config.i_o_limit_write_size, &pow_mem);
|
|
|
|
|
}
|
|
|
|
|