- model = gtk_tree_view_get_model(GTK_TREE_VIEW(w_treeview));
- gtk_list_store_clear(GTK_LIST_STORE(model));
- for (tasks_cur = tasks, i = 0; *tasks_cur; tasks_cur++, i++) {
- task = (*tasks_cur);
-
- gtk_list_store_append(GTK_LIST_STORE(model), &iter);
-
- if (task->project)
- project = task->project;
- else
- project = "";
-
- gtk_list_store_set(GTK_LIST_STORE(model),
- &iter,
- COL_ID, (*tasks_cur)->id,
- COL_DESCRIPTION, (*tasks_cur)->description,
- COL_PROJECT, project,
- COL_UUID, (*tasks_cur)->uuid,
- COL_PRIORITY, (*tasks_cur)->priority,
- -1);
- }
- printf("refresh done\n");
-}
-
-int taskdone_clicked_cbk(GtkButton *btn, gpointer data)
-{
- struct task *task;
-
- task = get_selected_task(GTK_TREE_VIEW(w_treeview));
- tw_done(task->uuid);
- refresh();
-
- return FALSE;
-}
-
-static int tasksave_clicked_cbk(GtkButton *btn, gpointer data)
-{
- struct task *task;
- GtkTextBuffer *buf;
- char *txt, *pri;
- GtkTextIter sIter, eIter;
- const char *ctxt;
- int priority;
-
- task = get_selected_task(GTK_TREE_VIEW(w_treeview));
-
- printf("tasksave_clicked_cbk %d\n", task->id);
-
- buf = gtk_text_view_get_buffer(w_note);
-
- gtk_text_buffer_get_iter_at_offset(buf, &sIter, 0);
- gtk_text_buffer_get_iter_at_offset(buf, &eIter, -1);
- txt = gtk_text_buffer_get_text(buf, &sIter, &eIter, TRUE);
-
- printf("note=%s\n", txt);
-
- if (!task->note || strcmp(txt, task->note))
- note_put(task->uuid, txt);
-
- ctxt = gtk_entry_get_text(w_description);
- if (!task->description || strcmp(ctxt, task->description))
- tw_modify_description(task->uuid, ctxt);
-
- ctxt = gtk_entry_get_text(w_project);
- if (!task->project || strcmp(ctxt, task->project))
- tw_modify_project(task->uuid, ctxt);
-
- priority = gtk_combo_box_get_active(w_priority);
- printf("priority: %d\n", priority);
-
- switch (priority) {
- case 3:
- pri = "H";
- break;
- case 2:
- pri = "M";
- break;
- case 1:
- pri = "L";
- break;
- default:
- pri = "";