- 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 = "";
+ GtkWidget *dialog;
+ const char *current_prj, *current_uuid;
+ struct task **old_tasks;
+
+ log_fct_enter();
+ ui_taskpanel_update(NULL);
+
+ if (tasks) {
+ old_tasks = tasks;
+ current_prj = ui_projecttree_get_project();
+ current_uuid = ui_tasktree_get_task_uuid();
+ ui_tasktree_update(NULL, NULL);
+ } else {
+ old_tasks = NULL;
+ current_prj = NULL;
+ current_uuid = NULL;