Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/epubadapter.py
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2012-08-17 13:03:11 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2012-08-17 13:03:11 (GMT)
commita11b7a85ffc55ea7401897fa33a2a671ede893c6 (patch)
treeb1078927f4a7a7cb9ac8044268962e9a9c6482c7 /epubadapter.py
parentc1a414f10d07c5014c09b7f42f38ce1233d63164 (diff)
Save and restore zoom level in epub and text backends
Siogned-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'epubadapter.py')
-rw-r--r--epubadapter.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/epubadapter.py b/epubadapter.py
index cb6bfc2..13d4185 100644
--- a/epubadapter.py
+++ b/epubadapter.py
@@ -40,9 +40,17 @@ class EpubViewer(epubview.EpubView):
title = self._epub._info._get_title()
if title:
self.metadata['title'] = title
+ if 'Read_zoom' in self.metadata:
+ try:
+ logging.error('Loading zoom %s', self.metadata['Read_zoom'])
+ self.set_zoom(float(self.metadata['Read_zoom']))
+ except:
+ pass
def update_metadata(self, activity):
- pass
+ self.metadata = activity.metadata
+ logging.error('Saving zoom %s', self.get_zoom())
+ self.metadata['Read_zoom'] = self.get_zoom()
def zoom_to_width(self):
pass