Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 04-19-2015, 12:21 PM   #1
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,761
Karma: 198099188
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
SizePersistedDialog behavior in Editor plugins

Curious as to what the expected behavior with regard to the SizePersistedDialog in editor plugins/tools is.

What I'm noticing right now (at least on Windows) is that the only way to get a dialog's size to persist is by launching the editor as a standalone program, making the size changes, and closing the editor.

When launching the editor from within calibre and running a plugin, the persisted size of a dialog will be the last size saved when it was resized by the standalone instance of the editor. Any subsequent changes to the size of a SizePersistedDialog when the editor is launched from within calibre will persist across editor sessions for that current calibre instance only. Meaning that as soon as calibre is closed and restarted, the size of a SizePersistedDialog will revert back to the last size saved by the standalone editor.

Is this expected? Is there some way to get size changes made from within the calibre-launched editor to persist across calibre instances?

Is the parent parameter being passed to the SizePersistedDialog method (for which I use self.gui) not the same for standalone- vs calibre-launched editor sessions?

Last edited by DiapDealer; 04-19-2015 at 12:26 PM.
DiapDealer is offline   Reply With Quote
Old 04-19-2015, 12:36 PM   #2
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,313
Karma: 12117033
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Thank you, now I know how to resize my TOC window into editor. It was making me crazy.
Terisa de morgan is offline   Reply With Quote
Advert
Old 04-19-2015, 01:22 PM   #3
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,313
Karma: 12117033
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
No way, the resize doesn't keep in the TOC window.
Terisa de morgan is offline   Reply With Quote
Old 04-19-2015, 01:28 PM   #4
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,761
Karma: 198099188
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Yeah, I'm not sure about the Editor widgets themselves. I'm talking about a dialog (based on calibres's SizePersistedDialog class) created/launched by an editor plugin.

Are you referring to the various editor widgets?

Last edited by DiapDealer; 04-19-2015 at 01:32 PM.
DiapDealer is offline   Reply With Quote
Old 04-19-2015, 01:29 PM   #5
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,313
Karma: 12117033
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
I think so, I don't really know the code difference.
Terisa de morgan is offline   Reply With Quote
Advert
Old 04-19-2015, 10:30 PM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,219
Karma: 23446406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Why are you using SizePersistedDialog? For dialogs in the editor use calibre.gui2.tweak_books.widgets.Dialog

That remember its size automatically and has various other conveniences as well.

SizePersistedDialog is something local to the plugin updater code and likely uses a config file that the main calibre program owns, which is why you will see that behavior.
kovidgoyal is online now   Reply With Quote
Old 04-20-2015, 05:10 AM   #7
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,761
Karma: 198099188
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by kovidgoyal View Post
Why are you using SizePersistedDialog? For dialogs in the editor use calibre.gui2.tweak_books.widgets.Dialog
Because the plugins I copied when learning how to make plugins used SizePersistedDialogs, of course!

Thanks for the tip.
DiapDealer is offline   Reply With Quote
Old 04-20-2015, 09:06 AM   #8
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,761
Karma: 198099188
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I had it messed up to begin with. SizePersistedDialog wasn't even part of calibre anyway. It was a utility that subclassed QDialog (to hook into calibre's gprefs) that I copied and included with so many plugins that I forgot it wasn't calibre.

calibre.gui2.tweak_book.widgets.Dialog is much cleaner and involves less code. Thanks again!
DiapDealer is offline   Reply With Quote
Old 04-20-2015, 09:10 AM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,219
Karma: 23446406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Note that if you are writing a plugin for main calibre use

calibre.gui2.widgets2.Dialog

while in a plugin for the editor, use

calibre.gui2.tweak_book.widgets.Dialog
kovidgoyal is online now   Reply With Quote
Old 04-20-2015, 09:42 AM   #10
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,761
Karma: 198099188
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Noted. Would have been my next question.

Looks like the tweak_book version is a bit of a dance to get tweak's tprefs passed to calibre's prefs?

For the record, the SizePersistedDialog class I was using was basically the same thing as calibre.gui2.widgets2.Dialog.
DiapDealer is offline   Reply With Quote
Old 04-20-2015, 09:44 AM   #11
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,219
Karma: 23446406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Yes, you dont want to use the main calibre prefs in editor code, since then any changes you make to the prefs get clobbered by the main calibre GUI.
kovidgoyal is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
frame indent behavior and wrap spacing behavior rjwse@aol.com Conversion 0 03-10-2015 12:03 PM
plugin_path for editor plugins. DiapDealer Development 3 08-04-2014 06:02 AM
Editor: ToC Editor: Start entry macnab69 Editor 2 06-25-2014 11:15 AM
Book Editor TOC Editor Isue? weberr Editor 2 04-17-2014 11:13 AM
Plugins junkml Plugins 32 06-19-2009 06:43 AM


All times are GMT -4. The time now is 12:57 AM.


MobileRead.com is a privately owned, operated and funded community.