- Added feature #800, adding a new command 'columns' that lists all the columns
  available for custom reports, and includes their formatting options (thanks
  to T. Charles Yun).
This commit is contained in:
Paul Beckingham
2011-07-16 13:08:23 -04:00
parent 3a5370ddf1
commit 27a04b29f5
28 changed files with 372 additions and 64 deletions

View File

@@ -41,8 +41,16 @@ ColumnDepends::ColumnDepends ()
{
_name = "depends";
_type = "string";
_style = "default";
_style = "list";
_label = STRING_COLUMN_LABEL_DEP;
_styles.push_back ("list");
_styles.push_back ("count");
_styles.push_back ("indicator");
_examples.push_back ("1 2 10");
_examples.push_back ("[3]");
_examples.push_back (context.config.get ("dependency.indicator"));
}
////////////////////////////////////////////////////////////////////////////////
@@ -76,7 +84,8 @@ void ColumnDepends::measure (Task& task, int& minimum, int& maximum)
if (_style == "indicator") minimum = maximum = context.config.get ("dependency.indicator").length ();
else if (_style == "count") minimum = maximum = 2 + format ((int) blocking.size ()).length ();
else if (_style == "default")
else if (_style == "default" ||
_style == "list")
{
minimum = maximum = 0;
if (task.has ("depends"))
@@ -129,7 +138,8 @@ void ColumnDepends::render (
color.colorize (
rightJustify ("[" + format ((int)blocking.size ()) + "]", width)));
}
else if (_style == "default")
else if (_style == "default" ||
_style == "list")
{
std::vector <int> blocking_ids;
std::vector <Task>::iterator t;