Codebase list sugar-read-activity / 502990f
Fix crash in search with epub files - part of SL #3924 This patch also highligth the results as in Browse. Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org> Gonzalo Odiard 11 years ago
3 changed file(s) with 10 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
127127 return
128128
129129 def find_set_highlight_search(self, set_highlight_search):
130 #TODO : what is this?
131 return
130 self._view.set_highlight_text_matches(set_highlight_search)
132131
133132 def set_current_page(self, n):
134133 # When the book is being loaded, calling this does not help
337337 Highlights the next matching item for current search
338338 '''
339339 self._view.grab_focus()
340 self._view.grab_default()
341340
342341 if self._view.search_text(self._findjob.get_search_text(),
343342 self._findjob.get_case_sensitive(),
355354 Highlights the previous matching item for current search
356355 '''
357356 self._view.grab_focus()
358 self._view.grab_default()
359357
360358 if self._view.search_text(self._findjob.get_search_text(),
361359 self._findjob.get_case_sensitive(),
370368
371369 def _find_changed(self, job):
372370 self._view.grab_focus()
373 self._view.grab_default()
374371 self._findjob = job
372 self._mark_found_text()
375373 self.find_next()
374
375 def _mark_found_text(self):
376 self._view.unmark_text_matches()
377 self._view.mark_text_matches(self._findjob.get_search_text(),
378 case_sensitive=self._findjob.get_case_sensitive(), limit=0)
379 self._view.set_highlight_text_matches(True)
376380
377381 def __set_zoom(self, value):
378382 self._view.set_zoom_level(value)
444448 self._view.add_bottom_padding(extra)
445449
446450 if self.__in_search:
451 self._mark_found_text()
447452 self._view.search_text(self._findjob.get_search_text(), \
448453 self._findjob.get_case_sensitive(), \
449454 self.__search_fwd, False)
1717
1818 from gi.repository import GObject
1919 from gi.repository import Gtk
20 from gi.repository import Gdk
2120 import widgets
2221 import cairo
23
2422 import math
2523 import os.path
2624 import BeautifulSoup
6058 self.obj._matchfilelist.append(entry)
6159 f.close()
6260
63 Gdk.threads_enter()
6461 self.obj._finished = True
65 self.obj.emit('updated')
66 Gdk.threads_leave()
62 GObject.idle_add(self.obj.emit, 'updated')
6763
6864 return False
6965
254250 def __init__(self, document, start_page, n_pages, text,
255251 case_sensitive=False):
256252 GObject.GObject.__init__(self)
257 Gdk.threads_init()
258253
259254 self._finished = False
260255 self._document = document