|
|
@ -1,7 +1,11 @@
|
|
|
|
#include "view_edit.h"
|
|
|
|
#include "view_edit.h"
|
|
|
|
|
|
|
|
|
|
|
|
edit_window *edit_widgets = NULL;
|
|
|
|
edit_window *edit_widgets = NULL;
|
|
|
|
|
|
|
|
edit_config obj_edit_config;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
edit_config* get_edit_config() {
|
|
|
|
|
|
|
|
return &obj_edit_config;
|
|
|
|
|
|
|
|
}
|
|
|
|
edit_window *edit_setup_window(char* glade_path){
|
|
|
|
edit_window *edit_setup_window(char* glade_path){
|
|
|
|
if (edit_widgets == NULL) {
|
|
|
|
if (edit_widgets == NULL) {
|
|
|
|
edit_widgets = malloc(sizeof(edit_window));
|
|
|
|
edit_widgets = malloc(sizeof(edit_window));
|
|
|
@ -38,10 +42,25 @@ edit_window *edit_setup_window(char* glade_path){
|
|
|
|
device_fill_disk(edit_widgets->cbtEditDevice);
|
|
|
|
device_fill_disk(edit_widgets->cbtEditDevice);
|
|
|
|
// edit_event(edit_widgets);
|
|
|
|
// edit_event(edit_widgets);
|
|
|
|
edit_localization(edit_widgets);
|
|
|
|
edit_localization(edit_widgets);
|
|
|
|
|
|
|
|
edit_config_init();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return edit_widgets;
|
|
|
|
return edit_widgets;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void edit_config_init() {
|
|
|
|
|
|
|
|
if (obj_edit_config.size != 0) {
|
|
|
|
|
|
|
|
philos_free_string_array(&obj_edit_config.disk, obj_edit_config.size);
|
|
|
|
|
|
|
|
philos_free_string_array(&obj_edit_config.i_o_limit_read, obj_edit_config.size);
|
|
|
|
|
|
|
|
philos_free_string_array(&obj_edit_config.i_o_limit_write, obj_edit_config.size);
|
|
|
|
|
|
|
|
philos_free_int_array(&obj_edit_config.i_o_limit_read_size, obj_edit_config.size);
|
|
|
|
|
|
|
|
philos_free_int_array(&obj_edit_config.i_o_limit_write_size, obj_edit_config.size);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
obj_edit_config.disk = NULL;
|
|
|
|
|
|
|
|
obj_edit_config.i_o_limit_read = NULL;
|
|
|
|
|
|
|
|
obj_edit_config.i_o_limit_write = NULL;
|
|
|
|
|
|
|
|
obj_edit_config.i_o_limit_read_size = NULL;
|
|
|
|
|
|
|
|
obj_edit_config.i_o_limit_write_size = NULL;
|
|
|
|
|
|
|
|
obj_edit_config.size = 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
void edit_event(edit_window *widgets) {
|
|
|
|
void edit_event(edit_window *widgets) {
|
|
|
|
g_signal_connect(G_OBJECT(widgets->btnEditCancel),"clicked",G_CALLBACK(edit_on_hide_subwindow),NULL);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->btnEditCancel),"clicked",G_CALLBACK(edit_on_hide_subwindow),NULL);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->Window), "destroy", G_CALLBACK(edit_destroy), NULL);
|
|
|
|
g_signal_connect(G_OBJECT(widgets->Window), "destroy", G_CALLBACK(edit_destroy), NULL);
|
|
|
@ -175,19 +194,20 @@ char* edit_get_limit_swap() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// =================================================================
|
|
|
|
// =================================================================
|
|
|
|
void edit_set_select_device(char* str_value) {
|
|
|
|
void edit_set_select_device(char** str_value) {
|
|
|
|
int index = yon_gtk_combo_box_text_find(edit_widgets->cbtEditDevice,str_value);
|
|
|
|
|
|
|
|
gtk_combo_box_set_active(GTK_COMBO_BOX(edit_widgets->cbtEditDevice), index);
|
|
|
|
//int index = yon_gtk_combo_box_text_find(edit_widgets->cbtEditDevice,str_value);
|
|
|
|
|
|
|
|
//gtk_combo_box_set_active(GTK_COMBO_BOX(edit_widgets->cbtEditDevice), index);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void edit_set_read_device(char* str_value, int pow_mem) {
|
|
|
|
void edit_set_read_device(char** str_value, int* pow_mem) {
|
|
|
|
edit_temp_set(str_value,pow_mem, edit_widgets->chbEditRead,
|
|
|
|
//edit_temp_set(str_value,pow_mem, edit_widgets->chbEditRead,
|
|
|
|
edit_widgets->spinEditRead,
|
|
|
|
// edit_widgets->spinEditRead,
|
|
|
|
edit_widgets->cbtEditRead);
|
|
|
|
// edit_widgets->cbtEditRead);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void edit_set_write_device(char* str_value, int pow_mem) {
|
|
|
|
void edit_set_write_device(char** str_value, int* pow_mem) {
|
|
|
|
edit_temp_set(str_value,pow_mem, edit_widgets->chbEditWrite,
|
|
|
|
// edit_temp_set(str_value,pow_mem, edit_widgets->chbEditWrite,
|
|
|
|
edit_widgets->spinEditWrite,
|
|
|
|
// edit_widgets->spinEditWrite,
|
|
|
|
edit_widgets->cbtEditWrite);
|
|
|
|
// edit_widgets->cbtEditWrite);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
void edit_set_soft(char* str_value, int pow_mem) {
|
|
|
|
void edit_set_soft(char* str_value, int pow_mem) {
|
|
|
|
edit_temp_set(str_value,pow_mem, edit_widgets->chkSoftRestrictionEdit,
|
|
|
|
edit_temp_set(str_value,pow_mem, edit_widgets->chkSoftRestrictionEdit,
|
|
|
|