muine r1215 - in trunk: . data src



Author: lmedinas
Date: Sun Sep 28 00:20:03 2008
New Revision: 1215
URL: http://svn.gnome.org/viewvc/muine?rev=1215&view=rev

Log:
    2008-09-28  Luis Medinas  <metalgod gnome org>

            * data/muine.schemas.in:
            * src/PlaylistWindow.cs:

            Fix main window position after quit muine.
            Closes bgo #339820. Patch from Adolfo BlÃsquez
            <code infinicode org>."

Modified:
   trunk/ChangeLog
   trunk/data/muine.schemas.in
   trunk/src/PlaylistWindow.cs

Modified: trunk/data/muine.schemas.in
==============================================================================
--- trunk/data/muine.schemas.in	(original)
+++ trunk/data/muine.schemas.in	Sun Sep 28 00:20:03 2008
@@ -24,6 +24,28 @@
       </locale>
     </schema>
     <schema>
+      <key>/schemas/apps/muine/playlist_window/pos_x</key>
+      <applyto>/apps/muine/playlist_window/pos_x</applyto>
+      <owner>muine</owner>
+      <type>int</type>
+      <default>0</default>
+      <locale name="C">
+        <short>Playlist window horizontal position</short>
+        <long>Horizontal position of the playlist window.</long>
+      </locale>
+    </schema>
+    <schema>
+      <key>/schemas/apps/muine/playlist_window/pos_y</key>
+      <applyto>/apps/muine/playlist_window/pos_y</applyto>
+      <owner>muine</owner>
+      <type>int</type>
+      <default>0</default>
+      <locale name="C">
+        <short>Playlist window vertical position</short>
+        <long>Vertical position of the playlist window.</long>
+      </locale>
+    </schema>
+    <schema>
       <key>/schemas/apps/muine/add_song_window/width</key>
       <applyto>/apps/muine/add_song_window/width</applyto>
       <owner>muine</owner>

Modified: trunk/src/PlaylistWindow.cs
==============================================================================
--- trunk/src/PlaylistWindow.cs	(original)
+++ trunk/src/PlaylistWindow.cs	Sun Sep 28 00:20:03 2008
@@ -59,6 +59,12 @@
 		// GConf :: Height
 		private const string GConfKeyHeight = "/apps/muine/playlist_window/height";
 		private const int    GConfDefaultHeight = 450;
+		
+		private const string GConfKeyPosX = "/apps/muine/playlist_window/pos_x";
+		private const int    GConfDefaultPosX = 0; 
+
+		private const string GConfKeyPosY = "/apps/muine/playlist_window/pos_y";
+		private const int    GConfDefaultPosY = 0;
 
 		// GConf :: Volume
 		private const string GConfKeyVolume = "/apps/muine/volume";
@@ -452,6 +458,7 @@
 		// Methods :: Public :: Quit (IPlayer)
 		public void Quit ()
 		{
+			SaveWindowPosition ();
 			Global.Exit ();
 		}
 
@@ -1501,7 +1508,12 @@
 			int width  = (int) Config.Get (GConfKeyWidth , GConfDefaultWidth );
 			int height = (int) Config.Get (GConfKeyHeight, GConfDefaultHeight);
 
+			// Window position
+			int pos_x = (int) Config.Get (GConfKeyPosX, GConfDefaultPosX);
+			int pos_y = (int) Config.Get (GConfKeyPosY, GConfDefaultPosY);
+
 			SetDefaultSize (width, height);
+			Move (pos_x, pos_y);
 
 			SizeAllocated += OnSizeAllocated;
 
@@ -1517,6 +1529,18 @@
 			Config.AddNotify (GConfKeyRepeat,
 				new GConf.NotifyEventHandler (OnConfigRepeatChanged));
 		}
+		
+		//Methods:: Private :: SaveWindowPosition
+		private void SaveWindowPosition ()
+		{
+			// Get Window position
+			int pos_x, pos_y;
+			GetPosition (out pos_x, out pos_y);
+
+			// Save it to GConf
+			Config.Set (GConfKeyPosX , pos_x );
+			Config.Set (GConfKeyPosY, pos_y);
+		}
 
 		// Handlers
 		// Handlers :: OnStateChanged



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