Minor cleanup.

This commit is contained in:
Federico Hernandez 2010-01-08 22:29:58 +01:00
parent 1b60c20bad
commit f56e1bef54
3 changed files with 6 additions and 3 deletions

1
NEWS
View file

@ -8,6 +8,7 @@ New Features in task 1.9
- New columns that include the time as well as date - New columns that include the time as well as date
- New attribute modifiers - New attribute modifiers
- Improved .taskrc validation - Improved .taskrc validation
- Improved calendar report with custom coloring and optional task details output
Please refer to the ChangeLog file for full details. There are too many to Please refer to the ChangeLog file for full details. There are too many to
list here. list here.

View file

@ -172,6 +172,7 @@ void Config::createDefaultRC (const std::string& rc, const std::string& data)
<< "#color.recurring=on_red # Color of recur.any: tasks\n" << "#color.recurring=on_red # Color of recur.any: tasks\n"
<< "#color.header=bold_green # Color of header messages\n" << "#color.header=bold_green # Color of header messages\n"
<< "#color.footnote=bold_green # Color of footnote messages\n" << "#color.footnote=bold_green # Color of footnote messages\n"
<< "#color.alternate=on_rgb253 # Alternate color for line coloring\n"
<< "color.calendar.today=black on cyan # Color of today in calendar\n" << "color.calendar.today=black on cyan # Color of today in calendar\n"
<< "color.calendar.due=black on green # Color of days with due tasks in calendar\n" << "color.calendar.due=black on green # Color of days with due tasks in calendar\n"
<< "color.calendar.overdue=black on red # Color of days with overdue tasks in calendar\n" << "color.calendar.overdue=black on red # Color of days with overdue tasks in calendar\n"

View file

@ -416,15 +416,16 @@ int handleInfo (std::string &outs)
table.addCell (row, 1, due); table.addCell (row, 1, due);
overdue = (dt < now) ? true : false; overdue = (dt < now) ? true : false;
Date nextweek = now + 7 * 86400; int imminentperiod = context.config.get ("due", 7);
imminent = dt < nextweek ? true : false; Date imminentDay = now + imminentperiod * 86400;
imminent = dt < imminentDay ? true : false;
if (context.config.get ("color", true) || context.config.get (std::string ("_forcecolor"), false)) if (context.config.get ("color", true) || context.config.get (std::string ("_forcecolor"), false))
{ {
if (overdue) if (overdue)
table.setCellColor (row, 1, Color (context.config.get ("color.overdue", "red"))); table.setCellColor (row, 1, Color (context.config.get ("color.overdue", "red")));
else if (imminent) else if (imminent)
table.setCellColor (row, 1, Color (context.config.get ("color.due", "yellow"))); table.setCellColor (row, 1, Color (context.config.get ("color.due", "green")));
} }
} }