mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
TW-1710: Setting wait date on status:completed / status:deleted
- Thanks to Daniel Shahaf.
This commit is contained in:
parent
8275181022
commit
b61471ca0e
11 changed files with 23 additions and 0 deletions
12
src/Task.cpp
12
src/Task.cpp
|
@ -1954,6 +1954,9 @@ void Task::modify (modType type, bool text_required /* = false */)
|
|||
context.debug ("Task::modify");
|
||||
std::string label = " [1;37;43mMODIFICATION[0m ";
|
||||
|
||||
// Need this for later comparison.
|
||||
auto originalStatus = getStatus ();
|
||||
|
||||
std::string text = "";
|
||||
bool mods = false;
|
||||
for (auto& a : context.cli2._args)
|
||||
|
@ -2084,6 +2087,15 @@ void Task::modify (modType type, bool text_required /* = false */)
|
|||
}
|
||||
else if (! mods && text_required)
|
||||
throw std::string (STRING_CMD_MODIFY_NEED_TEXT);
|
||||
|
||||
// Modifying completed/deleted tasks generates a message, if the modification
|
||||
// does not change status.
|
||||
if ((getStatus () == Task::completed || getStatus () == Task::deleted) &&
|
||||
getStatus () == originalStatus)
|
||||
{
|
||||
auto uuid = get ("uuid").substr (0, 8);
|
||||
context.footnote (format (STRING_CMD_MODIFY_INACTIVE, uuid, get ("status"), uuid));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue