Skip to content

Commit

Permalink
Fixed Duedate bug (no strikethrough if marked as done and added or re…
Browse files Browse the repository at this point in the history
…-inserted)
  • Loading branch information
gabster committed May 27, 2010
1 parent 818bc09 commit 4e604a8
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion AttributedTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 8 additions & 1 deletion Tags/DateTag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
//

using System;
using System.Collections.Generic;
using Gtk;

namespace Tomboy.TaskManager
Expand All @@ -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)
Expand Down Expand Up @@ -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 ();
}
}
}
6 changes: 6 additions & 0 deletions Task.cs
Original file line number Diff line number Diff line change
Expand Up @@ -725,5 +725,11 @@ public void DebugPrint ()

Console.WriteLine ("Task: " + Description ());
}

public override void AddDueDate (DateTime date)
{
base.AddDueDate (date);
TagUpdate ();
}
}
}
2 changes: 1 addition & 1 deletion TaskManagerNote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
1 change: 1 addition & 0 deletions TaskNoteUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
//

using System;
using System.Collections.Generic;
using Gtk;
using Tomboy;

Expand Down

0 comments on commit 4e604a8

Please sign in to comment.