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))