Implemented position/size persistence of pyfa's main window

This commit is contained in:
HomeWorld
2010-12-04 17:02:03 +02:00
parent dc0896a1aa
commit dfcbfce3d9
2 changed files with 46 additions and 12 deletions

View File

@@ -40,11 +40,16 @@ class SettingsProvider():
s = self.settings.get(area)
if s is None:
p = os.path.join(self.BASE_PATH, area)
if not os.path.exists(p):
return
f = open(p, "rb")
info = cPickle.load(f)
if not os.path.exists(p):
info = {}
if defaults:
for item in defaults:
info[item] = defaults[item]
else:
f = open(p, "rb")
info = cPickle.load(f)
self.settings[area] = s = Settings(p, info)
return s