tomboy r2303 - in trunk: . Tomboy data



Author: sharm
Date: Sat Jan 31 17:28:48 2009
New Revision: 2303
URL: http://svn.gnome.org/viewvc/tomboy?rev=2303&view=rev

Log:
* tomboy/Tomboy/Preferences.cs:
* tomboy/data/tomboy.schemas.in: Add search window position keys to
  schema.

* tomboy/Tomboy/RecentChanges.cs: Use integers instead of strings to
  store window position. Intended to fix bug #559663.

Modified:
   trunk/ChangeLog
   trunk/Tomboy/Preferences.cs
   trunk/Tomboy/RecentChanges.cs
   trunk/data/tomboy.schemas.in

Modified: trunk/Tomboy/Preferences.cs
==============================================================================
--- trunk/Tomboy/Preferences.cs	(original)
+++ trunk/Tomboy/Preferences.cs	Sat Jan 31 17:28:48 2009
@@ -40,7 +40,6 @@
 
 		public const string INSERT_TIMESTAMP_FORMAT = "/apps/tomboy/insert_timestamp/format";
 		
-		// TODO: Convert these into properly localized settings in 0.11.x after freeze is lifted
 		public const string SEARCH_WINDOW_X_POS = "/apps/tomboy/search_window_x_pos";
 		public const string SEARCH_WINDOW_Y_POS = "/apps/tomboy/search_window_y_pos";
 		public const string SEARCH_WINDOW_WIDTH = "/apps/tomboy/search_window_width";

Modified: trunk/Tomboy/RecentChanges.cs
==============================================================================
--- trunk/Tomboy/RecentChanges.cs	(original)
+++ trunk/Tomboy/RecentChanges.cs	Sat Jan 31 17:28:48 2009
@@ -1401,28 +1401,28 @@
 			GetPosition(out x, out y);
 			GetSize(out width, out height);
 			
-			Preferences.Set (Preferences.SEARCH_WINDOW_X_POS, x.ToString ());
-			Preferences.Set (Preferences.SEARCH_WINDOW_Y_POS, y.ToString ());
-			Preferences.Set (Preferences.SEARCH_WINDOW_WIDTH, width.ToString ());
-			Preferences.Set (Preferences.SEARCH_WINDOW_HEIGHT, height.ToString ());
+			Preferences.Set (Preferences.SEARCH_WINDOW_X_POS, x);
+			Preferences.Set (Preferences.SEARCH_WINDOW_Y_POS, y);
+			Preferences.Set (Preferences.SEARCH_WINDOW_WIDTH, width);
+			Preferences.Set (Preferences.SEARCH_WINDOW_HEIGHT, height);
         }
         
         private void RestorePosition ()
         {
-        	string xStr = Preferences.Get (Preferences.SEARCH_WINDOW_X_POS) as string;
-        	string yStr = Preferences.Get (Preferences.SEARCH_WINDOW_Y_POS) as string;
-        	string widthStr = Preferences.Get (Preferences.SEARCH_WINDOW_WIDTH) as string;
-        	string heightStr = Preferences.Get (Preferences.SEARCH_WINDOW_HEIGHT) as string;
+        	object x = Preferences.Get (Preferences.SEARCH_WINDOW_X_POS);
+        	object y = Preferences.Get (Preferences.SEARCH_WINDOW_Y_POS);
+        	object width = Preferences.Get (Preferences.SEARCH_WINDOW_WIDTH);
+        	object height = Preferences.Get (Preferences.SEARCH_WINDOW_HEIGHT);
         	
-        	if (xStr == null || xStr == string.Empty
-        			|| yStr == null || yStr == string.Empty
-        			|| widthStr == null || widthStr == string.Empty
-        			|| heightStr == null || heightStr == string.Empty)
+        	if (x == null || !(x is int)
+        			|| y == null || !(y is int)
+        			|| width == null || !(width is int)
+        			|| height == null || !(height is int))
         		return;
         	
         	DefaultSize =
-        		new Gdk.Size (int.Parse (widthStr), int.Parse (heightStr));
-        	Move (int.Parse (xStr), int.Parse (yStr));
+        		new Gdk.Size ((int) width, (int) height);
+        	Move ((int) x, (int) y);
         }
         
         private void OnExitingEvent (object sender, EventArgs args)

Modified: trunk/data/tomboy.schemas.in
==============================================================================
--- trunk/data/tomboy.schemas.in	(original)
+++ trunk/data/tomboy.schemas.in	Sat Jan 31 17:28:48 2009
@@ -268,6 +268,62 @@
     </schema>
 
     <schema>
+      <key>/schemas/apps/tomboy/search_window_height</key>
+      <applyto>/apps/tomboy/search_window_height</applyto>
+      <owner>tomboy</owner>
+      <type>int</type>
+      <default>0</default>
+      <locale name="C">
+         <short>Saved height of Search window</short>
+         <long>
+           Determines pixel height of Search window; stored on Tomboy exit.
+         </long>
+      </locale>
+    </schema>
+
+    <schema>
+      <key>/schemas/apps/tomboy/search_window_width</key>
+      <applyto>/apps/tomboy/search_window_width</applyto>
+      <owner>tomboy</owner>
+      <type>int</type>
+      <default>550</default>
+      <locale name="C">
+         <short>Saved width of Search window</short>
+         <long>
+           Determines pixel width of Search window; stored on Tomboy exit.
+         </long>
+      </locale>
+    </schema>
+
+    <schema>
+      <key>/schemas/apps/tomboy/search_window_x_pos</key>
+      <applyto>/apps/tomboy/search_window_x_pos</applyto>
+      <owner>tomboy</owner>
+      <type>int</type>
+      <default>0</default>
+      <locale name="C">
+         <short>Saved horizontal position of Search window</short>
+         <long>
+           Determines X coordinate of Search window; stored on Tomboy exit.
+         </long>
+      </locale>
+    </schema>
+
+    <schema>
+      <key>/schemas/apps/tomboy/search_window_y_pos</key>
+      <applyto>/apps/tomboy/search_window_y_pos</applyto>
+      <owner>tomboy</owner>
+      <type>int</type>
+      <default>0</default>
+      <locale name="C">
+         <short>Saved vertical position of Search window</short>
+         <long>
+           Determines Y coordinate of Search window; stored on Tomboy exit.
+         </long>
+      </locale>
+    </schema>
+
+    <schema>
       <key>/schemas/apps/tomboy/export_html/last_directory</key>
       <applyto>/apps/tomboy/export_html/last_directory</applyto>
       <owner>tomboy</owner>



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