[tomboy] Make maximum title length in note menu configurable (bug #417145).



commit 5ed82df978a7a697d54c1ed9becb704d8b1ce35e
Author: Sandy Armstrong <sanfordarmstrong gmail com>
Date:   Sat Aug 22 18:24:05 2009 -0700

    Make maximum title length in note menu configurable (bug #417145).
    
    Re-apply Jeff Tickle's patch making this value configurable in gconf.

 Tomboy/Preferences.cs  |    4 ++++
 Tomboy/Tray.cs         |    4 ++--
 data/tomboy.schemas.in |   15 +++++++++++++++
 3 files changed, 21 insertions(+), 2 deletions(-)
---
diff --git a/Tomboy/Preferences.cs b/Tomboy/Preferences.cs
index 6975091..bba7738 100644
--- a/Tomboy/Preferences.cs
+++ b/Tomboy/Preferences.cs
@@ -20,6 +20,7 @@ namespace Tomboy
 		public const string CUSTOM_FONT_FACE = "/apps/tomboy/custom_font_face";
 		public const string MENU_NOTE_COUNT = "/apps/tomboy/menu_note_count";
 		public const string MENU_PINNED_NOTES = "/apps/tomboy/menu_pinned_notes";
+		public const string MENU_ITEM_MAX_LENGTH = "/apps/tomboy/tray_menu_item_max_length";
 
 		public const string KEYBINDING_SHOW_NOTE_MENU = "/apps/tomboy/global_keybindings/show_note_menu";
 		public const string KEYBINDING_OPEN_START_HERE = "/apps/tomboy/global_keybindings/open_start_here";
@@ -94,6 +95,9 @@ namespace Tomboy
 			case MENU_PINNED_NOTES:
 				return string.Empty;
 
+			case MENU_ITEM_MAX_LENGTH:
+				return 100;
+
 			case KEYBINDING_SHOW_NOTE_MENU:
 				return "<Alt>F12";
 
diff --git a/Tomboy/Tray.cs b/Tomboy/Tray.cs
index 2c67847..c063287 100644
--- a/Tomboy/Tray.cs
+++ b/Tomboy/Tray.cs
@@ -57,10 +57,10 @@ namespace Tomboy
 		static string GetDisplayName (Note note)
 		{
 			string display_name = note.Title;
-			int max_length = 100;
+			int max_length = (int) Preferences.Get (Preferences.MENU_ITEM_MAX_LENGTH);
 
 			if (note.IsNew) {
-				string new_string = Catalog.GetString(" (new)");
+				string new_string = Catalog.GetString (" (new)");
 				max_length -= new_string.Length;
 				display_name = Ellipsify (display_name, max_length)
 					+ new_string;
diff --git a/data/tomboy.schemas.in b/data/tomboy.schemas.in
index c241042..ae52020 100644
--- a/data/tomboy.schemas.in
+++ b/data/tomboy.schemas.in
@@ -151,6 +151,21 @@
          </long>
       </locale>
     </schema>
+
+    <schema>
+      <key>/schemas/apps/tomboy/tray_menu_item_max_length</key>
+      <applyto>/apps/tomboy/tray_menu_item_max_length</applyto>
+      <owner>tomboy</owner>
+      <type>int</type>
+      <default>100</default>
+      <locale name="C">
+         <short>Maximum note title length to show in tray menu.</short>
+         <long>
+	   Maximum characters of note title to show in the Tomboy tray or
+	   panel applet note menu.
+         </long>
+      </locale>
+    </schema>
     
     <schema>
       <key>/schemas/apps/tomboy/enable_startup_notes</key>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]