Index: Tomboy/NoteWindow.cs
===================================================================
--- Tomboy/NoteWindow.cs	(revision 1664)
+++ Tomboy/NoteWindow.cs	(working copy)
@@ -285,6 +285,12 @@
 			}
 		}
 
+		public Gtk.AccelGroup AccelGroup {
+			get {
+				return accel_group;
+			}
+		}
+
 		//
 		// Sensitize the Link toolbar button on text selection
 		//
Index: Tomboy/Addins/InsertTimestamp/InsertTimestampNoteAddin.cs
===================================================================
--- Tomboy/Addins/InsertTimestamp/InsertTimestampNoteAddin.cs	(revision 1664)
+++ Tomboy/Addins/InsertTimestamp/InsertTimestampNoteAddin.cs	(working copy)
@@ -9,33 +9,48 @@
 namespace Tomboy.InsertTimestamp {
 	public class InsertTimestampNoteAddin : NoteAddin {
 
+		String date_format;
 		Gtk.MenuItem item;
 
 		public override void Initialize ()
 		{
-			item = new Gtk.MenuItem (
-			        Catalog.GetString ("Insert Timestamp"));
-			item.Activated += OnMenuItemActivated;
-			item.Show ();
-			AddPluginMenuItem (item);
 		}
 
 		public override void Shutdown ()
 		{
-			item.Activated -= OnMenuItemActivated;
+			if (item != null)
+				item.Activated -= OnMenuItemActivated;
 		}
 
 		public override void OnNoteOpened ()
 		{
+			// Add the menu item when the window is created
+			item = new Gtk.MenuItem (
+				Catalog.GetString ("Insert Timestamp"));
+			item.Activated += OnMenuItemActivated;
+			item.AddAccelerator ("activate", Window.AccelGroup,
+				(uint) Gdk.Key.d, Gdk.ModifierType.ControlMask,
+				Gtk.AccelFlags.Visible);
+			item.Show ();
+			AddPluginMenuItem (item);
+
+			// Get the format from GConf and subscribe to changes
+			date_format = (string) Preferences.Get (
+				Preferences.INSERT_TIMESTAMP_FORMAT);
+			Preferences.SettingChanged += OnFormatSettingChanged;
 		}
 
 		void OnMenuItemActivated (object sender, EventArgs args)
 		{
-			string format = Catalog.GetString ("dddd, MMMM d, h:mm tt");
-			string text = DateTime.Now.ToString (format);
-
+			string text = DateTime.Now.ToString (date_format);
 			Gtk.TextIter cursor = Buffer.GetIterAtMark (Buffer.InsertMark);
 			Buffer.InsertWithTagsByName (ref cursor, text, "datetime");
 		}
+
+		void OnFormatSettingChanged (object sender, GConf.NotifyEventArgs args)
+		{
+			if (args.Key == Preferences.INSERT_TIMESTAMP_FORMAT)
+				date_format = (string) args.Value;
+		}
 	}
 }
Index: Tomboy/Addins/InsertTimestamp/InsertTimestamp.addin.xml
===================================================================
--- Tomboy/Addins/InsertTimestamp/InsertTimestamp.addin.xml	(revision 1664)
+++ Tomboy/Addins/InsertTimestamp/InsertTimestamp.addin.xml	(working copy)
@@ -18,4 +18,8 @@
 	<Extension path="/Tomboy/NoteAddins">
 		<NoteAddin type="Tomboy.InsertTimestamp.InsertTimestampNoteAddin" />
 	</Extension>
-+</Addin>
+
+	<Extension path="/Tomboy/AddinPreferences">
+		<AddinPreferenceFactory type="Tomboy.InsertTimestamp.InsertTimestampPreferencesFactory" />
+	</Extension>
+</Addin>
Index: Tomboy/Addins/InsertTimestamp/InsertTimestampPreferencesFactory.cs
===================================================================
--- Tomboy/Addins/InsertTimestamp/InsertTimestampPreferencesFactory.cs	(revision 0)
+++ Tomboy/Addins/InsertTimestamp/InsertTimestampPreferencesFactory.cs	(revision 0)
@@ -0,0 +1,17 @@
+//
+// InsertTimestampPreferencesFactory.cs: Creates a widget that will be used in
+// the addin's preferences dialog.
+//
+
+using System;
+
+using Tomboy;
+
+namespace Tomboy.InsertTimestamp {
+	public class InsertTimestampPreferencesFactory : AddinPreferenceFactory {
+		public override Gtk.Widget CreatePreferenceWidget ()
+		{
+			return new InsertTimestampPreferences ();
+		}
+	}
+}
Index: Tomboy/Addins/InsertTimestamp/Makefile.am
===================================================================
--- Tomboy/Addins/InsertTimestamp/Makefile.am	(revision 1664)
+++ Tomboy/Addins/InsertTimestamp/Makefile.am	(working copy)
@@ -14,7 +14,9 @@
 ADDIN_NAME = InsertTimestamp
 TARGET = $(ADDIN_NAME).dll
 CSFILES = \
