[tomboy-list] Timestamp idea
pete at yellowhouse.org
Fri Jun 15 10:33:01 PDT 2007
On 6/15/07, Raymond Auge <rauge at liferay.com> wrote:
> I did just this by customizing the example for InsertDateTime.cs on the
> Here is the code I used (virtually the same as that on the plugin tutorial
> using System;
> using Mono.Unix;
> using Gtk;
> using Tomboy;
> "Insert Date/Time", Defines.VERSION,
> "Inserts current date and time at the cursor position.",
> WebSite = "http://www.gnome.org/projects/tomboy/"
> public class InsertDateTimePlugin : NotePlugin
> Gtk.MenuItem item;
> protected override void Initialize ()
> item = new Gtk.MenuItem (Catalog.GetString ("Insert date and time"));
> item.Activated += OnMenuItemActivated;
> item.Show ();
> AddPluginMenuItem (item);
> protected override void Shutdown ()
> item.Activated -= OnMenuItemActivated;
> protected override void OnNoteOpened ()
> * To Add the date when a new note is opened I would just
> add similar code here.
> void OnMenuItemActivated (object sender, EventArgs args)
> string format = Catalog.GetString ("dddd, MMMM d yyyy, h:mm tt");
> string text = DateTime.Now.ToString (format);
> NoteBuffer buffer = Note.Buffer;
> Gtk.TextIter cursor = buffer.GetIterAtMark (buffer.InsertMark);
> buffer.InsertWithTagsByName (ref cursor, text, "bold");
> Compile with
> $] gmcs -debug -out:InsertDateTime.dll -target:library -pkg:tomboy-plugins
> -r:Mono.Posix InsertDateTime.cs
> On Fri, 2007-06-15 at 11:04 -0400, Pete Goodall wrote:
> Hi all,
> Was just browsing through the Place for Ideas site, and noticed theTimestamps idea:http://live.gnome.org/Tomboy/PlaceForNewIdeas#head-4c3b027684b342a623f2133a20f669f6428dd0a6
> This is similar to what I had in mind, but a bit of overkill. Isimply want an "Insert timestamp" option. For instance, when I starta new note, I would like to have "Note started on Friday, 15 June 2007@ 11:02 am EST". Then later in the note I would "Insert timestamp" topaste in the time I started an edit. This would be useful if I have anote that includes meeting notes from various meetings over time.
> Anyway, that's my $0.02.
> - Pete
> Raymond Auge <rauge at liferay.com>
> Software Engineer
> Liferay, Inc. <http://www.liferay.com>
> Enterprise. Open Source. For Life.
Pete Goodall <pete at yellowhouse.org>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the tomboy-list