Footnote: New 'recur' verbosity token

This commit is contained in:
Paul Beckingham 2015-08-23 20:36:06 -04:00
parent b1839adf97
commit c61f7e6b8f
16 changed files with 59 additions and 3 deletions

View file

@ -159,6 +159,10 @@
- Improved feedback for tasks that do not have ID (thanks to Tomas Babej). - Improved feedback for tasks that do not have ID (thanks to Tomas Babej).
- Comma-separated lists of UUIDs can no longer be used as a filter. Use the - Comma-separated lists of UUIDs can no longer be used as a filter. Use the
space character instead. space character instead.
- New 'recur' verbosity token generates a notification message when a recurring
task is created.
- New 'unwait' verbosity token generates a notification message when a waiting
task becomes visible.
------ current release --------------------------- ------ current release ---------------------------

4
NEWS
View file

@ -21,6 +21,10 @@ New configuration options in Taskwarrior 2.4.5
not have a value for the UDA '<name>'. not have a value for the UDA '<name>'.
- A Cygwin fix means that now we can default 'search.case.sensitive' to 'yes', - A Cygwin fix means that now we can default 'search.case.sensitive' to 'yes',
and all platforms are again equal. and all platforms are again equal.
- The new 'recur' verbosity token generates a message when a recurring task is
generated.
- The new 'unwait' verbosity token generates a message when a waiting task
becomes visible.
Newly deprecated features in Taskwarrior 2.4.5 Newly deprecated features in Taskwarrior 2.4.5

View file

@ -275,6 +275,7 @@ control specific occasions when output is generated. This list may contain:
sync Feedback about sync sync Feedback about sync
filter Shows the filter used in the command filter Shows the filter used in the command
unwait Notification when a task leaves the 'waiting' state unwait Notification when a task leaves the 'waiting' state
recur Notification when a new recurrign task instance is created
"affected", "new-id", "new-uuid" "project" and "unwait" imply "footnote". "affected", "new-id", "new-uuid" "project" and "unwait" imply "footnote".

View file

@ -79,7 +79,7 @@ std::string Config::_defaults =
"#verbose=no # Provide regular feedback\n" "#verbose=no # Provide regular feedback\n"
"#verbose=nothing # Provide no feedback\n" "#verbose=nothing # Provide no feedback\n"
"# # Comma-separated list. May contain any subset of:\n" "# # Comma-separated list. May contain any subset of:\n"
"#verbose=blank,header,footnote,label,new-id,new-uuid,affected,edit,special,project,sync,filter,unwait\n" "#verbose=blank,header,footnote,label,new-id,new-uuid,affected,edit,special,project,sync,filter,unwait,recur\n"
"confirmation=yes # Confirmation on delete, big changes\n" "confirmation=yes # Confirmation on delete, big changes\n"
"recurrence=yes # Enable recurrence\n" "recurrence=yes # Enable recurrence\n"
"recurrence.confirmation=prompt # Confirmation for propagating changes among recurring tasks (yes/no/prompt)\n" "recurrence.confirmation=prompt # Confirmation for propagating changes among recurring tasks (yes/no/prompt)\n"

View file

