Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/readactivity.py
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2012-09-27 20:07:27 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2012-09-28 12:54:12 (GMT)
commit57cbfee21ddb84654cfe67979b746e6ad99a7da8 (patch)
tree88af4ecef9ca3758e8099daf629862bc368170c9 /readactivity.py
parentdf40048d6ab95f6806ae24e7bb436373b99ee0d5 (diff)
Implement display o TOC in pdf files
This change needs evince 3.5.92 to work. The code checks evince version, before enable the functionality. This version works with index with one level only. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'readactivity.py')
-rw-r--r--readactivity.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/readactivity.py b/readactivity.py
index 9728cc4..9efdbeb 100644
--- a/readactivity.py
+++ b/readactivity.py
@@ -426,7 +426,9 @@ class ReadActivity(activity.Activity):
self._navigator.set_model(model)
def __toogle_navigator_cb(self, button, visible):
- scrollbar_pos = self._view.get_vertical_pos()
+ scrollbar_pos = -1
+ if hasattr(self._view, 'get_vertical_pos'):
+ scrollbar_pos = self._view.get_vertical_pos()
if visible:
self._toc_visible = True
self._update_toc_view = True
@@ -439,7 +441,8 @@ class ReadActivity(activity.Activity):
self._toc_visible = False
self._toc_scroller.hide()
self._toc_separator.hide()
- self._view.set_vertical_pos(scrollbar_pos)
+ if scrollbar_pos > -1:
+ self._view.set_vertical_pos(scrollbar_pos)
def __num_page_entry_insert_text_cb(self, entry, text, length, position):
if not re.match('[0-9]', text):