mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04: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
@ -794,10 +794,13 @@ class MetadataBulkDialog(ResizableDialog, Ui_MetadataBulkDialog):
|
|||||||
flags |= re.UNICODE
|
flags |= re.UNICODE
|
||||||
|
|
||||||
try:
|
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:
|
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:
|
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:
|
except Exception as e:
|
||||||
self.s_r_obj = None
|
self.s_r_obj = None
|
||||||
self.s_r_error = e
|
self.s_r_error = e
|
||||||
|
Loading…
x
Reference in New Issue
Block a user