Patch
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:
@@ -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
|
||||
using, for text wrapping.
|
||||
|
||||
.TP
|
||||
.B fontunderline=on
|
||||
Determines if font underlines or ascii dashes should be used to underline
|
||||
headers.
|
||||
|
||||
.TP
|
||||
.B due=7
|
||||
This is the number of days into the future that define when a task is considered due,
|
||||
|
||||
@@ -209,6 +209,13 @@
|
||||
Defaults to 80.
|
||||
</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>
|
||||
<dd>
|
||||
|
||||
|
||||
@@ -219,7 +219,8 @@ std::string handleCompleted (TDB& tdb, T& task, Config& conf)
|
||||
table.addColumn ("Project");
|
||||
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 (1);
|
||||
@@ -329,7 +330,8 @@ std::string handleInfo (TDB& tdb, T& task, Config& conf)
|
||||
table.addColumn ("Name");
|
||||
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 (1);
|
||||
@@ -605,7 +607,8 @@ std::string handleReportSummary (TDB& tdb, T& task, Config& conf)
|
||||
table.addColumn ("Complete");
|
||||
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 (1);
|
||||
@@ -746,7 +749,8 @@ std::string handleReportNext (TDB& tdb, T& task, Config& conf)
|
||||
table.addColumn ("Age");
|
||||
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 (1);
|
||||
@@ -988,7 +992,8 @@ std::string handleReportHistory (TDB& tdb, T& task, Config& conf)
|
||||
table.addColumn ("Deleted");
|
||||
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 (1);
|
||||
@@ -1189,7 +1194,8 @@ std::string handleReportGHistory (TDB& tdb, T& task, Config& conf)
|
||||
table.addColumn ("Month");
|
||||
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 (1);
|
||||
@@ -1549,7 +1555,8 @@ std::string renderMonths (
|
||||
table.addColumn ("Fr");
|
||||
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 + 2);
|
||||
@@ -1791,7 +1798,8 @@ std::string handleReportActive (TDB& tdb, T& task, Config& conf)
|
||||
table.addColumn ("Due");
|
||||
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 (1);
|
||||
@@ -1924,7 +1932,8 @@ std::string handleReportOverdue (TDB& tdb, T& task, Config& conf)
|
||||
table.addColumn ("Due");
|
||||
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 (1);
|
||||
@@ -2095,7 +2104,8 @@ std::string handleReportStats (TDB& tdb, T& task, Config& conf)
|
||||
table.addColumn ("Category");
|
||||
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 (1);
|
||||
@@ -2691,7 +2701,8 @@ std::string handleCustomReport (
|
||||
|
||||
// Common to all columns.
|
||||
// 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);
|
||||
else
|
||||
table.setTableDashedUnderline ();
|
||||
|
||||
Reference in New Issue
Block a user