- Allows the deletion of an already-completed task, provided it is
  addressed by UUID.
- Displays UUID in cases where there is no ID.
This commit is contained in:
Paul Beckingham 2011-10-22 23:44:54 -04:00
parent 28133f8567
commit fce2469f41
3 changed files with 21 additions and 7 deletions

View file

@ -568,7 +568,14 @@ void TDB2::synch ()
{
context.timer_synch.start ();
// TODO Need stub here.
// TODO Get local synch_key.
// TODO Get backlog.
// TODO Compose synch ticket.
// TODO Issue synch ticket.
// TODO Receive synch response.
// TODO Extract remotes.
// TODO Apply remotes.
// TODO Store synch_key.
context.timer_synch.stop ();
}

View file

@ -71,13 +71,20 @@ int CmdDelete::execute (std::string& output)
{
Task before (*task);
if (task->getStatus () == Task::pending ||
if (task->getStatus () == Task::pending ||
task->getStatus () == Task::completed ||
task->getStatus () == Task::waiting)
{
// Delete the specified task.
std::string question = format (STRING_CMD_DELETE_CONFIRM,
task->id,
task->get ("description"));
std::string question;
if (task->id)
question = format (STRING_CMD_DELETE_CONFIRM,
task->id,
task->get ("description"));
else
question = format (STRING_CMD_DELETE_CONFIRM,
task->get ("uuid"),
task->get ("description"));
modify_task_annotate (*task, modifications);
task->setStatus (Task::deleted);
@ -133,7 +140,7 @@ int CmdDelete::execute (std::string& output)
}
else
{
std::cout << format (STRING_CMD_DELETE_NOTPEND,
std::cout << format (STRING_CMD_DELETE_NOT_DEL,
task->id,
task->get ("description"))
<< "\n";

View file

@ -297,7 +297,7 @@
#define STRING_CMD_DELETE_TASK_R "Deleting recurring task {1} '{2}'."
#define STRING_CMD_DELETE_CONFIRM_R "This is a recurring task. Do you want to delete all pending recurrences of this same task?"
#define STRING_CMD_DELETE_NO "Task not deleted."
#define STRING_CMD_DELETE_NOTPEND "Task {1} '{2}' is neither pending nor waiting."
#define STRING_CMD_DELETE_NOT_DEL "Task {1} '{2}' is not deletable."
#define STRING_CMD_DELETE_1 "Deleted {1} task."
#define STRING_CMD_DELETE_N "Deleted {1} tasks."