From 28732ccbdbd17e7946a0cfea67bdcc9f9d50893b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 1 Dec 2010 21:55:02 -0700 Subject: [PATCH] Fix #7424 (Formats hyperlinks are inconsistently launched) --- src/calibre/gui2/actions/show_book_details.py | 3 ++- src/calibre/gui2/dialogs/book_info.py | 8 +++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/calibre/gui2/actions/show_book_details.py b/src/calibre/gui2/actions/show_book_details.py index 18b0a694bf..67903a7d58 100644 --- a/src/calibre/gui2/actions/show_book_details.py +++ b/src/calibre/gui2/actions/show_book_details.py @@ -29,5 +29,6 @@ class ShowBookDetailsAction(InterfaceAction): return index = self.gui.library_view.currentIndex() if index.isValid(): - BookInfo(self.gui, self.gui.library_view, index).show() + BookInfo(self.gui, self.gui.library_view, index, + self.gui.iactions['View'].view_format_by_id).show() diff --git a/src/calibre/gui2/dialogs/book_info.py b/src/calibre/gui2/dialogs/book_info.py index 4cbe0ace7f..df21314712 100644 --- a/src/calibre/gui2/dialogs/book_info.py +++ b/src/calibre/gui2/dialogs/book_info.py @@ -15,12 +15,13 @@ from calibre.library.comments import comments_to_html class BookInfo(QDialog, Ui_BookInfo): - def __init__(self, parent, view, row): + def __init__(self, parent, view, row, view_func): QDialog.__init__(self, parent) Ui_BookInfo.__init__(self) self.setupUi(self) self.cover_pixmap = None self.comments.sizeHint = self.comments_size_hint + self.view_func = view_func desktop = QCoreApplication.instance().desktop() screen_height = desktop.availableGeometry().height() - 100 @@ -58,10 +59,7 @@ class BookInfo(QDialog, Ui_BookInfo): if os.sep in path: open_local_file(path) else: - path = self.view.model().db.format_abspath(self.current_row, path) - if path is not None: - open_local_file(path) - + self.view_func(self.view.model().id(self.current_row), path) def next(self): row = self.view.currentIndex().row()