From a08f3f919f2f4b06503004ca764339918ee5d000 Mon Sep 17 00:00:00 2001
From: Johan Friis <johanfriis@gmail.com>
Date: Fri, 15 May 2009 16:14:26 +0100
Subject: [PATCH] fontunderline boolean config option

Added an option to turn on/off the drawing of table headers with
underlined font. If off, the default asciidashes will be used.
It defaults to on.
This commit is contained in:
Paul Beckingham 2009-05-15 21:02:06 -04:00
parent a120b4bd89
commit dbc98c1230
3 changed files with 34 additions and 11 deletions

View file

@ -123,6 +123,11 @@ The width of tables used when ncurses support is not available. Defaults to 80.
Determines whether task uses ncurses to establish the size of the window you are Determines whether task uses ncurses to establish the size of the window you are
using, for text wrapping. using, for text wrapping.
.TP
.B fontunderline=on
Determines if font underlines or ascii dashes should be used to underline
headers.
.TP .TP
.B due=7 .B due=7
This is the number of days into the future that define when a task is considered due, This is the number of days into the future that define when a task is considered due,

View file

@ -209,6 +209,13 @@
Defaults to 80. Defaults to 80.
</dd> </dd>
<dt>fontuderline</dt>
<dd>
May be "on" or "off". Determines if font underlines or ascii
dashes should be used to underline headers.
Defaults to on.
</dd>
<dt>due</dt> <dt>due</dt>
<dd> <dd>

View file

