mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
When deleting books from the bottom of the booklist, ensure that the bottom book after deleting is selected
This commit is contained in:
commit
7882df7fa3
@ -265,8 +265,10 @@ class DeleteAction(InterfaceAction):
|
|||||||
v.model().clear_ondevice(ids_deleted)
|
v.model().clear_ondevice(ids_deleted)
|
||||||
if current_row is not None:
|
if current_row is not None:
|
||||||
ci = view.model().index(current_row, 0)
|
ci = view.model().index(current_row, 0)
|
||||||
if ci.isValid():
|
if not ci.isValid():
|
||||||
view.set_current_row(current_row)
|
# Current row is after the last row, set it to the last row
|
||||||
|
current_row = view.row_count() - 1
|
||||||
|
view.set_current_row(current_row)
|
||||||
|
|
||||||
def delete_books(self, *args):
|
def delete_books(self, *args):
|
||||||
'''
|
'''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user