|
|
|
@ -115,8 +115,14 @@ void unlock_spin_time(hotebook* widgets,void (*f)()) {
|
|
|
|
|
g_signal_handlers_unblock_by_func(G_OBJECT(widgets->spinMinutesFile), G_CALLBACK(f), NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void block_tree_view(hotebook* widgets,void (*f)()) {
|
|
|
|
|
g_signal_handlers_block_by_func(G_OBJECT(widgets->tree_view), G_CALLBACK(f), NULL);
|
|
|
|
|
}
|
|
|
|
|
void unlock_tree_view(hotebook* widgets,void (*f)()) {
|
|
|
|
|
g_signal_handlers_unblock_by_func(G_OBJECT(widgets->tree_view), G_CALLBACK(f), NULL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void entry_user_disk(GtkWidget *self,int* flag_update) {
|
|
|
|
|
block_spin_time(&cfg_custom_gui.user, wrapper_get_spin_time_gui_user);
|
|
|
|
|
if (flag_update) {
|
|
|
|
|
all_config->flag_set_data = 1;
|
|
|
|
|
all_config->flag_save = 3;
|
|
|
|
@ -130,12 +136,8 @@ void entry_user_disk(GtkWidget *self,int* flag_update) {
|
|
|
|
|
g_object_ref(cfg_custom_gui.user.liststore);
|
|
|
|
|
gtk_list_store_clear(cfg_custom_gui.user.liststore);
|
|
|
|
|
}
|
|
|
|
|
unlock_spin_time(&cfg_custom_gui.user, wrapper_get_spin_time_gui_user);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
void entry_groups_disk(GtkWidget *self,int* flag_update) {
|
|
|
|
|
block_spin_time(&cfg_custom_gui.group, wrapper_get_spin_time_gui_group);
|
|
|
|
|
if (flag_update) {
|
|
|
|
|
all_config->flag_set_data = 1;
|
|
|
|
|
all_config->flag_save = 3;
|
|
|
|
@ -149,10 +151,8 @@ void entry_groups_disk(GtkWidget *self,int* flag_update) {
|
|
|
|
|
g_object_ref(cfg_custom_gui.group.liststore);
|
|
|
|
|
gtk_list_store_clear(cfg_custom_gui.group.liststore);
|
|
|
|
|
}
|
|
|
|
|
unlock_spin_time(&cfg_custom_gui.group, wrapper_get_spin_time_gui_group);
|
|
|
|
|
}
|
|
|
|
|
void entry_project_disk(GtkWidget *self,int* flag_update) {
|
|
|
|
|
block_spin_time(&cfg_custom_gui.project, wrapper_get_spin_time_gui_project);
|
|
|
|
|
if (flag_update) {
|
|
|
|
|
all_config->flag_set_data = 1;
|
|
|
|
|
all_config->flag_save = 3;
|
|
|
|
@ -163,17 +163,28 @@ void entry_project_disk(GtkWidget *self,int* flag_update) {
|
|
|
|
|
g_object_ref(cfg_custom_gui.project.liststore);
|
|
|
|
|
gtk_list_store_clear(cfg_custom_gui.project.liststore);
|
|
|
|
|
}
|
|
|
|
|
unlock_spin_time(&cfg_custom_gui.project, wrapper_get_spin_time_gui_project);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void tree_view_select_user(GtkWidget* self) {
|
|
|
|
|
block_tree_view(&cfg_custom_gui.user,tree_view_select_user);
|
|
|
|
|
block_spin_time(&cfg_custom_gui.user, wrapper_get_spin_time_gui_user);
|
|
|
|
|
tree_view_select(NULL,&all_config->v_user , &cfg_custom_gui.user);
|
|
|
|
|
unlock_spin_time(&cfg_custom_gui.user, wrapper_get_spin_time_gui_user);
|
|
|
|
|
unlock_tree_view(&cfg_custom_gui.user,tree_view_select_user);
|
|
|
|
|
}
|
|
|
|
|
void tree_view_select_group(GtkWidget* sel) {
|
|
|
|
|
block_tree_view(&cfg_custom_gui.group,tree_view_select_group);
|
|
|
|
|
block_spin_time(&cfg_custom_gui.group, wrapper_get_spin_time_gui_group);
|
|
|
|
|
tree_view_select(NULL,&all_config->v_group ,&cfg_custom_gui.group);
|
|
|
|
|
unlock_spin_time(&cfg_custom_gui.group, wrapper_get_spin_time_gui_group);
|
|
|
|
|
unlock_tree_view(&cfg_custom_gui.group,tree_view_select_group);
|
|
|
|
|
}
|
|
|
|
|
void tree_view_select_project(GtkWidget* self) {
|
|
|
|
|
block_tree_view(&cfg_custom_gui.project,tree_view_select_project);
|
|
|
|
|
block_spin_time(&cfg_custom_gui.project, wrapper_get_spin_time_gui_project);
|
|
|
|
|
tree_view_select(NULL,&all_config->v_project , &cfg_custom_gui.project);
|
|
|
|
|
unlock_spin_time(&cfg_custom_gui.project, wrapper_get_spin_time_gui_project);
|
|
|
|
|
unlock_tree_view(&cfg_custom_gui.group, wrapper_get_spin_time_gui_project);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -207,7 +218,6 @@ void wrapper_get_spin_time_gui_user() {
|
|
|
|
|
void wrapper_get_spin_time_gui_group() {
|
|
|
|
|
get_spin_time_gui(&all_config->v_group, &cfg_custom_gui.group);
|
|
|
|
|
entry_groups_disk(0, 0);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void wrapper_get_spin_time_gui_project() {
|
|
|
|
@ -222,16 +232,17 @@ void get_spin_time_gui(vector* vec_u_g_p, hotebook* widgets) {
|
|
|
|
|
int spin_days_size = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widgets->spinDaysSize));
|
|
|
|
|
int spin_hours_size = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widgets->spinHoursSize));
|
|
|
|
|
int spin_minutes_size = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widgets->spinMinutesSize));
|
|
|
|
|
int second_size = spin_week_size*7*24*3600+spin_days_size*24*3600+spin_hours_size*3600+spin_minutes_size*60;
|
|
|
|
|
size_t second_size = spin_week_size*7*24*3600+spin_days_size*24*3600+spin_hours_size*3600+spin_minutes_size*60;
|
|
|
|
|
int spin_week_file = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widgets->spinWeeksFile));
|
|
|
|
|
int spin_days_file = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widgets->spinDaysFile));
|
|
|
|
|
int spin_hours_file = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widgets->spinHoursFile));
|
|
|
|
|
int spin_minutes_file = gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(widgets->spinMinutesFile));
|
|
|
|
|
int second_file = spin_week_file*7*24*3600+spin_days_file*24*3600+spin_hours_file*3600+spin_minutes_file*60;
|
|
|
|
|
size_t second_file = spin_week_file*7*24*3600+spin_days_file*24*3600+spin_hours_file*3600+spin_minutes_file*60;
|
|
|
|
|
|
|
|
|
|
set_time_spin(widgets,second_file, second_size);
|
|
|
|
|
_config->deferring_size = second_size;
|
|
|
|
|
_config->deferring_file = second_file;
|
|
|
|
|
vec_u_g_p->pfVectorSet(vec_u_g_p, index_selected, _config);
|
|
|
|
|
set_time_spin(widgets,_config->deferring_file, _config->deferring_size);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -276,9 +287,15 @@ void project_remove() {
|
|
|
|
|
}
|
|
|
|
|
template_remove(&all_config->v_project , &cfg_custom_gui.project);
|
|
|
|
|
}
|
|
|
|
|
int tree_view_edit(config_all* _all_config, vector* vec_temp, hotebook* widgets) {
|
|
|
|
|
int index = wrapper_select_tree_view(widgets);
|
|
|
|
|
if (index >= 0) {
|
|
|
|
|
config_u_g_p* _config = (config_u_g_p*)vec_temp->pfVectorGet(vec_temp, index);
|
|
|
|
|
set_time_spin(widgets,_config->deferring_file, _config->deferring_size);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int wrapper_select_tree_view(hotebook* widgets) {
|
|
|
|
|
|
|
|
|
|
int index = 0;
|
|
|
|
|
GtkTreeIter iter;
|
|
|
|
|
GtkTreeModel *model = GTK_TREE_MODEL(widgets->liststore);
|
|
|
|
@ -289,7 +306,6 @@ int wrapper_select_tree_view(hotebook* widgets) {
|
|
|
|
|
index_selected = index;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
//index_selected = -1;
|
|
|
|
|
}
|
|
|
|
|
return index;
|
|
|
|
|
}
|
|
|
|
|