From ec3c1c4defbd4e11f21099add0866ccd06408a76 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Thu, 16 Sep 2010 22:09:03 -0400 Subject: [PATCH] Dependencies - Added support for rc.dependency.reminder. - Modified man page. --- doc/man/taskrc.5 | 6 ++++++ src/Config.cpp | 3 +++ src/command.cpp | 4 ++-- src/dependency.cpp | 3 ++- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/doc/man/taskrc.5 b/doc/man/taskrc.5 index f8acc54f9..d938c5583 100644 --- a/doc/man/taskrc.5 +++ b/doc/man/taskrc.5 @@ -514,6 +514,12 @@ Determines how many months the "task calendar" command renders across the screen. Defaults to however many will fit. If more months than will fit are specified, taskwarrior will only show as many that will fit. +.SS DEPENDENCIES + +.TP +.B dependency.reminder=on +Determines whether dependency chain violations generate reminders. + .SS COLOR CONTROLS .TP diff --git a/src/Config.cpp b/src/Config.cpp index ef29e049e..d497a940b 100644 --- a/src/Config.cpp +++ b/src/Config.cpp @@ -103,6 +103,9 @@ std::string Config::defaults = "journal.time.start.annotation=Started task # Annotation description for the start journal entry\n" "journal.time.stop.annotation=Stopped task # Annotation description for the stop journal entry\n" "\n" + "# Dependency controls\n" + "dependency.reminder=on # Nags on dependency chain violations\n" + "\n" "# Urgency Coefficients\n" "urgency.next.coefficient=10.0 # Urgency coefficients for 'next' special tag\n" "urgency.blocking.coefficient=9.0 # Urgency coefficients for blocking tasks\n" diff --git a/src/command.cpp b/src/command.cpp index 80ff8def4..d8aad339d 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -812,8 +812,8 @@ int handleShow (std::string &outs) "color.undo.after confirmation curses data.location dateformat " "dateformat.holiday dateformat.report dateformat.annotation debug " "default.command default.priority default.project defaultwidth due " - "locale displayweeknumber export.ical.class echo.command fontunderline " - "locking monthsperline nag next journal.time " + "dependency.reminder locale displayweeknumber export.ical.class " + "echo.command fontunderline locking monthsperline nag next journal.time " "journal.time.start.annotation journal.time.stop.annotation project " "shadow.command shadow.file shadow.notify weekstart editor " "import.synonym.id import.synonym.uuid complete.all.projects " diff --git a/src/dependency.cpp b/src/dependency.cpp index eec7a48c6..858e8e7db 100644 --- a/src/dependency.cpp +++ b/src/dependency.cpp @@ -199,7 +199,8 @@ std::string dependencyNag (Task& task) { std::stringstream out; - if (task.has ("depends")) + if (context.config.getBoolean ("dependency.reminder") && + task.has ("depends")) { out << "# dependencyNag " << task.id