-	$(srcdir)/InsertTimestampNoteAddin.cs
+	$(srcdir)/InsertTimestampNoteAddin.cs		\
+	$(srcdir)/InsertTimestampPreferences.cs		\
+	$(srcdir)/InsertTimestampPreferencesFactory.cs
 RESOURCES = \
 	-resource:$(srcdir)/$(ADDIN_NAME).addin.xml
 
Index: Tomboy/Addins/InsertTimestamp/InsertTimestampPreferences.cs
===================================================================
--- Tomboy/Addins/InsertTimestamp/InsertTimestampPreferences.cs	(revision 0)
+++ Tomboy/Addins/InsertTimestamp/InsertTimestampPreferences.cs	(revision 0)
@@ -0,0 +1,169 @@
+//
+// InsertTimestampPreferences.cs: Preferences dialog for InsertTimestamp addin.
+// Allows configuration of timestamp format.
+//
+
+using System;
+using System.Collections.Generic;
+
+using GConf.PropertyEditors;
+using Mono.Unix;
+
+using Tomboy;
+
+namespace Tomboy.InsertTimestamp {
+	public class InsertTimestampPreferences : Gtk.VBox {
+
+		static List<string> formats;
+
+		Gtk.RadioButton selected_radio;
+		Gtk.RadioButton custom_radio;
+
+		Gtk.ScrolledWindow scroll;
+		Gtk.TreeView tv;
+		Gtk.ListStore store;
+		Gtk.Entry custom_entry;
+
+		static InsertTimestampPreferences ()
+		{
+			String defaultFormat = Catalog.GetString (
+				"dddd, MMMM d, h:mm tt");
+
+			formats = new List<string> ();
+			formats.Add (defaultFormat);
+			formats.Add ("MM/dd/yyyy hh:mm tt");
+			formats.Add ("dd.MM.yyyy HH:mm");
+			formats.Add ("MM/dd/yyyy");
+			formats.Add ("MM.dd.yyyy");
+			formats.Add ("dd/MM/yyyy");
+			formats.Add ("dd.MM.yyyy");
+			formats.Add ("hh:mm tt");
+			formats.Add ("HH:mm");
+			formats.Add ("HH:mm:ss");
+		}
+
+		public InsertTimestampPreferences () : base (false, 12)
+		{	
+			// Get current values
+			String dateFormat = (string) Preferences.Get (
+				Preferences.INSERT_TIMESTAMP_FORMAT);
+
+			DateTime now = DateTime.Now;
+
+			// Label
+			Gtk.Label label = new Gtk.Label (Catalog.GetString (
+				"Choose one of the predefined formats " +
+				"or use your own."));
+			label.Wrap = true;
+			label.Xalign = 0;
+			PackStart (label);
+
+			// Use Selected Format
+			selected_radio = new Gtk.RadioButton (Catalog.GetString (
+				"Use _Selected Format"));
+			PackStart (selected_radio);
+
+			// 1st column (visible): formatted date
+			// 2nd column (not visible): date format
+			store = new Gtk.ListStore (typeof (string),
+				typeof (string));
+			foreach (String format in formats)
+				store.AppendValues (now.ToString (format), format);
+
+			scroll = new Gtk.ScrolledWindow();
+			scroll.ShadowType = Gtk.ShadowType.In;
+			PackStart (scroll);
+
+			tv = new Gtk.TreeView (store);
+			tv.HeadersVisible = false;
+			tv.AppendColumn ("Format", new Gtk.CellRendererText (),
+				"text", 0);
+			scroll.Add (tv);
+
+			// Use Custom Format
+			Gtk.HBox customBox = new Gtk.HBox (false, 12);
+			PackStart (customBox);
+
+			custom_radio = new Gtk.RadioButton (
+				selected_radio, Catalog.GetString ("_Use Custom Format"));
+			customBox.PackStart (custom_radio);
+
+			custom_entry = new Gtk.Entry ();
+			customBox.PackStart (custom_entry);
+
+			PropertyEditorEntry entryEditor = new PropertyEditorEntry (
+				Preferences.INSERT_TIMESTAMP_FORMAT, custom_entry);
+			entryEditor.Setup ();
+
+			// Activate/deactivate widgets
+			bool useCustom = true;
+			Gtk.TreeIter iter;
+			store.GetIterFirst (out iter);
+
+			foreach (object[] row in store) {
+				if (dateFormat.Equals (row[1])) {
+					// Found format in list
+					useCustom = false;
+					break;
+				}	
+				store.IterNext (ref iter);
+			}
+
+			if (useCustom) {
+				custom_radio.Active = true;
+				scroll.Sensitive = false;
+			} else {
+				selected_radio.Active = true;
+				custom_entry.Sensitive = false;
+				tv.Selection.SelectIter (iter);
+				Gtk.TreePath path = store.GetPath (iter);				
+				tv.ScrollToCell (path, null, false, 0, 0);
+			}
+
+			// Register Toggled event for one radio button only
+			selected_radio.Toggled += OnSelectedRadioToggled;
+			tv.Selection.Changed += OnSelectionChanged;
+
+			ShowAll ();
+		}
+
+		/// <summary>
+		/// Called when toggling between radio buttons.
+		/// Activate/deactivat widgets depending on selection.
+		/// </summary>
+		void OnSelectedRadioToggled (object sender, EventArgs args)
+		{
+			if (selected_radio.Active) {
+				scroll.Sensitive = true;
+				custom_entry.Sensitive = false;
+				// select 1st row
+				Gtk.TreeIter iter;
+				store.GetIterFirst (out iter);
+				tv.Selection.SelectIter (iter);
+				Gtk.TreePath path = store.GetPath (iter);				
+				tv.ScrollToCell (path, null, false, 0, 0);
+			} else {
+				scroll.Sensitive = false;
+				custom_entry.Sensitive = true;
+				tv.Selection.UnselectAll ();
+			}
+		}
+
+		/// <summary>
+		/// Called when a different format is selected in the TreeView.
+		/// Set the GConf key to selected format.
+		/// </summary>
+		void OnSelectionChanged (object sender, EventArgs args)
+		{
+			Gtk.TreeModel model;
+			Gtk.TreeIter iter;
+
+			if (((Gtk.TreeSelection) sender).GetSelected (out model, 
+				out iter)) {
+				string format = (string) model.GetValue (iter, 1);
+				Preferences.Set (Preferences.INSERT_TIMESTAMP_FORMAT,
+					format);
+			}
+		}
+	}
+}
Index: Tomboy/Preferences.cs
===================================================================
--- Tomboy/Preferences.cs	(revision 1664)
+++ Tomboy/Preferences.cs	(working copy)
@@ -1,6 +1,8 @@
 
 using System;
 
