mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Urgency/next
- Added 'urgency' as a reportable, sortable column. This will allow us to test the urgency coefficients. Note that this is experimental, and as such will not be documented.
This commit is contained in:
parent
77f3269f09
commit
1b66904550
2 changed files with 20 additions and 2 deletions
|
@ -53,6 +53,7 @@ static const char* internalNames[] =
|
|||
"status",
|
||||
"description",
|
||||
"tags",
|
||||
"urgency",
|
||||
// Note that annotations are not listed.
|
||||
};
|
||||
|
||||
|
@ -465,7 +466,8 @@ std::string Att::type (const std::string& name) const
|
|||
else if (name == "recur")
|
||||
return "duration";
|
||||
|
||||
else if (name == "limit")
|
||||
else if (name == "limit" ||
|
||||
name == "urgency")
|
||||
return "number";
|
||||
|
||||
else if (name == "priority")
|
||||
|
|
|
@ -541,6 +541,21 @@ int handleCustomReport (const std::string& report, std::string& outs)
|
|||
}
|
||||
}
|
||||
|
||||
else if (*col == "urgency")
|
||||
{
|
||||
table.addColumn (columnLabels[*col] != "" ? columnLabels[*col] : "Urgency");
|
||||
table.setColumnWidth (columnCount, Table::minimum);
|
||||
table.setColumnJustification (columnCount, Table::right);
|
||||
|
||||
int row = 0;
|
||||
foreach (task, tasks)
|
||||
{
|
||||
std::string value = format (task->urgency (), 1, 3);
|
||||
context.hooks.trigger ("format-urgency", "urgency", value);
|
||||
table.addCell (row++, columnCount, value);
|
||||
}
|
||||
}
|
||||
|
||||
// Common to all columns.
|
||||
// Add underline.
|
||||
if ((context.config.getBoolean ("color") || context.config.getBoolean ("_forcecolor")) &&
|
||||
|
@ -712,7 +727,8 @@ void validReportColumns (const std::vector <std::string>& columns)
|
|||
*it != "description_only" &&
|
||||
*it != "description" &&
|
||||
*it != "wait" &&
|
||||
*it != "depends")
|
||||
*it != "depends" &&
|
||||
*it != "urgency")
|
||||
bad.push_back (*it);
|
||||
|
||||
if (bad.size ())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue