From fa603d130c3cac184871262ef26b55cc40333752 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 26 Jul 2009 11:29:28 -0600 Subject: [PATCH] Fix #2930 (No book is selected after deleting a book) --- src/calibre/gui2/main.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/calibre/gui2/main.py b/src/calibre/gui2/main.py index 5874e57599..3da3a33c69 100644 --- a/src/calibre/gui2/main.py +++ b/src/calibre/gui2/main.py @@ -889,7 +889,17 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI): 'removed from your computer. Are you sure?') +'

', 'library_delete_books', self): return + ci = view.currentIndex() + row = None + if ci.isValid(): + row = ci.row() view.model().delete_books(rows) + if row is not None: + ci = view.model().index(row, 0) + if ci.isValid(): + view.setCurrentIndex(ci) + sm = view.selectionModel() + sm.select(ci, sm.Select) else: if self.stack.currentIndex() == 1: view = self.memory_view