@ -540,7 +540,8 @@ bool Context::verbose (const std::string& token)
v != "project" && // v != "project" && //
v != "sync" && // v != "sync" && //
v != "filter" && // v != "filter" && //
v != "unwait") // v != "unwait" && //
v != "recur") //
{ {
// This list emulates rc.verbose=off in version 1.9.4. // This list emulates rc.verbose=off in version 1.9.4.
verbosity = {"blank", "label", "new-id", "edit"}; verbosity = {"blank", "label", "new-id", "edit"};
@ -551,7 +552,7 @@ bool Context::verbose (const std::string& token)
if (! verbosity.count ("footnote")) if (! verbosity.count ("footnote"))
{ {
// TODO: Some of these may not use footnotes yet. They should. // TODO: Some of these may not use footnotes yet. They should.
for (auto flag : {"affected", "new-id", "new-uuid", "project", "unwait"}) for (auto flag : {"affected", "new-id", "new-uuid", "project", "unwait", "recur"})
{ {
if (verbosity.count (flag)) if (verbosity.count (flag))
{ {

View file

@ -880,6 +880,9 @@
#define STRING_TDB2_DIRTY_EXIT "Beende mit ungeschriebenen Änderungen auf {1}" #define STRING_TDB2_DIRTY_EXIT "Beende mit ungeschriebenen Änderungen auf {1}"
#define STRING_TDB2_UNWAIT "Un-waiting task '{1}'" #define STRING_TDB2_UNWAIT "Un-waiting task '{1}'"
// recur.cpp
#define STRING_RECUR_CREATE "Creating recurring task instance '{1}'"
// View // View
#define STRING_VIEW_TOO_SMALL "Dieser Report hat eine Mindestbreite von {1} und passt nicht in die Bildschirmbreite von {2}." #define STRING_VIEW_TOO_SMALL "Dieser Report hat eine Mindestbreite von {1} und passt nicht in die Bildschirmbreite von {2}."

View file

@ -878,6 +878,9 @@
#define STRING_TDB2_DIRTY_EXIT "Exiting with unwritten changes to {1}" #define STRING_TDB2_DIRTY_EXIT "Exiting with unwritten changes to {1}"
#define STRING_TDB2_UNWAIT "Un-waiting task '{1}'" #define STRING_TDB2_UNWAIT "Un-waiting task '{1}'"
// recur.cpp
#define STRING_RECUR_CREATE "Creating recurring task instance '{1}'"
// View // View
#define STRING_VIEW_TOO_SMALL "The report has a minimum width of {1} and does not fit in the available width of {2}." #define STRING_VIEW_TOO_SMALL "The report has a minimum width of {1} and does not fit in the available width of {2}."

View file

@ -880,6 +880,9 @@
#define STRING_TDB2_DIRTY_EXIT "Eliranta kun neskribitajn ŝanĝojn al {1}" #define STRING_TDB2_DIRTY_EXIT "Eliranta kun neskribitajn ŝanĝojn al {1}"
#define STRING_TDB2_UNWAIT "Un-waiting task '{1}'" #define STRING_TDB2_UNWAIT "Un-waiting task '{1}'"
// recur.cpp
#define STRING_RECUR_CREATE "Creating recurring task instance '{1}'"
// View // View
#define STRING_VIEW_TOO_SMALL "La raporto havas larĝecminimumon {1}, al kio ne konformas la disponebla larĝeco {2}." #define STRING_VIEW_TOO_SMALL "La raporto havas larĝecminimumon {1}, al kio ne konformas la disponebla larĝeco {2}."

View file

@ -893,6 +893,9 @@
#define STRING_TDB2_DIRTY_EXIT "Saliendo con cambios sin escribir a {1}" #define STRING_TDB2_DIRTY_EXIT "Saliendo con cambios sin escribir a {1}"
#define STRING_TDB2_UNWAIT "Un-waiting task '{1}'" #define STRING_TDB2_UNWAIT "Un-waiting task '{1}'"
// recur.cpp
#define STRING_RECUR_CREATE "Creating recurring task instance '{1}'"
// View // View
#define STRING_VIEW_TOO_SMALL "El informe tiene una anchura mínima de {1} y no cabe en la disponible, que es {2}." #define STRING_VIEW_TOO_SMALL "El informe tiene una anchura mínima de {1} y no cabe en la disponible, que es {2}."

View file

@ -880,6 +880,9 @@
#define STRING_TDB2_DIRTY_EXIT "Exiting with unwritten changes to {1}" #define STRING_TDB2_DIRTY_EXIT "Exiting with unwritten changes to {1}"
#define STRING_TDB2_UNWAIT "Un-waiting task '{1}'" #define STRING_TDB2_UNWAIT "Un-waiting task '{1}'"
// recur.cpp
#define STRING_RECUR_CREATE "Creating recurring task instance '{1}'"
// View // View
#define STRING_VIEW_TOO_SMALL "The report has a minimum width of {1} and does not fit in the available width of {2}." #define STRING_VIEW_TOO_SMALL "The report has a minimum width of {1} and does not fit in the available width of {2}."

View file

@ -879,6 +879,9 @@
#define STRING_TDB2_DIRTY_EXIT "Exiting with unwritten changes to {1}" #define STRING_TDB2_DIRTY_EXIT "Exiting with unwritten changes to {1}"
#define STRING_TDB2_UNWAIT "Un-waiting task '{1}'" #define STRING_TDB2_UNWAIT "Un-waiting task '{1}'"
// recur.cpp
#define STRING_RECUR_CREATE "Creating recurring task instance '{1}'"
// View // View
#define STRING_VIEW_TOO_SMALL "Il report ha larghezza minima di {1} e non entra nella larghezza disponibile di {2}." #define STRING_VIEW_TOO_SMALL "Il report ha larghezza minima di {1} e non entra nella larghezza disponibile di {2}."

View file

@ -880,6 +880,9 @@
#define STRING_TDB2_DIRTY_EXIT "Exiting with unwritten changes to {1}" #define STRING_TDB2_DIRTY_EXIT "Exiting with unwritten changes to {1}"
#define STRING_TDB2_UNWAIT "Un-waiting task '{1}'" #define STRING_TDB2_UNWAIT "Un-waiting task '{1}'"
// recur.cpp
#define STRING_RECUR_CREATE "Creating recurring task instance '{1}'"
// View // View
#define STRING_VIEW_TOO_SMALL "The report has a minimum width of {1} and does not fit in the available width of {2}." #define STRING_VIEW_TOO_SMALL "The report has a minimum width of {1} and does not fit in the available width of {2}."

View file

@ -880,6 +880,9 @@
#define STRING_TDB2_DIRTY_EXIT "Zamykanie z niezapisanymi zmianami w {1}" #define STRING_TDB2_DIRTY_EXIT "Zamykanie z niezapisanymi zmianami w {1}"
#define STRING_TDB2_UNWAIT "Un-waiting task '{1}'" #define STRING_TDB2_UNWAIT "Un-waiting task '{1}'"
// recur.cpp
#define STRING_RECUR_CREATE "Creating recurring task instance '{1}'"
// View // View
#define STRING_VIEW_TOO_SMALL "Raport ma minimalną szerokość {1} i nie mieści się w dostępnej przestrzeni {2}." #define STRING_VIEW_TOO_SMALL "Raport ma minimalną szerokość {1} i nie mieści się w dostępnej przestrzeni {2}."

View file

@ -880,6 +880,9 @@
#define STRING_TDB2_DIRTY_EXIT "Saindo com modificações por gravar de {1}" #define STRING_TDB2_DIRTY_EXIT "Saindo com modificações por gravar de {1}"
#define STRING_TDB2_UNWAIT "Un-waiting task '{1}'" #define STRING_TDB2_UNWAIT "Un-waiting task '{1}'"
// recur.cpp
#define STRING_RECUR_CREATE "Creating recurring task instance '{1}'"
// View // View
#define STRING_VIEW_TOO_SMALL "O relatório tem uma largura mínima de {1} e não cabe na largura disponível {2}." #define STRING_VIEW_TOO_SMALL "O relatório tem uma largura mínima de {1} e não cabe na largura disponível {2}."

View file

@ -138,6 +138,9 @@ void handleRecurrence ()
{ {
t.set ("mask", mask); t.set ("mask", mask);
context.tdb2.modify (t); context.tdb2.modify (t);
if (context.verbose ("recur"))
context.footnote (format (STRING_RECUR_CREATE, t.get ("description")));
} }
} }

View file

@ -385,6 +385,22 @@ class TestUpgradeToRecurring(TestCase):
code, out, err = self.t.runError("1 modify recur:weekly") code, out, err = self.t.runError("1 modify recur:weekly")
self.assertIn("You cannot specify a recurring task without a due date.", err) self.assertIn("You cannot specify a recurring task without a due date.", err)
class TestRecurrenceNotification(TestCase):
def setUp(self):
"""Executed before each test in the class"""
self.t = Task()
def test_notification(self):
"""Test notification on task creation"""
self.t("add foo due:eow recur:daily")
code, out, err = self.t("list")
self.assertIn("Creating recurring task instance 'foo'", err)
code, out, err = self.t("list")
self.assertNotIn("Creating recurring task instance 'foo'", err)
# TODO Wait a recurring task # TODO Wait a recurring task
# TODO Downgrade a recurring task to a regular task # TODO Downgrade a recurring task to a regular task