@ -219,7 +219,8 @@ std::string handleCompleted (TDB& tdb, T& task, Config& conf)
table.addColumn ("Project"); table.addColumn ("Project");
table.addColumn ("Description"); table.addColumn ("Description");
if (conf.get ("color", true) || conf.get (std::string ("_forcecolor"), false)) if ((conf.get ("color", true) || conf.get (std::string ("_forcecolor"), false)) &&
conf.get (std::string ("fontunderline"), "true"))
{ {
table.setColumnUnderline (0); table.setColumnUnderline (0);
table.setColumnUnderline (1); table.setColumnUnderline (1);
@ -329,7 +330,8 @@ std::string handleInfo (TDB& tdb, T& task, Config& conf)
table.addColumn ("Name"); table.addColumn ("Name");
table.addColumn ("Value"); table.addColumn ("Value");
if (conf.get ("color", true) || conf.get (std::string ("_forcecolor"), false)) if ((conf.get ("color", true) || conf.get (std::string ("_forcecolor"), false)) &&
conf.get (std::string ("fontunderline"), "true"))
{ {
table.setColumnUnderline (0); table.setColumnUnderline (0);
table.setColumnUnderline (1); table.setColumnUnderline (1);
@ -605,7 +607,8 @@ std::string handleReportSummary (TDB& tdb, T& task, Config& conf)
table.addColumn ("Complete"); table.addColumn ("Complete");
table.addColumn ("0% 100%"); table.addColumn ("0% 100%");
if (conf.get ("color", true) || conf.get (std::string ("_forcecolor"), false)) if ((conf.get ("color", true) || conf.get (std::string ("_forcecolor"), false)) &&
conf.get (std::string ("fontunderline"), "true"))
{ {
table.setColumnUnderline (0); table.setColumnUnderline (0);
table.setColumnUnderline (1); table.setColumnUnderline (1);
@ -746,7 +749,8 @@ std::string handleReportNext (TDB& tdb, T& task, Config& conf)
table.addColumn ("Age"); table.addColumn ("Age");
table.addColumn ("Description"); table.addColumn ("Description");
if (conf.get ("color", true) || conf.get (std::string ("_forcecolor"), false)) if ((conf.get ("color", true) || conf.get (std::string ("_forcecolor"), false)) &&
conf.get (std::string ("fontunderline"), "true"))
{ {
table.setColumnUnderline (0); table.setColumnUnderline (0);
table.setColumnUnderline (1); table.setColumnUnderline (1);
@ -988,7 +992,8 @@ std::string handleReportHistory (TDB& tdb, T& task, Config& conf)
table.addColumn ("Deleted"); table.addColumn ("Deleted");
table.addColumn ("Net"); table.addColumn ("Net");
if (conf.get ("color", true) || conf.get (std::string ("_forcecolor"), false)) if ((conf.get ("color", true) || conf.get (std::string ("_forcecolor"), false)) &&
conf.get (std::string ("fontunderline"), "true"))
{ {
table.setColumnUnderline (0); table.setColumnUnderline (0);
table.setColumnUnderline (1); table.setColumnUnderline (1);
@ -1189,7 +1194,8 @@ std::string handleReportGHistory (TDB& tdb, T& task, Config& conf)
table.addColumn ("Month"); table.addColumn ("Month");
table.addColumn ("Number Added/Completed/Deleted"); table.addColumn ("Number Added/Completed/Deleted");
if (conf.get ("color", true) || conf.get (std::string ("_forcecolor"), false)) if ((conf.get ("color", true) || conf.get (std::string ("_forcecolor"), false)) &&
conf.get (std::string ("fontunderline"), "true"))
{ {
table.setColumnUnderline (0); table.setColumnUnderline (0);
table.setColumnUnderline (1); table.setColumnUnderline (1);
@ -1549,7 +1555,8 @@ std::string renderMonths (
table.addColumn ("Fr"); table.addColumn ("Fr");
table.addColumn ("Sa"); table.addColumn ("Sa");
if (conf.get ("color", true) || conf.get (std::string ("_forcecolor"), false)) if ((conf.get ("color", true) || conf.get (std::string ("_forcecolor"), false)) &&
conf.get (std::string ("fontunderline"), "true"))
{ {
table.setColumnUnderline (i + 1); table.setColumnUnderline (i + 1);
table.setColumnUnderline (i + 2); table.setColumnUnderline (i + 2);
@ -1791,7 +1798,8 @@ std::string handleReportActive (TDB& tdb, T& task, Config& conf)
table.addColumn ("Due"); table.addColumn ("Due");
table.addColumn ("Description"); table.addColumn ("Description");
if (conf.get ("color", true) || conf.get (std::string ("_forcecolor"), false)) if ((conf.get ("color", true) || conf.get (std::string ("_forcecolor"), false)) &&
conf.get (std::string ("fontunderline"), "true"))
{ {
table.setColumnUnderline (0); table.setColumnUnderline (0);
table.setColumnUnderline (1); table.setColumnUnderline (1);
@ -1924,7 +1932,8 @@ std::string handleReportOverdue (TDB& tdb, T& task, Config& conf)
table.addColumn ("Due"); table.addColumn ("Due");
table.addColumn ("Description"); table.addColumn ("Description");
if (conf.get ("color", true) || conf.get (std::string ("_forcecolor"), false)) if ((conf.get ("color", true) || conf.get (std::string ("_forcecolor"), false)) &&
conf.get (std::string ("fontunderline"), "true"))
{ {
table.setColumnUnderline (0); table.setColumnUnderline (0);
table.setColumnUnderline (1); table.setColumnUnderline (1);
@ -2095,7 +2104,8 @@ std::string handleReportStats (TDB& tdb, T& task, Config& conf)
table.addColumn ("Category"); table.addColumn ("Category");
table.addColumn ("Data"); table.addColumn ("Data");
if (conf.get ("color", true) || conf.get (std::string ("_forcecolor"), false)) if ((conf.get ("color", true) || conf.get (std::string ("_forcecolor"), false)) &&
conf.get (std::string ("fontunderline"), "true"))
{ {
table.setColumnUnderline (0); table.setColumnUnderline (0);
table.setColumnUnderline (1); table.setColumnUnderline (1);
@ -2691,7 +2701,8 @@ std::string handleCustomReport (
// Common to all columns. // Common to all columns.
// Add underline. // Add underline.
if (conf.get (std::string ("color"), true) || conf.get (std::string ("_forcecolor"), false)) if ((conf.get (std::string ("color"), true) || conf.get (std::string ("_forcecolor"), false)) &&
conf.get (std::string ("fontunderline"), "true"))
table.setColumnUnderline (columnCount); table.setColumnUnderline (columnCount);
else else
table.setTableDashedUnderline (); table.setTableDashedUnderline ();