[Viewer Plugin] Get selected text on right click.
The Calibre ebook viewer has some functionality built into it that I would like to implement with a plugin.
The goal is to have something similar to the "Search Google for [selected text]" when you right click. Instead of the action opening an internet browser, I would like to create a modal pop up that contains more information based on the given text.
Ideally I would also like to create a button in the toolbar that would hold the same functionality.
I see the customize_ui(ui) and customize_context_menu(menu, event, hit_test_result) methods in the ViewerPlugin, but I am stuck on how to actually get the selected text from these parameters and connect a click event to these items.
|