From f4db41bf82877cfc5ee01aea7f46542e6b9e6c67 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 3 Nov 2023 20:49:44 +0530 Subject: [PATCH] Show note dialog: Fix links not being activated when clicked --- src/calibre/gui2/dialogs/show_category_note.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/calibre/gui2/dialogs/show_category_note.py b/src/calibre/gui2/dialogs/show_category_note.py index 20e4f79860..737312deb6 100644 --- a/src/calibre/gui2/dialogs/show_category_note.py +++ b/src/calibre/gui2/dialogs/show_category_note.py @@ -24,6 +24,10 @@ class Display(HTMLDisplay): super().__init__(parent) self.document().setDefaultStyleSheet(resolved_css() + '\n\nli { margin-top: 0.5ex; margin-bottom: 0.5ex; }') self.setFocusPolicy(Qt.FocusPolicy.NoFocus) + self.anchor_clicked.connect(self.handle_link_click) + + def handle_link_click(self, qurl): + safe_open_url(qurl) def loadResource(self, rtype, qurl): if qurl.scheme() == RESOURCE_URL_SCHEME and int(rtype) == int(QTextDocument.ResourceType.ImageResource):