02-13-2012, 12:07 AM | #1 |
Plugin Developer
Posts: 6,262
Karma: 3675895
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
Pop Edit Metadata for New Book Created in Plugin?
I could use some advice.
I'm working on a plugin to merge epubs from existing books into a new epub in a new book. At the end, I'd like the plugin to automatically pop the 'Edit Metadata' dialog for the newly created book. Near as I can tell, I have to get the new book selected in the main book list, then invoke edit_metadata on the metadata action. But I've had no luck figuring out how to select a row from the book_id. Code:
book_id = db.create_book_entry(mi,add_duplicates=True) # ... self.gui.library_view.model().books_added(1) self.gui.library_view.selectionModel().clearSelection() self.gui.library_view.selectionModel().select(???) self.gui.iactions['Edit Metadata'].edit_metadata(False) Thanks, Jim |
02-13-2012, 12:49 AM | #2 |
creator of calibre
Posts: 43,739
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Use the select_rows() method. self.library_view.select_rows(ids). See the definition for select_rows() for more info in library/views.py
|
Advert | |
|
02-13-2012, 01:24 AM | #3 |
Plugin Developer
Posts: 6,262
Karma: 3675895
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
|
Perfect. Thanks, Kovid.
Jim |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Plugin for Edit Metadata | kcart1 | Calibre | 1 | 01-18-2012 01:07 PM |
This Possible: Plugin to check downloaded metadata vs book itself | collin8579 | Plugins | 0 | 08-19-2011 04:59 PM |
Delete book from edit Metadata? | crazyken | Library Management | 2 | 08-04-2011 02:41 AM |
[Metadata Download Plugin] Goodreads Metadata **Deprecated** | kiwidude | Plugins | 30 | 04-23-2011 02:10 PM |
Wish to edit ebook created by Calibre in Dreamweaver CS5 | purcelljf | Calibre | 1 | 08-08-2010 11:18 PM |