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-03-07 16:15:47 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2012-03-07 16:15:47 (GMT)
commitaaad25feac3830ffee561078daac93fe71e1d998 (patch)
tree215376be8c021a15745381cd74a1529c7a930acb /epubadapter.py
parent15cc1ddd9a3def8f8245d25fa6595bf8b507d83b (diff)
Add a stop button to the speech toolbar
This is needed to restart reading from the start of the page. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
Diffstat (limited to 'epubadapter.py')
-rw-r--r--epubadapter.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/epubadapter.py b/epubadapter.py
index 2b15ed5..0503311 100644
--- a/epubadapter.py
+++ b/epubadapter.py
@@ -29,6 +29,7 @@ class EpubViewer(epubview.EpubView):
def load_document(self, file_path):
self.set_document(EpubDocument(self, file_path.replace('file://', '')))
speech.highlight_cb = self.highlight_next_word
+ speech.reset_cb = self.reset_text_to_speech
speech.end_text_cb = self.get_more_text
def load_metadata(self, activity):
@@ -81,6 +82,12 @@ class EpubViewer(epubview.EpubView):
speech.stop()
more_text = self.get_marked_words()
speech.play(more_text)
+ else:
+ if speech.reset_buttons_cb is not None:
+ speech.reset_buttons_cb()
+
+ def reset_text_to_speech(self):
+ self.current_word = 0
def highlight_next_word(self, word_count):
pass