Skip to content

Commit

Permalink
Add link to library homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
ping committed Sep 20, 2023
1 parent d9e8e3d commit 4098ce1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions calibre-plugin/dialog/cards.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,15 @@ def format_card_name(self, card_name):
def library_lbl_context_menu_requested(self):
menu = QMenu(self)
menu.addSection(_("Library"))
library_homepage_url = (
self.library.get("links", {}).get("libraryHome", {}).get("href")
)
if library_homepage_url:
library_home_action = menu.addAction(_("Library Homepage"))
library_home_action.setIcon(self.resources[PluginImages.ExternalLink])
library_home_action.triggered.connect(
lambda: open_url(library_homepage_url)
)
view_in_libby_action = menu.addAction(_("View in Libby"))
view_in_libby_action.setIcon(self.resources[PluginImages.ExternalLink])
view_in_libby_action.triggered.connect(self.open_libby_library)
Expand Down

0 comments on commit 4098ce1

Please sign in to comment.