diff options
author | Ignacio Rodriguez <ignacio@sugarlabs.org> | 2013-12-12 22:35:35 (GMT) |
---|---|---|
committer | Ignacio Rodriguez <ignacio@sugarlabs.org> | 2013-12-12 22:35:35 (GMT) |
commit | 3ee39682ad9bc3daf6c67b95b9c8acb42b995d4d (patch) | |
tree | 926028836ba80933e4b1ad56656998fade0b3428 | |
parent | 1409de5b4a807827ff8581ed83c27d6cf2d8878a (diff) |
Show alert after export as Pippy Document
-rw-r--r-- | pippy_app.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pippy_app.py b/pippy_app.py index f534bde..ce8fa46 100644 --- a/pippy_app.py +++ b/pippy_app.py @@ -42,6 +42,7 @@ from sugar3.activity.widgets import EditToolbar from sugar3.activity.widgets import StopButton from sugar3.activity.activity import get_bundle_path from sugar3.activity.activity import get_bundle_name +from sugar3.graphics.alert import NotifyAlert from sugar3.graphics import style from sugar3.graphics.toggletoolbutton import ToggleToolButton @@ -465,6 +466,11 @@ Discard changes?') def _export_document_cb(self, __): self.copy() + alert = NotifyAlert() + alert.props.title = _('Saved') + alert.props.msg = _('The document has been saved to journal.') + alert.connect('response', lambda x, i: self.remove_alert(x)) + self.add_alert(alert) def _create_bundle_cb(self, __): from shutil import copytree, copy2, rmtree @@ -636,8 +642,6 @@ Do you want to overwrite it?') try: text = open(file_path).read() except: - from sugar3.graphics.alert import NotifyAlert - alert = NotifyAlert(10) alert.props.title = _('Error') alert.props.msg = _('Error reading data.') |