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-29 14:12:53 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2012-09-10 14:19:32 (GMT)
commit759188370815f490a6f85343c679e2d3372e9b66 (patch)
tree817365922d64824da808881fc2069ad093f83402 /epubadapter.py
parent9d18b220d83f274328806bcb5a56727c963c5be2 (diff)
Show the table of contents in a panel
The table of contents, actually implemented in epub backend, is displayed in a later panel, instead of in a combo, to do easier the interaction with touch, and provide context. The code is now more general to allow the implementation in the pdf backend too. The button used to display the table of contents, was moved from the main toolbar to the view subtoolbar. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'epubadapter.py')
-rw-r--r--epubadapter.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/epubadapter.py b/epubadapter.py
index 13d4185..5ad6e55 100644
--- a/epubadapter.py
+++ b/epubadapter.py
@@ -144,14 +144,15 @@ class EpubViewer(epubview.EpubView):
def get_current_page(self):
return int(self._loaded_page) - 1
+ def get_current_link(self):
+ # the _loaded_filename include all the path,
+ # need only the part included in the link
+ return self._loaded_filename[len(self._epub._tempdir) + 1:]
+
def update_toc(self, activity):
if self._epub.has_document_links():
- activity._navigator_toolbar_button.show()
- activity._navigator.show_all()
-
- activity._toc_model = self._epub.get_links_model()
- activity._navigator.set_model(activity._toc_model)
- activity._navigator.set_active(0)
+ activity.show_navigator_button()
+ activity.set_navigator_model(self._epub.get_links_model())
return True
else:
return False