Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Aug 2007 01:38:07 GMT
From:      Andrew Turner <andrew@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 125371 for review
Message-ID:  <200708200138.l7K1c7p3033084@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=125371

Change 125371 by andrew@andrew_hermies on 2007/08/20 01:37:08

	Save the width/height of the window on close and use it to set the initial size

Affected files ...

.. //depot/projects/soc2007/andrew-update/frontend/facund/gui/main_window.py#14 edit

Differences ...

==== //depot/projects/soc2007/andrew-update/frontend/facund/gui/main_window.py#14 (text+ko) ====

@@ -25,6 +25,7 @@
 #
 
 import facund
+import gconf
 import gtk
 import gtk.gdk
 import gtk.glade
@@ -40,6 +41,12 @@
 		self.__widget = self.__xml.get_widget('facundWindow')
             	self.__widget.connect('destroy', self.onQuit)
 
+		self.__client = gconf.client_get_default()
+		self.__width = self.__client.get_int('/facund/gui/width') or 400
+		self.__height = self.__client.get_int('/facund/gui/height') or 300
+		self.__widget.set_default_size(self.__width, self.__height)
+		self.__widget.connect('configure-event', self.onConfigure)
+
 		# Open the new computer window on File > New
 		menuItem = self.__xml.get_widget('newConnection')
 		menuItem.connect('activate', self.newConnection)
@@ -63,8 +70,16 @@
 
 	def onQuit(self, data):
 		self.__controller.shutdown()
+
+		# Save the width/height
+		self.__client.set_int('/facund/gui/width', self.__width)
+		self.__client.set_int('/facund/gui/height', self.__height)
 		gtk.main_quit()
 
+	def onConfigure(self, widget, event):
+		self.__width = event.width
+		self.__height = event.height
+
 	def newConnection(self, data):
 		widget = self.__xml.get_widget('newConnectionDialog')
 		self.__newConnectionDialog = widget



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200708200138.l7K1c7p3033084>