Skip to content

Commit

Permalink
Merge branch 'master' of github.com:rggjan/Tomboy-Todo-List
Browse files Browse the repository at this point in the history
  • Loading branch information
rggjan committed May 27, 2010
2 parents 7b242a4 + 75386c6 commit df4c396
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 16 deletions.
10 changes: 5 additions & 5 deletions Tags/AttributedTaskTag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ public class AttributedTaskTag : DynamicNoteTag
{

/// <summary>
/// Set common (TaskList, Task) properties
/// Set common (TaskListtag, Tasktag) properties
/// </summary>
/// <param name="element_name">
/// A <see cref="System.String"/>
/// </param>
public override void Initialize (string element_name)
public override void Initialize (string elementName)
{
base.Initialize (element_name);
base.Initialize (elementName);
CanGrow = true;
LeftMarginSet = true;
}
Expand All @@ -63,9 +63,9 @@ public AttributedTask AttributedTask {
/// <param name="atask">
/// A <see cref="AttributedTask"/>
/// </param>
public void Bind (AttributedTask atask)
public void Bind (AttributedTask attributedTask)
{
AttributedTask = atask;
AttributedTask = attributedTask;
}
}
}
33 changes: 29 additions & 4 deletions Tags/DateTag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,46 @@ public class DateTag : NoteTag
private NoteEditor editor;
private TaskManagerNoteAddin addin;

/// <summary>
/// Initialisation with the name and the tasknote
/// </summary>
/// <param name="name">
/// A <see cref="System.String"/>
/// </param>
/// <param name="addin">
/// A <see cref="TaskManagerNoteAddin"/>
/// </param>
public DateTag (string name, TaskManagerNoteAddin addin) : base (name)
{
this.addin = addin;
}

public override void Initialize (string element_name)
public override void Initialize (string elementName)
{
base.Initialize (element_name);
base.Initialize (elementName);

//Underline = Pango.Underline.Single;
Foreground = "purple";
CanActivate = true;
CanGrow = true;
}

/// <summary>
/// Handles the click on the datetag:
/// Opens up a calendar dialog
/// </summary>
/// <param name="editor">
/// A <see cref="NoteEditor"/>
/// </param>
/// <param name="start">
/// A <see cref="Gtk.TextIter"/>
/// </param>
/// <param name="end">
/// A <see cref="Gtk.TextIter"/>
/// </param>
/// <returns>
/// A <see cref="System.Boolean"/>
/// </returns>
protected override bool OnActivate (NoteEditor editor, Gtk.TextIter start, Gtk.TextIter end)
{
calendar = new Calendar ();
Expand All @@ -72,7 +97,7 @@ protected override bool OnActivate (NoteEditor editor, Gtk.TextIter start, Gtk.T
dialog.AddButton ("OK", ResponseType.Ok);
dialog.AddButton ("Cancel", ResponseType.Cancel);

dialog.Response += new ResponseHandler (on_dialog_response);
dialog.Response += new ResponseHandler (OnDialogResponse);
dialog.Run ();
dialog.Destroy ();

Expand All @@ -88,7 +113,7 @@ protected override bool OnActivate (NoteEditor editor, Gtk.TextIter start, Gtk.T
/// <param name="args">
/// A <see cref="ResponseArgs"/>
/// </param>
void on_dialog_response (object obj, ResponseArgs args)
void OnDialogResponse (object obj, ResponseArgs args)
{
if (args.ResponseId != ResponseType.Ok)
return;
Expand Down
29 changes: 27 additions & 2 deletions Tags/PriorityTag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ namespace Tomboy.TaskManager

/// <summary>
/// Tag that identifies a priority.
/// Responsible only for mouse listening
/// </summary>
public class PriorityTag : NoteTag
{
Expand All @@ -52,6 +53,21 @@ public override void Initialize (string element_name)
CanSerialize = false;
}

/// <summary>
/// Sets up the combo box dialog and shows it
/// </summary>
/// <param name="editor">
/// A <see cref="NoteEditor"/>
/// </param>
/// <param name="start">
/// A <see cref="Gtk.TextIter"/>
/// </param>
/// <param name="end">
/// A <see cref="Gtk.TextIter"/>
/// </param>
/// <returns>
/// A <see cref="System.Boolean"/>
/// </returns>
protected override bool OnActivate (NoteEditor editor, Gtk.TextIter start, Gtk.TextIter end)
{
string[] prios = new string[6];
Expand All @@ -77,14 +93,23 @@ protected override bool OnActivate (NoteEditor editor, Gtk.TextIter start, Gtk.T
dialog.AddButton ("OK", ResponseType.Ok);
dialog.AddButton ("Cancel", ResponseType.Cancel);

dialog.Response += new ResponseHandler (on_dialog_response);
dialog.Response += new ResponseHandler (OnDialogResponse);
dialog.Run ();
dialog.Destroy ();

return true;
}

void on_dialog_response (object obj, ResponseArgs args)
/// <summary>
/// Gets the chosen priority from the combo box and notifies corresponding task
/// </summary>
/// <param name="obj">
/// A <see cref="System.Object"/>
/// </param>
/// <param name="args">
/// A <see cref="ResponseArgs"/>
/// </param>
void OnDialogResponse (object obj, ResponseArgs args)
{
if (args.ResponseId != ResponseType.Ok)
return;
Expand Down
6 changes: 3 additions & 3 deletions Tags/TaskListTag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
namespace Tomboy.TaskManager
{
/// <summary>
/// Marks a Task in a NoteBuffer. Currently this does nothing (used to restore notes)
/// Marks a TaskList in a NoteBuffer.
/// </summary>
public class TaskListTag : AttributedTaskTag
{
Expand All @@ -49,9 +49,9 @@ public TaskList TaskList {
/// <param name="element_name">
/// A <see cref="System.String"/>
/// </param>
public override void Initialize (string element_name)
public override void Initialize (string elementName)
{
base.Initialize (element_name);
base.Initialize (elementName);

ParagraphBackground = "lightgray";
LeftMargin = 8;
Expand Down
4 changes: 2 additions & 2 deletions Tags/TaskTag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
namespace Tomboy.TaskManager
{
/// <summary>
/// Marks a Task in a NoteBuffer. Currently this does nothing (used to restore notes)
/// Marks a Task in a NoteBuffer.
/// </summary>
public class TaskTag : AttributedTaskTag
{
Expand Down Expand Up @@ -67,7 +67,7 @@ public override void Initialize (string element_name)
/// </summary>
public Priority TaskPriority {
get {
return (Priority)Enum.Parse (typeof(Priority), Attributes["Priority"]);
return PriorityUtils.FromString(Attributes["Priority"]);
}
set {
Attributes["Priority"] = value.ToString ();
Expand Down
4 changes: 4 additions & 0 deletions Visitors/Visitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@

namespace Tomboy.TaskManager
{
/// <summary>
/// The class that describes the visitor pattern over the tasks structure.
/// Although visit (Note n) is not used here, it may turn out to be useful in the future (e.g. for printing or similar)
/// </summary>
public interface Visitor
{
void visit (Note n);
Expand Down

0 comments on commit df4c396

Please sign in to comment.