mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 08:55:07 +02:00
Handle attempts to set tags to the empty string
This commit is contained in:
parent
91dd1ca76a
commit
477d947899
1 changed files with 5 additions and 0 deletions
|
|
@ -37,6 +37,11 @@ def __init__(self, window, db, tag_to_match):
|
|||
self.connect(self.available_tags, SIGNAL('itemChanged(QListWidgetItem *)'), self.finish_editing)
|
||||
|
||||
def finish_editing(self, item):
|
||||
if not item.text():
|
||||
error_dialog(self, 'Tag is blank',
|
||||
'A tag cannot be set to nothing. Delete it instead.'%(item.text())).exec_()
|
||||
item.setText(self.item_before_editing.text())
|
||||
return
|
||||
if item.text() != self.item_before_editing.text():
|
||||
if item.text() in self.all_tags.keys() or item.text() in self.to_rename.keys():
|
||||
error_dialog(self, 'Tag already used',
|
||||
|
|
|
|||
Loading…
Reference in a new issue