mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-24 16:16:10 +01:00
Bulk metadata edit search and replace: Do not allow the user to perform the search and replace until she enters a search expression. See #1282357 (error produced during "Edit metadata in bulk" for replacing a value)
This commit is contained in:
parent
ab983165a4
commit
48dbfa26c9
1 changed files with 5 additions and 2 deletions
|
|
@ -794,10 +794,13 @@ def s_r_paint_results(self, txt):
|
|||
flags |= re.UNICODE
|
||||
|
||||
try:
|
||||
stext = unicode(self.search_for.text())
|
||||
if not stext:
|
||||
raise Exception(_('You must specify a search expression in the "Search for" field'))
|
||||
if self.search_mode.currentIndex() == 0:
|
||||
self.s_r_obj = re.compile(re.escape(unicode(self.search_for.text())), flags)
|
||||
self.s_r_obj = re.compile(re.escape(stext), flags)
|
||||
else:
|
||||
self.s_r_obj = re.compile(unicode(self.search_for.text()), flags)
|
||||
self.s_r_obj = re.compile(stext, flags)
|
||||
except Exception as e:
|
||||
self.s_r_obj = None
|
||||
self.s_r_error = e
|
||||
|
|
|
|||
Loading…
Reference in a new issue