Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Nov 28, 2015
1 parent 4d554f8 commit b4c9081
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/calibre/gui2/tweak_book/file_list.py
Expand Up @@ -536,8 +536,14 @@ def change_name(name, num):
name_map = {n:change_name(n, num + i) for i, n in enumerate(names)}
self.bulk_rename_requested.emit(name_map)

@property
def selected_names(self):
ans = {unicode(item.data(0, NAME_ROLE) or '') for item in self.selectedItems()}
ans.discard('')
return ans

def request_delete(self):
names = {unicode(item.data(0, NAME_ROLE) or '') for item in self.selectedItems()}
names = self.selected_names
bad = names & current_container().names_that_must_not_be_removed
if bad:
return error_dialog(self, _('Cannot delete'),
Expand Down

0 comments on commit b4c9081

Please sign in to comment.