Save state of volume when shutdown and reboot fix for #3652

This commit is contained in:
Simon Schampijer
2007-09-24 18:00:36 +02:00
parent 0a53813064
commit e3f97b042f
5 changed files with 31 additions and 0 deletions
+7
View File
@@ -25,6 +25,7 @@ from sugar import util
from sugar.graphics.xocolor import XoColor
DEFAULT_JABBER_SERVER = 'olpc.collabora.co.uk'
DEFAULT_VOLUME = 81
_profile = None
@@ -93,6 +94,8 @@ class Profile(object):
_set_key(cp, 'Jabber', 'Registered', self.jabber_registered)
_set_key(cp, 'Sound', 'Volume', self.sound_volume)
f = open(self._config_path, 'w')
cp.write(f)
f.close()
@@ -115,6 +118,10 @@ class Profile(object):
self.jabber_registered = True
if cp.has_option('Server', 'Backup1'):
self.backup1 = cp.get('Server', 'Backup1')
if cp.has_option('Sound', 'Volume'):
self.sound_volume = float(cp.get('Sound', 'Volume'))
else:
self.sound_volume = DEFAULT_VOLUME
del cp