09-13-2019, 09:26 PM | #31 |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
I hope you haven't wasted any time on this yet. I think I may know what's wrong.
|
09-13-2019, 09:42 PM | #32 |
creator of calibre
Posts: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
In The plugin you have a separate ui.py. All is needs to do is run
Code:
self.gui.job_manager.launch_gui_app('webengine-dialog', {'module': 'calibre_plugins_your_plugin_import_name.main', 'path': path_to_book}) Code:
def main(path_to_book): |
09-13-2019, 09:43 PM | #33 | |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Quote:
Are you suggesting I do this rather than eschwartz's cli_main() method? Whatever the answer I will be experimenting with your new demo in case I need a QWebEngineView widget in a future UI plugin. ETA: Oops! Cross-posted. |
|
09-13-2019, 09:46 PM | #34 |
creator of calibre
Posts: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Feel free to use either, whichever works better for you.
|
09-13-2019, 10:02 PM | #35 |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
|
09-14-2019, 01:42 PM | #36 | |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Quote:
I'd like to clarify something about the latter. In the show_dialog called by genesis() I have Code:
self.gui.job_manager.launch_gui_app('webengine-dialog',
kwargs={
'module':'calibre_plugins.scrambleebook_plugin.main',
'path_to_ebook':path_to_ebook,
'book_id':book_id,
'from_calibre':True
}
)
Code:
def main(path_to_ebook, book_id, from_calibre)
|
|
09-14-2019, 06:42 PM | #37 |
creator of calibre
Posts: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
webengine-dialog is constant, you can override main, like this:
Code:
self.gui.job_manager.launch_gui_app('webengine-dialog', kwargs={ 'module':'calibre_plugins.scrambleebook_plugin.main', 'func': 'some_name', 'path_to_ebook':path_to_ebook, 'book_id':book_id, 'from_calibre':True } ) then replace main with some_name |
09-14-2019, 07:00 PM | #38 |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Thanks for the info.
Many thanks to both you and eschwartz for your patience nursing me through this |
09-14-2019, 11:12 PM | #39 |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Great, cool!
My rationale for tilting you at the run-plugin method is because you know, when all you have is a hammer, everything looks like a nail. But I like CLI interfaces, and it surely cannot hurt to have one (and it might come in handy for some people). So why not add both methods, indeed... |
09-14-2019, 11:18 PM | #40 |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
BTW I noticed when testing the standalone version of ScrambleEbook, that the gui window for the preview was appearing behind the main ScrambleEbook dialog. This occurred regardless of whether I ran calibre-debug scrambleebook.py, or whether I used my modified plugin with the cli_main method. I believe you need to raise() it.
|
09-15-2019, 08:40 AM | #41 | |
Grand Sorcerer
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Quote:
Don't laugh but in my several years of dabbling with this GUI stuff I've never once coded a .raise_(). I noticed it was there in both your cli main.py and Kovid's run-as-extra-process main.py, so obviously I kept them in. However, both main.py's are for calling the main parent dialog and I think you're talking about the child dialogs activated by a pushbutton. At the moment all of these are currently coded as 2-liners, e.g. Code:
dlg = EbookScramblePreviewDlg(args) dlg.exec_() Code:
dlg = EbookScramblePreviewDlg(args)
dlg.exec_()
dlg.raise_()
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
calibre-sync: Automatically download books from your Calibre Content Server onto Kobo | mishagale | Related Tools | 14 | 05-13-2019 05:18 PM |
Calibre plus Moon + Reader Pro - How to Make Calibre Library Sync to My Shelf? | bookiebabe | Related Tools | 5 | 02-09-2017 02:47 AM |
Calibre Sync on Android stopped working properly with recent version of Calibre? | khahoon | Calibre | 5 | 07-06-2013 08:14 AM |
How do I import Calibre settings from regular Win Calibre to Calibre Portable? | ABW | Calibre | 9 | 05-20-2013 02:34 PM |
Can not start recoll from calibre /opt/calibre/lib/libz.so.1: no version information | Satas | Development | 5 | 04-19-2013 11:22 PM |