- When bulk tasks are modified, the "project changed" messages are
  now retained until processing is completed, so that only one message
  per project is generated.
This commit is contained in:
Paul Beckingham 2012-03-03 09:46:11 -05:00
parent d4f85484df
commit 46b275c3ce
9 changed files with 95 additions and 13 deletions

View file

@ -65,6 +65,9 @@ int CmdDone::execute (std::string& output)
// Apply the command line modifications to the new task.
A3 modifications = context.a3.extract_modifications ();
// Accumulated project change notifications.
std::map <std::string, std::string> projectChanges;
bool nagged = false;
std::vector <Task>::iterator task;
for (task = filtered.begin (); task != filtered.end (); ++task)
@ -100,7 +103,7 @@ int CmdDone::execute (std::string& output)
if (!nagged)
nagged = nag (*task);
dependencyChainOnComplete (*task);
context.footnote (onProjectChange (*task, false));
projectChanges[task->get ("project")] = onProjectChange (*task, false);
}
else
{
@ -118,6 +121,12 @@ int CmdDone::execute (std::string& output)
}
}
// Now list the project changes.
std::map <std::string, std::string>::iterator i;
for (i = projectChanges.begin (); i != projectChanges.end (); ++i)
if (i->first != "")
context.footnote (i->second);
context.tdb2.commit ();
feedback_affected (count == 1 ? STRING_CMD_DONE_1 : STRING_CMD_DONE_N, count);
return rc;