From 17c605502cb02dacf962f8f54704285ed94cd5b1 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 25 Mar 2012 17:57:55 -0400 Subject: [PATCH] Feature - Added new 'indented' format for the 'project' attribute. Note that this is really only useful when a report is sorted by project. --- ChangeLog | 7 ++++++- src/columns/ColProject.cpp | 16 ++++++++++++++-- src/en-US.h | 1 + 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 432fbd32e..06d4acc1f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,9 +2,14 @@ ------ current release --------------------------- 2.0.1 () + +Features + + Added the new 'indented' format for the 'project' attribute. + +Bugs + + Fixed grammar in feedback string (thanks to Uli Martens). + Addressed valgrind complaints (thanks to Bryce Harrington). + Removed default configuration value for the obsolete 'annotations' setting. - + Fixed grammar in feedback string (thanks to Uli Martens). ------ old releases ------------------------------ diff --git a/src/columns/ColProject.cpp b/src/columns/ColProject.cpp index 62dc4f766..a5e1bf6cd 100644 --- a/src/columns/ColProject.cpp +++ b/src/columns/ColProject.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include extern Context context; @@ -44,9 +45,11 @@ ColumnProject::ColumnProject () _styles.push_back ("full"); _styles.push_back ("parent"); + _styles.push_back ("indented"); _examples.push_back (STRING_COLUMN_EXAMPLES_PROJ); _examples.push_back (STRING_COLUMN_EXAMPLES_PAR); + _examples.push_back (STRING_COLUMN_EXAMPLES_IND); _hyphenate = context.config.getBoolean ("hyphenate"); } @@ -74,8 +77,13 @@ void ColumnProject::measure (Task& task, int& minimum, int& maximum) if (period != std::string::npos) project = project.substr (0, period); } - else if (_style != "default" && - _style != "full") + else if (_style == "indented") + { + project = indentProject (project, " ", '.'); + } + else if (_style != "default" && + _style != "full" && + _style != "indented") throw format (STRING_COLUMN_BAD_FORMAT, _name, _style); minimum = longestWord (project); @@ -96,6 +104,10 @@ void ColumnProject::render ( if (period != std::string::npos) project = project.substr (0, period); } + else if (_style == "indented") + { + project = indentProject (project, " ", '.'); + } std::vector raw; wrapText (raw, project, width, _hyphenate); diff --git a/src/en-US.h b/src/en-US.h index e3babf7d2..735123e1d 100644 --- a/src/en-US.h +++ b/src/en-US.h @@ -187,6 +187,7 @@ #define STRING_COLUMN_EXAMPLES_TAGS "home @chore" #define STRING_COLUMN_EXAMPLES_PROJ "home.garden" #define STRING_COLUMN_EXAMPLES_PAR "home" +#define STRING_COLUMN_EXAMPLES_IND " home.garden" #define STRING_COLUMN_EXAMPLES_DESC "Move your clothes down on to the lower peg" #define STRING_COLUMN_EXAMPLES_ANNO1 "Immediately before your lunch" #define STRING_COLUMN_EXAMPLES_ANNO2 "If you are playing in the match this afternoon"