diff options
author | mike <michael.jmontcalm@gmail.com> | 2009-12-03 21:25:37 (GMT) |
---|---|---|
committer | mike <michael.jmontcalm@gmail.com> | 2009-12-03 21:25:37 (GMT) |
commit | 3b00203f5d09ea9e26270a23513c296dc0f36fa7 (patch) | |
tree | 5139e6ac22fb9d2065349cf82abf989dd8dc9587 | |
parent | abf669cd091b6707877ceca3d6e83efbbb4ef187 (diff) |
Creator : Prevent activity from closing if the creator is authoring
-rw-r--r-- | src/sugar/activity/activity.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/sugar/activity/activity.py b/src/sugar/activity/activity.py index 81c7198..1eaf1d8 100644 --- a/src/sugar/activity/activity.py +++ b/src/sugar/activity/activity.py @@ -797,6 +797,23 @@ class Activity(Window, gtk.Container): if not self.can_close(): return + from sugar.tutorius.creator import get_creator_proxy + creator = get_creator_proxy() + + if creator.get_authoring_state(): + # Pop up a dialog to the user to warn that he cannot exit + # activities while creator is running + dlg = gtk.Dialog(_('Cannot close activity'), + None, + 0, + (gtk.STOCK_OK, gtk.RESPONSE_ACCEPT)) + dlg.vbox.pack_start(gtk.Label(_("Please finish editing your tutorial\nbefore you quit the activity."))) + dlg.show_all() + dlg.run() + + dlg.destroy() + return + if skip_save or self.metadata.get('title_set_by_user', '0') == '1': if not self._closing: if not self._prepare_close(skip_save): |