+using Mono.Unix;
+
 namespace Tomboy
 {
 	public class Preferences
@@ -34,6 +36,8 @@
 		public const string SYNC_SELECTED_SERVICE_ADDIN = "/apps/tomboy/sync/sync_selected_service_addin";
 		public const string SYNC_CONFIGURED_CONFLICT_BEHAVIOR = "/apps/tomboy/sync/sync_conflict_behavior";
 
+		public const string INSERT_TIMESTAMP_FORMAT = "/apps/tomboy/insert_timestamp/format";
+
 		static GConf.Client client;
 		static GConf.NotifyEventHandler changed_handler;
 
@@ -114,6 +118,9 @@
 
 			case SYNC_CONFIGURED_CONFLICT_BEHAVIOR:
 				return 0;
+
+			case INSERT_TIMESTAMP_FORMAT:
+				return Catalog.GetString ("dddd, MMMM d, h:mm tt");
 			}
 
 			return null;
Index: data/tomboy.schemas.in
===================================================================
--- data/tomboy.schemas.in	(revision 1664)
+++ data/tomboy.schemas.in	(working copy)
@@ -378,6 +378,20 @@
     </schema>
 
     <schema>
+      <key>/schemas/apps/tomboy/insert_timestamp/format</key>
+      <applyto>/apps/tomboy/insert_timestamp/format</applyto>
+      <owner>tomboy</owner>
+      <type>string</type>
+      <default>dddd, MMMM d, h:mm tt</default>
+      <locale name="C">
+         <short>Timestamp format</short>
+         <long>
+	   The date format that is used for the timestamp.
+         </long>
+      </locale>
+    </schema>
+
+    <schema>
       <key>/schemas/desktop/gnome/url-handlers/note/command</key>
       <applyto>/desktop/gnome/url-handlers/note/command</applyto>
       <owner>tomboy</owner>
