[tomboy/xdg-migration2: 7/16] Make maximum title length in note menu configurable (bug #417145).



commit 40907994d9388002aa0b9075c25353dfdb092ec5
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 66d0d95..423b2f2 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]