PERFORCE change 125371 for review
Andrew Turner
andrew at FreeBSD.org
Sun Aug 19 18:38:08 PDT 2007
http://perforce.freebsd.org/chv.cgi?CH=125371
Change 125371 by andrew at 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
More information about the p4-projects
mailing list