Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 02-06-2021, 07:26 PM   #1
Bradles
Connoisseur
Bradles has become one with the cosmosBradles has become one with the cosmosBradles has become one with the cosmosBradles has become one with the cosmosBradles has become one with the cosmosBradles has become one with the cosmosBradles has become one with the cosmosBradles has become one with the cosmosBradles has become one with the cosmosBradles has become one with the cosmosBradles has become one with the cosmos
 
Bradles's Avatar
 
Posts: 70
Karma: 21074
Join Date: Nov 2020
Location: Perth, Western Australia
Device: Apple Books & Kobo Libra H20
Accessing the Book Details popup

Hi all,

Is it possible to access the Book Details popup (i.e. the one that responds to the "i" key) programmatically?

I have a QTableWidget in my plug-in that has a list of calibre e-books. I'd like to respond to double-click to display the book details.

Failing that, is it possible to convert metadata to html? I tried this:

mi = self.gui.current_db.new_api.get_metadata(id)
html = render_html(mi, True, None) #DOESN'T WORK

but got an error:

AttributeError: Metadata object has no attribute named: 'path'

Spoiler:

Traceback (most recent call last):
File "calibre_plugins.librarything_match.main", line 531, in show_details_popup
File "C:\Source\Calibre\src\calibre\gui2\book_details.p y", line 172, in render_html
File "C:\Source\Calibre\src\calibre\gui2\book_details.p y", line 230, in render_data
File "C:\Source\Calibre\src\calibre\ebooks\metadata\boo k\render.py", line 192, in mi_to_html
File "C:\Source\Calibre\src\calibre\ebooks\metadata\boo k\base.py", line 163, in __getattribute__
Bradles is offline   Reply With Quote
Old 02-06-2021, 10:55 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,860
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
self.gui.iactions['Show Book Details'].show_book_info()

but this will show the book details for the *current* book in the main calibre book list. So you would need to make your book the current book first.
kovidgoyal is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
<details><summary>title</summary>popup</details> rjwse@aol.com Editor 4 03-28-2018 10:00 PM
Calibre:Book Cover size in Book Details side pane & Edit Metadata Individually window Volfer Calibre 3 01-05-2016 01:56 PM
Accessing the author of a KF8 book lisabeeren Development 8 10-29-2015 10:20 AM
Aura HD Accessing Book Information Gilgamesh Kobo Reader 3 08-09-2013 01:36 AM
iPad Popup Book for iPad kjk Apple Devices 2 07-06-2010 09:01 AM


All times are GMT -4. The time now is 12:57 PM.


MobileRead.com is a privately owned, operated and funded community.