diff --git a/src/Att.cpp b/src/Att.cpp index c274dba29..157a49c53 100644 --- a/src/Att.cpp +++ b/src/Att.cpp @@ -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") diff --git a/src/custom.cpp b/src/custom.cpp index d4d4fc63d..399c5143f 100644 --- a/src/custom.cpp +++ b/src/custom.cpp @@ -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 & columns) *it != "description_only" && *it != "description" && *it != "wait" && - *it != "depends") + *it != "depends" && + *it != "urgency") bad.push_back (*it); if (bad.size ())