Fix viewing books via the Cover browser not working when in device view. Fixes #2092630 [Clicking on book cover images in Device view always throws an exception error](https://bugs.launchpad.net/calibre/+bug/2092630)

This commit is contained in:
Kovid Goyal 2024-12-29 10:00:17 +05:30
parent d2ca137976
commit d26a381a66
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 5 additions and 1 deletions

View File

@ -326,6 +326,10 @@ class ViewAction(InterfaceAction):
def view_specific_book(self, index):
self._view_books([index])
def view_specific_calibre_book(self, index):
ids = [self.gui.library_view.model().id(index)]
self._view_calibre_books(ids)
def view_random(self, *args):
self.gui.iactions['Pick Random Book'].pick_random()
self._view_books([self.gui.library_view.currentIndex()])

View File

@ -375,7 +375,7 @@ class CoverFlowMixin:
self.library_view.selectionModel().currentRowChanged.connect(self.sync_cf_to_listview)
self.db_images = DatabaseImages(self.library_view.model(), self.is_cover_browser_visible)
self.cover_flow.setImages(self.db_images)
self.cover_flow.itemActivated.connect(self.iactions['View'].view_specific_book)
self.cover_flow.itemActivated.connect(self.iactions['View'].view_specific_calibre_book)
self.update_cover_flow_subtitle_font()
button = self.cb_button
if self.separate_cover_browser: