diff --git a/ChangeLog b/ChangeLog index 06ec27448..ae9d7a39c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -30,6 +30,8 @@ denotate command and the provided description (thanks to Dirk Deimeke). + Added support for more varied durations when specifying recurring tasks, such as '3 mths' or '24 hrs'. + + The ghistory graph bars can now be colored with 'color.history.add', + 'color.history.done' and 'color.history.delete' configuration variables. + Fixed bug #406 so that task now includes command aliases in the _commands helper command used by shell completion scripts. + Fixed bug #211 - it was unclear which commands modify a task description. diff --git a/doc/man/taskrc.5 b/doc/man/taskrc.5 index 203abf83e..4d16ebb2a 100644 --- a/doc/man/taskrc.5 +++ b/doc/man/taskrc.5 @@ -615,6 +615,19 @@ useful when tasks are displayed over multiple lines due to long descriptions or annotations. .RE +.TP +.B color.history.add=on red +.RE +.br +.B color.history.done=on green +.RE +.br +.B color.history.delete=on yellow +.RS +Colors the bars on the ghistory report graphs. Defaults to red, green and +yellow bars. +.RE + .SS SHADOW FILE .TP diff --git a/src/Config.cpp b/src/Config.cpp index 473fcea24..305aef63c 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -106,6 +106,9 @@ std::string Config::defaults = "color.calendar.weekend=bright white on black # Color of weekend days in calendar\n" "color.calendar.holiday=black on bright yellow # Color of public holidays in calendar\n" "color.calendar.weeknumber=black on white # Color of the weeknumbers in calendar\n" + "color.history.add=on red # Color of added tasks in ghistory report\n" + "color.history.done=on green # Color of completed tasks in ghistory report\n" + "color.history.delete=on yellow # Color of deleted tasks in ghistory report\n" "#color.debug=magenta # Color of diagnostic output\n" "\n" "# The following rules are presented in their order of precedence.\n" diff --git a/src/command.cpp b/src/command.cpp index 90c397dac..0fcd26013 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -659,6 +659,7 @@ int handleShow (std::string &outs) "color.alternate color.calendar.today color.calendar.due color.calendar.due.today " "color.calendar.overdue color.calendar.weekend color.calendar.holiday " "color.calendar.weeknumber color.summary.background color.summary.bar " + "color.history.add color.history.done color.history.delete " "confirmation curses data.location dateformat dateformat.holiday " "dateformat.report dateformat.annotation debug default.command " "default.priority default.project defaultwidth due locale displayweeknumber " diff --git a/src/report.cpp b/src/report.cpp index e10099581..1e0a06324 100644 --- a/src/report.cpp +++ b/src/report.cpp @@ -1266,9 +1266,9 @@ int handleReportGHistoryMonthly (std::string &outs) else table.setTableDashedUnderline (); - Color color_added (Color::black, Color::red); - Color color_completed (Color::black, Color::green); - Color color_deleted (Color::black, Color::yellow); + Color color_add (context.config.get ("color.history.add")); + Color color_done (context.config.get ("color.history.done")); + Color color_delete (context.config.get ("color.history.delete")); // Determine the longest line, and the longest "added" line. int maxAddedLine = 0; @@ -1350,9 +1350,9 @@ int handleReportGHistoryMonthly (std::string &outs) while (bar.length () < leftOffset - aBar.length ()) bar += " "; - bar += color_added.colorize (aBar); - bar += color_completed.colorize (cBar); - bar += color_deleted.colorize (dBar); + bar += color_add.colorize (aBar); + bar += color_done.colorize (cBar); + bar += color_delete.colorize (dBar); } else { @@ -1379,11 +1379,11 @@ int handleReportGHistoryMonthly (std::string &outs) if (context.config.getBoolean ("color") || context.config.getBoolean ("_forcecolor")) out << "Legend: " - << color_added.colorize ("added") + << color_add.colorize ("added") << ", " - << color_completed.colorize ("completed") + << color_done.colorize ("completed") << ", " - << color_deleted.colorize ("deleted") + << color_delete.colorize ("deleted") << optionalBlankLine () << std::endl; else @@ -1474,9 +1474,9 @@ int handleReportGHistoryAnnual (std::string &outs) else table.setTableDashedUnderline (); - Color color_added (Color::black, Color::red); - Color color_completed (Color::black, Color::green); - Color color_deleted (Color::black, Color::yellow); + Color color_add (context.config.get ("color.history.add")); + Color color_done (context.config.get ("color.history.done")); + Color color_delete (context.config.get ("color.history.delete")); // Determine the longest line, and the longest "added" line. int maxAddedLine = 0; @@ -1557,9 +1557,9 @@ int handleReportGHistoryAnnual (std::string &outs) while (bar.length () < leftOffset - aBar.length ()) bar += " "; - bar += color_added.colorize (aBar); - bar += color_completed.colorize (cBar); - bar += color_deleted.colorize (dBar); + bar += color_add.colorize (aBar); + bar += color_done.colorize (cBar); + bar += color_delete.colorize (dBar); } else { @@ -1586,11 +1586,11 @@ int handleReportGHistoryAnnual (std::string &outs) if (context.config.getBoolean ("color") || context.config.getBoolean ("_forcecolor")) out << "Legend: " - << color_added.colorize ("added") + << color_add.colorize ("added") << ", " - << color_completed.colorize ("completed") + << color_done.colorize ("completed") << ", " - << color_deleted.colorize ("deleted") + << color_delete.colorize ("deleted") << optionalBlankLine () << std::endl; else