@@ -724,6 +724,8 @@ def __init__(self, parent=None):
724
724
QtCore .QObject .connect (self .ui .horizontalSliderTTL , QtCore .SIGNAL (
725
725
"valueChanged(int)" ), self .updateTTL )
726
726
727
+ self .readSettings ()
728
+
727
729
# Check to see whether we can connect to namecoin. Hide the 'Fetch Namecoin ID' button if we can't.
728
730
try :
729
731
options = {}
@@ -2741,6 +2743,11 @@ def quit(self):
2741
2743
# unregister the messaging system
2742
2744
if self .mmapp is not None :
2743
2745
self .mmapp .unregister ()
2746
+
2747
+ settings = QSettings ("Mailchuck Ltd." , "PyBitmessage" )
2748
+ settings .setValue ("geometry" , self .saveGeometry ())
2749
+ settings .setValue ("state" , self .saveState ())
2750
+
2744
2751
self .statusBar ().showMessage (_translate (
2745
2752
"MainWindow" , "All done. Closing user interface..." ))
2746
2753
os ._exit (0 )
@@ -3584,6 +3591,20 @@ def updateStatusBar(self, data):
3584
3591
3585
3592
self .statusBar ().showMessage (data )
3586
3593
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
+
3587
3608
3588
3609
class helpDialog (QtGui .QDialog ):
3589
3610
0 commit comments