From 410a63fe1423edfbca4c815a20b5ee1ea6fc6e9d Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Tue, 5 May 2009 01:03:07 -0400 Subject: [PATCH] Enhancement - info on recurring tasks - Added recurrence information (parent, mask, imask, recur, until) to the info report when the task is either a recurring task or a synthetic task. --- ChangeLog | 2 ++ html/task.html | 2 ++ src/report.cpp | 56 +++++++++++++++++++++++++++++++------------------- 3 files changed, 39 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 584e4e922..402093c70 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,8 @@ 1.7.0 (?) ? + Improved the errors when parsing a corrupt or unrecognized pending.data or completed.data file (thanks to T. Charles Yun). + + Added details to the "info" report about recurring tasks (thanks to T. + Charles Yun). ------ old releases ------------------------------ diff --git a/html/task.html b/html/task.html index 06812a799..4c9e3f970 100644 --- a/html/task.html +++ b/html/task.html @@ -116,6 +116,8 @@

diff --git a/src/report.cpp b/src/report.cpp index cdf2a6a79..d95c93de4 100644 --- a/src/report.cpp +++ b/src/report.cpp @@ -299,13 +299,17 @@ std::string handleInfo (TDB& tdb, T& task, Config& conf) table.addCell (row, 0, "ID"); table.addCell (row, 1, refTask.getId ()); + std::string status = refTask.getStatus () == T::pending ? "Pending" + : refTask.getStatus () == T::completed ? "Completed" + : refTask.getStatus () == T::deleted ? "Deleted" + : refTask.getStatus () == T::recurring ? "Recurring" + : ""; + if (refTask.getAttribute ("parent") != "") + status += " (Recurring)"; + row = table.addRow (); table.addCell (row, 0, "Status"); - table.addCell (row, 1, ( refTask.getStatus () == T::pending ? "Pending" - : refTask.getStatus () == T::completed ? "Completed" - : refTask.getStatus () == T::deleted ? "Deleted" - : refTask.getStatus () == T::recurring ? "Recurring" - : "")); + table.addCell (row, 1, status); std::string description = refTask.getDescription (); std::string when; @@ -336,26 +340,36 @@ std::string handleInfo (TDB& tdb, T& task, Config& conf) table.addCell (row, 1, refTask.getAttribute ("priority")); } - if (refTask.getStatus () == T::recurring) + if (refTask.getStatus () == T::recurring || + refTask.getAttribute ("parent") != "") { - row = table.addRow (); - table.addCell (row, 0, "Recurrence"); - table.addCell (row, 1, refTask.getAttribute ("recur")); + if (refTask.getAttribute ("recur") != "") + { + row = table.addRow (); + table.addCell (row, 0, "Recurrence"); + table.addCell (row, 1, refTask.getAttribute ("recur")); + } - row = table.addRow (); - table.addCell (row, 0, "Recur until"); - table.addCell (row, 1, refTask.getAttribute ("until")); + if (refTask.getAttribute ("until") != "") + { + row = table.addRow (); + table.addCell (row, 0, "Recur until"); + table.addCell (row, 1, refTask.getAttribute ("until")); + } - row = table.addRow (); - table.addCell (row, 0, "Mask"); - table.addCell (row, 1, refTask.getAttribute ("mask")); - } + if (refTask.getAttribute ("mask") != "") + { + row = table.addRow (); + table.addCell (row, 0, "Mask"); + table.addCell (row, 1, refTask.getAttribute ("mask")); + } - if (refTask.getAttribute ("parent") != "") - { - row = table.addRow (); - table.addCell (row, 0, "Parent task"); - table.addCell (row, 1, refTask.getAttribute ("parent")); + if (refTask.getAttribute ("parent") != "") + { + row = table.addRow (); + table.addCell (row, 0, "Parent task"); + table.addCell (row, 1, refTask.getAttribute ("parent")); + } row = table.addRow (); table.addCell (row, 0, "Mask Index");