@@ -724,6 +724,8 @@ def __init__(self, parent=None):
724724 QtCore .QObject .connect (self .ui .horizontalSliderTTL , QtCore .SIGNAL (
725725 "valueChanged(int)" ), self .updateTTL )
726726
727+ self .readSettings ()
728+
727729 # Check to see whether we can connect to namecoin. Hide the 'Fetch Namecoin ID' button if we can't.
728730 try :
729731 options = {}
@@ -2741,6 +2743,11 @@ def quit(self):
27412743 # unregister the messaging system
27422744 if self .mmapp is not None :
27432745 self .mmapp .unregister ()
2746+
2747+ settings = QSettings ("Mailchuck Ltd." , "PyBitmessage" )
2748+ settings .setValue ("geometry" , self .saveGeometry ())
2749+ settings .setValue ("state" , self .saveState ())
2750+
27442751 self .statusBar ().showMessage (_translate (
27452752 "MainWindow" , "All done. Closing user interface..." ))
27462753 os ._exit (0 )
@@ -3584,6 +3591,20 @@ def updateStatusBar(self, data):
35843591
35853592 self .statusBar ().showMessage (data )
35863593
3594+ def readSettings (self ):
3595+ settings = QSettings ("Mailchuck Ltd." , "PyBitmessage" )
3596+ try :
3597+ geom = settings .value ("geometry" )
3598+ self .restoreGeometry (geom .toByteArray () if hasattr (geom , 'toByteArray' ) else geom )
3599+ except Exception as e :
3600+ pass
3601+
3602+ try :
3603+ state = settings .value ("state" )
3604+ self .restoreState (state .toByteArray () if hasattr (state , 'toByteArray' ) else state )
3605+ except Exception as e :
3606+ pass
3607+
35873608
35883609class helpDialog (QtGui .QDialog ):
35893610
0 commit comments