From 6673e408a223af98c38779c20b08524042c0edfa Mon Sep 17 00:00:00 2001
From: Paul Beckingham
Date: Thu, 19 Jun 2008 22:41:09 -0400
Subject: [PATCH] - Now uses "defaultwidth" configuration variable for when
ncurses support is not available - Added the new movie to the task.html page
---
ChangeLog | 2 ++
TUTORIAL | 3 +++
src/task.cpp | 28 ++++++++++++----------------
task.html | 18 ++++++++++++++++--
4 files changed, 33 insertions(+), 18 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index b316b313c..0ac27fe08 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,8 @@ represents a feature release, and the z represents a patch.
1.4.0 (?)
+ Bug: "showage" configuration variable should apply to all reprts, not
just the ones based on "list"
+ + New configuration variable, "defaultwidth" that determines the width
+ of tables when ncurses support is not available
------ reality -----------------------------------
diff --git a/TUTORIAL b/TUTORIAL
index 292647a68..075b0a654 100644
--- a/TUTORIAL
+++ b/TUTORIAL
@@ -713,6 +713,9 @@ Configuring Task
newest Determines how many tasks are shown on the "newest"
report. Defaults to 10.
+ defaultwidth The width of tables used when ncurses support is not
+ available. Defaults to 80.
+
color May be "on" or "off". Determines whether task uses
color.
diff --git a/src/task.cpp b/src/task.cpp
index 1b6f30b4d..e9efebbb3 100644
--- a/src/task.cpp
+++ b/src/task.cpp
@@ -48,7 +48,7 @@
void shortUsage (Config& conf)
{
Table table;
- int width = 80;
+ int width = conf.get ("defaultwidth", 80);
#ifdef HAVE_LIBNCURSES
if (conf.get ("curses", true))
{
@@ -470,7 +470,7 @@ void handleTags (const TDB& tdb, T& task, Config& conf)
void handleList (const TDB& tdb, T& task, Config& conf)
{
// Determine window size, and set table accordingly.
- int width = 80;
+ int width = conf.get ("defaultwidth", 80);
#ifdef HAVE_LIBNCURSES
if (conf.get ("curses", true))
{
@@ -606,7 +606,7 @@ void handleList (const TDB& tdb, T& task, Config& conf)
void handleSmallList (const TDB& tdb, T& task, Config& conf)
{
// Determine window size, and set table accordingly.
- int width = 80;
+ int width = conf.get ("defaultwidth", 80);
#ifdef HAVE_LIBNCURSES
if (conf.get ("curses", true))
{
@@ -725,7 +725,7 @@ void handleSmallList (const TDB& tdb, T& task, Config& conf)
void handleCompleted (const TDB& tdb, T& task, Config& conf)
{
// Determine window size, and set table accordingly.
- int width = 80;
+ int width = conf.get ("defaultwidth", 80);
#ifdef HAVE_LIBNCURSES
if (conf.get ("curses", true))
{
@@ -808,7 +808,7 @@ void handleCompleted (const TDB& tdb, T& task, Config& conf)
void handleInfo (const TDB& tdb, T& task, Config& conf)
{
// Determine window size, and set table accordingly.
- int width = 80;
+ int width = conf.get ("defaultwidth", 80);
#ifdef HAVE_LIBNCURSES
if (conf.get ("curses", true))
{
@@ -974,7 +974,7 @@ void handleInfo (const TDB& tdb, T& task, Config& conf)
void handleLongList (const TDB& tdb, T& task, Config& conf)
{
// Determine window size, and set table accordingly.
- int width = 80;
+ int width = conf.get ("defaultwidth", 80);
#ifdef HAVE_LIBNCURSES
if (conf.get ("curses", true))
{
@@ -1306,7 +1306,7 @@ void handleReportNext (const TDB& tdb, T& task, Config& conf)
gatherNextTasks (tdb, task, conf, pending, matching);
// Determine window size, and set table accordingly.
- int width = 80;
+ int width = conf.get ("defaultwidth", 80);
#ifdef HAVE_LIBNCURSES
if (conf.get ("curses", true))
{
@@ -1888,7 +1888,7 @@ void handleReportCalendar (const TDB& tdb, T& task, Config& conf)
void handleReportActive (const TDB& tdb, T& task, Config& conf)
{
// Determine window size, and set table accordingly.
- int width = 80;
+ int width = conf.get ("defaultwidth", 80);
#ifdef HAVE_LIBNCURSES
if (conf.get ("curses", true))
{
@@ -1996,7 +1996,7 @@ void handleReportActive (const TDB& tdb, T& task, Config& conf)
void handleReportOverdue (const TDB& tdb, T& task, Config& conf)
{
// Determine window size, and set table accordingly.
- int width = 80;
+ int width = conf.get ("defaultwidth", 80);
#ifdef HAVE_LIBNCURSES
if (conf.get ("curses", true))
{
@@ -2100,7 +2100,7 @@ void handleReportOverdue (const TDB& tdb, T& task, Config& conf)
void handleReportOldest (const TDB& tdb, T& task, Config& conf)
{
// Determine window size, and set table accordingly.
- int width = 80;
+ int width = conf.get ("defaultwidth", 80);
#ifdef HAVE_LIBNCURSES
if (conf.get ("curses", true))
{
@@ -2236,7 +2236,7 @@ void handleReportOldest (const TDB& tdb, T& task, Config& conf)
void handleReportNewest (const TDB& tdb, T& task, Config& conf)
{
// Determine window size, and set table accordingly.
- int width = 80;
+ int width = conf.get ("defaultwidth", 80);
#ifdef HAVE_LIBNCURSES
if (conf.get ("curses", true))
{
@@ -2453,7 +2453,7 @@ void handleReportStats (const TDB& tdb, T& task, Config& conf)
void handleVersion (Config& conf)
{
// Determine window size, and set table accordingly.
- int width = 80;
+ int width = conf.get ("defaultwidth", 80);
#ifdef HAVE_LIBNCURSES
if (conf.get ("curses", true))
{
@@ -2463,10 +2463,6 @@ void handleVersion (Config& conf)
}
#endif
- // Handle case for zero width on mobile device.
- if (width == 0)
- width = 80;
-
// Create a table for output.
Table table;
table.setTableWidth (width);
diff --git a/task.html b/task.html
index 2a9590628..79ad60c5e 100644
--- a/task.html
+++ b/task.html
@@ -178,6 +178,8 @@ a img { border: none; padding: 0; margin: 0; }
- Fixed bug where "showage" configuration variable was not being
oberved by the "task long" report
+
- New configuration variable "defaultwidth" determines the width
+ of windows in the absense of ncurses support
@@ -206,7 +208,7 @@ a img { border: none; padding: 0; margin: 0; }
Source: task-1.2.0.tar.gz
Debian package: task_1.2.0-1_i386.deb
- (Thanks to Richard Querin)
+ (Thanks to Richard Querin)
@@ -268,6 +270,12 @@ a img { border: none; padding: 0; margin: 0; }
This guide shows how to quickly set up the task program, and become
proficient with it.
+
+
+ Alternatively, watch the
+ task movie
+ which illustrates many of task's features.
+
@@ -1118,6 +1126,12 @@ on_white on_bright_white
Defaults to 10.
+ - defaultwidth
+ -
+ The width of tables used when ncurses support is not available.
+ Defaults to 80.
+
+
- color
-
May be "on" or "off". Determines whether task uses color.