View Single Post
Old 02-13-2012, 12:07 AM   #1
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,984
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
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)
Any suggestions?

Thanks,
Jim
JimmXinu is offline   Reply With Quote