diff options
author | Walter Bender <walter.bender@gmail.com> | 2012-04-27 18:34:48 (GMT) |
---|---|---|
committer | Walter Bender <walter.bender@gmail.com> | 2012-04-27 18:34:48 (GMT) |
commit | e86b4287dc996e261cc740f05ec19b0b3f0076f5 (patch) | |
tree | 85a9987209e1991ce562715121b7914ad8eff935 | |
parent | 350dc1ae0a4266207f99386894f17390da0017c0 (diff) |
add slight delay so alert has time to load
-rw-r--r-- | AbacusActivity.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/AbacusActivity.py b/AbacusActivity.py index a57d6ea..8f5d0ae 100644 --- a/AbacusActivity.py +++ b/AbacusActivity.py @@ -14,6 +14,7 @@ import pygtk pygtk.require('2.0') import gtk +import gobject from sugar.activity import activity from sugar import profile @@ -326,8 +327,7 @@ class AbacusActivity(activity.Activity): self.abacus.mode.label(self.abacus.generate_label()) def _notify_new_abacus(self, prompt): - ''' Called from New Game button since loading a new game can - be slooow!! ''' + ''' Loading a new abacus can be slooow, so alert the user. ''' alert = NotifyAlert(3) alert.props.title = prompt alert.props.msg = _('A new abacus is loading.') @@ -349,7 +349,10 @@ class AbacusActivity(activity.Activity): return self._notify_new_abacus(NAMES[abacus]) + # Give the alert time to load + gobject.timeout_add(100, self._switch_modes, abacus) + def _switch_modes(self, abacus): # Save current value value = int(float(self.abacus.mode.value())) if abacus == 'custom': |