![]() |
#1 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#5 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#7 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 27,761
Karma: 198099188
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
|
![]() |
![]() |
![]() |
#8 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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! |
![]() |
![]() |
![]() |
#9 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 |
![]() |
![]() |
![]() |
#10 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#11 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |