Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2014-02-04 16:25:22 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2014-02-04 16:52:08 (GMT)
commit807a665908ac2776f046a6ebe3a38037a5a92c0e (patch)
tree212ec25f3dd78e621f183b66e34ea3beefe3f62d
parent723716d20351153e74e2011c83f6a6949ad30787 (diff)
Fix export as image or pdf
If a globe is edited, commit the changes before exporting it, if not the text is not displayed. Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
-rw-r--r--historietaactivity.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/historietaactivity.py b/historietaactivity.py
index 86e221b..1d01c2c 100644
--- a/historietaactivity.py
+++ b/historietaactivity.py
@@ -171,14 +171,16 @@ class HistorietaActivity(activity.Activity):
logging.debug('After edit the title')
def write_file(self, file_path):
+ self._commit_all_changes()
+ persistence = persistencia.Persistence()
+ persistence.write(file_path, self.page)
+
+ def _commit_all_changes(self):
# be sure all the changes are commited
active_globe = self.page.get_globo_activo()
if active_globe is not None:
active_globe.set_selected(False)
- persistence = persistencia.Persistence()
- persistence.write(file_path, self.page)
-
def read_file(self, file_path):
persistence = persistencia.Persistence()
persistence.read(file_path, self.page)
@@ -208,6 +210,7 @@ class HistorietaActivity(activity.Activity):
return image_width, image_height
def write_image(self, button):
+ self._commit_all_changes()
# calculate image size
image_width, image_height = self._get_image_size()
@@ -282,6 +285,7 @@ class HistorietaActivity(activity.Activity):
editorwin.show_all()
def _save_as_pdf(self, widget):
+ self._commit_all_changes()
file_name = os.path.join(self.get_activity_root(), 'instance',
'tmp-%i.pdf' % time.time())