diff --git a/AttributedTask.cs b/AttributedTask.cs index bbd8e68..b01c62b 100644 --- a/AttributedTask.cs +++ b/AttributedTask.cs @@ -153,7 +153,7 @@ private DateTag DateTag{ } } - public void AddDueDate (DateTime date){ + public virtual void AddDueDate (DateTime date){ TextIter pos = Buffer.GetIterAtMark (Buffer.InsertMark); Buffer.InsertWithTags ( ref pos, diff --git a/Tags/DateTag.cs b/Tags/DateTag.cs index b47f5b3..2036005 100644 --- a/Tags/DateTag.cs +++ b/Tags/DateTag.cs @@ -24,6 +24,7 @@ // using System; +using System.Collections.Generic; using Gtk; namespace Tomboy.TaskManager @@ -41,9 +42,11 @@ public class DateTag : NoteTag private Calendar calendar; private TextRange range; private NoteEditor editor; + private TaskManagerNoteAddin addin; - public DateTag (string name) : base (name) + public DateTag (string name, TaskManagerNoteAddin addin) : base (name) { + this.addin = addin; } public override void Initialize (string element_name) @@ -96,6 +99,10 @@ void on_dialog_response (object obj, ResponseArgs args) string newdate = calendar.GetDate ().ToShortDateString (); editor.Buffer.Delete (ref start, ref end); editor.Buffer.InsertWithTags (ref start, newdate, new TextTag[]{this}); + + Task t = addin.Utils.GetTask (start); + if (t != null) + t.TagUpdate (); } } } diff --git a/Task.cs b/Task.cs index 83e8dc0..6455900 100644 --- a/Task.cs +++ b/Task.cs @@ -725,5 +725,11 @@ public void DebugPrint () Console.WriteLine ("Task: " + Description ()); } + + public override void AddDueDate (DateTime date) + { + base.AddDueDate (date); + TagUpdate (); + } } } diff --git a/TaskManagerNote.cs b/TaskManagerNote.cs index 6294281..2c9f74e 100644 --- a/TaskManagerNote.cs +++ b/TaskManagerNote.cs @@ -102,7 +102,7 @@ public override void Initialize () Note.TagTable.Add (tag); if (Note.TagTable.Lookup ("duedate") == null) - Note.TagTable.Add (new DateTag ("duedate")); + Note.TagTable.Add (new DateTag ("duedate", this)); //TaskTag if (!Note.TagTable.IsDynamicTagRegistered ("task")) diff --git a/TaskNoteUtilities.cs b/TaskNoteUtilities.cs index 5546420..5072c80 100644 --- a/TaskNoteUtilities.cs +++ b/TaskNoteUtilities.cs @@ -24,6 +24,7 @@ // using System; +using System.Collections.Generic; using Gtk; using Tomboy;