mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Deletion
- 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:
parent
28133f8567
commit
fce2469f41
3 changed files with 21 additions and 7 deletions
|
@ -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 ();
|
||||
}
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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."
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue