+
+ model = gtk_tree_view_get_model(GTK_TREE_VIEW(w_treeview));
+ gtk_list_store_clear(GTK_LIST_STORE(model));
+
+ if (current_tasks) {
+ for (tasks_cur = current_tasks; *tasks_cur; tasks_cur++) {
+ task = (*tasks_cur);
+
+ if (task->project)
+ prj = task->project;
+ else
+ prj = "";
+
+ if (prj_filter && strcmp(prj, prj_filter))
+ continue;
+
+ gtk_list_store_append(GTK_LIST_STORE(model), &iter);
+
+ gtk_list_store_set(GTK_LIST_STORE(model),
+ &iter,
+ COL_ID,
+ (*tasks_cur)->id,
+ COL_DESCRIPTION,
+ (*tasks_cur)->description,
+ COL_PROJECT,
+ prj,
+ COL_UUID,
+ (*tasks_cur)->uuid,
+ COL_PRIORITY,
+ (*tasks_cur)->priority,
+ COL_URGENCY,
+ (*tasks_cur)->urgency,
+ -1);
+
+ if ((*tasks_cur)->start) {
+ s = tm_to_str((*tasks_cur)->start);
+ gtk_list_store_set
+ (GTK_LIST_STORE(model),
+ &iter,
+ COL_START,
+ s,
+ -1);
+ free(s);
+ }
+
+ if ((*tasks_cur)->due) {
+ s = tm_to_str((*tasks_cur)->due);
+ gtk_list_store_set
+ (GTK_LIST_STORE(model),
+ &iter,
+ COL_DUE,
+ s,
+ -1);
+ free(s);
+ }
+
+ if ((*tasks_cur)->entry) {
+ s = tm_to_str((*tasks_cur)->entry);
+ gtk_list_store_set
+ (GTK_LIST_STORE(model),
+ &iter,
+ COL_CREATION_DATE,
+ s,
+ -1);
+ free(s);
+ }
+ }
+ }
+
+}
+
+void ui_tasktree_update_filter(const char *prj_filter)
+{
+ ui_tasktree_update(current_tasks, prj_filter);
+}
+
+gboolean tasktree_button_press_event_cbk(GtkWidget *widget,
+ GdkEventButton *evt,
+ gpointer data)
+{
+ log_fct_enter();
+
+ if (evt->button == 3)
+ gtk_menu_popup(w_menu,
+ NULL, NULL, NULL, NULL, evt->button, evt->time);
+
+ log_fct_exit();
+
+ return FALSE;
+}
+
+void tasktree_visible_activate_cbk(GtkAction *action, gpointer data)
+{
+ gboolean b;
+ int id;
+ const char *aname, *key;
+
+ aname = gtk_action_get_name(action);
+
+ if (!strcmp(aname, "tasktree_id_visible"))
+ id = COL_ID;
+ else if (!strcmp(aname, "tasktree_description_visible"))
+ id = COL_DESCRIPTION;
+ else if (!strcmp(aname, "tasktree_project_visible"))
+ id = COL_PROJECT;
+ else if (!strcmp(aname, "tasktree_uuid_visible"))
+ id = COL_UUID;
+ else if (!strcmp(aname, "tasktree_priority_visible"))
+ id = COL_PRIORITY;
+ else if (!strcmp(aname, "tasktree_urgency_visible"))
+ id = COL_URGENCY;
+ else if (!strcmp(aname, "tasktree_creation_date_visible"))
+ id = COL_CREATION_DATE;
+ else if (!strcmp(aname, "tasktree_due_visible"))
+ id = COL_DUE;
+ else if (!strcmp(aname, "tasktree_start_visible"))
+ id = COL_START;
+ else
+ id = -1;
+
+ if (id != -1) {
+ key = SETTINGS_VISIBLE_COL_KEYS[id];
+ b = settings_get_boolean(key);
+ settings_set_boolean(key, !b);
+ gtk_tree_view_column_set_visible(w_cols[id], !b);
+ }