From bc81cd90ce4e4f9ba87a9116007ac4397ea6b0ea Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 13 Mar 2025 14:51:54 +0530 Subject: [PATCH] Fix #2101116 [Match book on device: Tabbing doesn't select book](https://bugs.launchpad.net/calibre/+bug/2101116) --- src/calibre/gui2/dialogs/match_books.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/calibre/gui2/dialogs/match_books.py b/src/calibre/gui2/dialogs/match_books.py index da5288101f..b3ef0c189c 100644 --- a/src/calibre/gui2/dialogs/match_books.py +++ b/src/calibre/gui2/dialogs/match_books.py @@ -87,6 +87,7 @@ class MatchBooks(QDialog, Ui_MatchBooks): self.books_table.setHorizontalHeaderItem(2, t) self.books_table_header_height = self.books_table.height() self.books_table.cellDoubleClicked.connect(self.book_doubleclicked) + self.books_table.selectionModel().selectionChanged.connect(self.selection_changed) self.books_table.cellClicked.connect(self.book_clicked) self.books_table.sortByColumn(0, Qt.SortOrder.AscendingOrder) @@ -173,6 +174,12 @@ class MatchBooks(QDialog, Ui_MatchBooks): self.books_table.setColumnWidth(c, w) self.save_state() + def selection_changed(self): + x = self.books_table.selectedIndexes() + if x: + id_ = x[0].data(Qt.ItemDataRole.UserRole) + self.current_library_book_id = id_ + def book_clicked(self, row, column): self.book_selected = True id_ = int(self.books_table.item(row, 0).data(Qt.ItemDataRole.UserRole))