![]() |
#31 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,251
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
![]() |
![]() |
![]() |
![]() |
#32 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,255
Karma: 27110894
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): |
![]() |
![]() |
Advert | |
|
![]() |
#33 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,251
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
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. |
|
![]() |
![]() |
![]() |
#34 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,255
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Feel free to use either, whichever works better for you.
|
![]() |
![]() |
![]() |
#35 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,251
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
|
![]() |
![]() |
Advert | |
|
![]() |
#36 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,251
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
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)
|
|
![]() |
![]() |
![]() |
#37 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,255
Karma: 27110894
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 |
![]() |
![]() |
![]() |
#38 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,251
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
Thanks for the info.
Many thanks to both you and eschwartz for your patience nursing me through this ![]() |
![]() |
![]() |
![]() |
#39 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
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. ![]() |
![]() |
![]() |
![]() |
#40 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
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.
|
![]() |
![]() |
![]() |
#41 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,251
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
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_()
|
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |