Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 04-30-2012, 12:41 PM   #211
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,635
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
@Jim - you have a PM concerning this just now - and yes I did specifically list your API methods above as being on the list, geez even mentioned you by name...
kiwidude is offline   Reply With Quote
Old 04-30-2012, 12:57 PM   #212
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,305
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
Sorry--I (obviously) didn't read the list, just the first and last paragraphs.
JimmXinu is offline   Reply With Quote
Advert
Old 05-01-2012, 08:11 AM   #213
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,635
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Beta testers needed for 1.4.1

Ok folks, this is likely to be the next version of this plugin attached to this post. As it has some big new features I would appreciate it if a few of you could give them a whirl and offer some feedback so I can officially release it.

To briefly summarise them (see the screenshots too):
  • Ability to export and import settings including the related image (to allow users to easily share their favourite cover settings on this thread)
  • Ability to change alignment of each text item rather than always centered.
  • Right margin now as a separate option (rather than defaulting to same as left margin so allows indenting)
  • Allow font sizes larger than 99pt
  • API support for JimmXinu (or others) to invoke

Any issues (or if it all works fine for you) - please let me know asap either on this thread or via PM.
Attached Thumbnails
Click image for larger version

Name:	ImportExport.png
Views:	329
Size:	190.6 KB
ID:	85916   Click image for larger version

Name:	RightAligned.png
Views:	302
Size:	202.8 KB
ID:	85917   Click image for larger version

Name:	RightMargin.png
Views:	328
Size:	150.2 KB
ID:	85918  

Last edited by kiwidude; 05-01-2012 at 04:57 PM. Reason: Remove attachment while work on next version
kiwidude is offline   Reply With Quote
Old 05-01-2012, 11:22 AM   #214
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,305
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
@kiwidude - It gave me an error on start up:

Code:
Starting up...
Generate Cover - Upgrading from schema: 1.35
Generate Cover - Upgrading to 1.41 from schema: 1.35
Traceback (most recent call last):
  File "site-packages\calibre\gui2\ui.py", line 125, in __init__
  File "site-packages\calibre\gui2\ui.py", line 139, in init_iaction
  File "site-packages\calibre\customize\__init__.py", line 543, in load_actual_plugin
  File "importlib\__init__.py", line 37, in import_module
  File "site-packages\calibre\customize\zipplugin.py", line 150, in load_module
  File "calibre_plugins.generate_cover.action", line 16, in <module>
  File "site-packages\calibre\customize\zipplugin.py", line 150, in load_module
  File "calibre_plugins.generate_cover.config", line 126, in <module>
  File "calibre_plugins.generate_cover.config", line 92, in migrate_config_if_required
  File "calibre_plugins.generate_cover.config", line 118, in migrate_config_setting
NameError: global name 'current' is not defined
Addendum: Starting calibre again doesn't throw that error.

I've attached a copy of my pre-conversion Generate Cover.json file.
Attached Files
File Type: txt Generate Cover.json.txt (4.5 KB, 220 views)

Last edited by JimmXinu; 05-01-2012 at 11:45 AM. Reason: Add json file.
JimmXinu is offline   Reply With Quote
Old 05-01-2012, 11:50 AM   #215
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,635
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Hey Jim - darned copy/paste error when refactoring, and because my config file was already "upgraded" I didn't catch it.

New attachment above. If those who downloaded don't have a backup of your "pre-upgrade" file (like I see you do), then manually edit your Generate Cover.json file and change this:
"SchemaVersion": 1.41,
to
"SchemaVersion": 1.40,

This will force the plugin to correctly upgrade the file to prevent any future errors once you restart calibre.
kiwidude is offline   Reply With Quote
Advert
Old 05-01-2012, 11:57 AM   #216
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,305
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
Looks like that worked, assuming it's normal for it say it's upgrading several times.
Code:
Starting up...
Generate Cover - Upgrading from schema: 1.35
Generate Cover - Upgrading to 1.41 from schema: 1.35
Generate Cover - Upgrading to 1.41 from schema: 1.35
Generate Cover - Upgrading to 1.41 from schema: 1.35
JimmXinu is offline   Reply With Quote
Old 05-01-2012, 12:00 PM   #217
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,635
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Yeah that is normal, it is iterating through each of your saved settings. I contemplated putting the name in the output but got lazy, but since you mentioned it I'll stick it in the final release.

Edit: The new version with improved logging is attached above. If you have already "upgraded" your config file you will have to use an old json backup or the schema version fudge in my post above to see the new logging (since upgrading the json config file is a one off event).

Last edited by kiwidude; 05-01-2012 at 12:12 PM.
kiwidude is offline   Reply With Quote
Old 05-01-2012, 12:13 PM   #218
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,305
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
kiwidude - I'm able to make changes to a saved setting and use it (click OK) without saving it. Next time I open GC, that saved setting is still selected, still changed and still unsaved. Is that the intended behavior?

It confused me while testing calling from outside because the changes I last made weren't saved after I hit OK.

Maybe GC could offer to save changes when you hit OK? Not critical, but I can also see where a user would be changing settings, trying them out, then quit calibre without realizing they need to go back in and saved them explicitly.
JimmXinu is offline   Reply With Quote
Old 05-01-2012, 12:56 PM   #219
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,635
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Thats an old behaviour (not new to this release). I've always been in two minds about it.

The thing is, when the user clicks OK they are saying they want to go ahead and generate with the current setting. That is not "necessarily" the same thing as saying they want that setting saved - after all they may be experimenting just to see what it looks like when made larger etc. So either:
- I don't have a prompt and it *is* treated as a Save at the same time, or
- I do have a prompt and the user has to make another decision click right then.

Right now it supports a user experimenting without committing to save, and continuing to experiment without having to start again. But perhaps I am just being too flexible. Users could just click on the Add button and have an "Experimental" setting that they use for playing with.
kiwidude is offline   Reply With Quote
Old 05-01-2012, 02:34 PM   #220
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,305
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
IMO, I'd like a 'would you like to save settings' popup on OK.

And possibly with an 'Always Save Settings on OK' preference check box added next to Revert and Save? Or a tristate - Save Settings on OK - Yes/No/Ask?
JimmXinu is offline   Reply With Quote
Old 05-01-2012, 03:55 PM   #221
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,305
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
Found a couple more problems:

Adding a new named setting fails:
Spoiler:
Code:
calibre, version 0.8.49
ERROR: Unhandled exception: <b>NameError</b>:global name 'settings' is not defined

Traceback (most recent call last):
  File "calibre_plugins.generate_cover.dialogs", line 379, in add_setting
NameError: global name 'settings' is not defined


GC doesn't handle a configured font being removed well:
Spoiler:
Code:
calibre, version 0.8.49
ERROR: Unhandled exception: <b>IndexError</b>:list index out of range

Traceback (most recent call last):
  File "calibre_plugins.generate_cover.action", line 53, in _generate_cover
  File "calibre_plugins.generate_cover.dialogs", line 1125, in __init__
  File "calibre_plugins.generate_cover.dialogs", line 1315, in display_preview
  File "calibre_plugins.generate_cover.draw", line 232, in generate_cover_for_book
  File "calibre_plugins.generate_cover.draw", line 44, in get_textline
  File "calibre_plugins.generate_cover.draw", line 38, in get_font_or_default
IndexError: list index out of range

Unsurprisingly, importing a setting with a font that isn't installed does the same thing when you try to use it. Maybe check fonts on import, and report missing ones while changing to default?

While not necessarily a problem, I'd expect it to ask if I wanted to save unsaved changes before exporting a setting.

Jim
JimmXinu is offline   Reply With Quote
Old 05-01-2012, 04:05 PM   #222
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,635
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Thanks Jim, all good feedback, appreciate your testing work.
kiwidude is offline   Reply With Quote
Old 05-01-2012, 05:18 PM   #223
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,635
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Ok, how about this for the saving prompt dilemma to us this solution: Adding an "Autosave settings" checkbox on that first screen (I can't put it in the bottom buttons area due to a Qt limitation).

The idea is that if you have it enabled, settings are always saved when you switch between settings, click ok or use import/export - i.e. user never gets prompted.

If you don't have it enabled, then the user will get prompted at those points if they have unsaved settings.
Attached Thumbnails
Click image for larger version

Name:	Autosave.png
Views:	330
Size:	286.2 KB
ID:	85944  
kiwidude is offline   Reply With Quote
Old 05-01-2012, 05:47 PM   #224
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
JimmXinu's Avatar
 
Posts: 6,305
Karma: 3966249
Join Date: Dec 2011
Location: Midwest USA
Device: Kindle Paperwhite(10th)
Sounds perfect.
JimmXinu is offline   Reply With Quote
Old 05-02-2012, 07:13 AM   #225
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,635
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Another beta version

Ok, here is a (hopefully) improved version for testing. Thanks to Jim for spotting some issues both old and new.

As mentioned above there is a new Autosave settings checkbox to automatically save any changes you make to a setting at various points you would otherwise get prompted:

- When you switch to another setting. Behaviour as it is currently of being prompted to save or discard their changes.
- When you Import or Export. New for this release is to prompt to save/discard as above.
- When you click OK to generate a cover. New to this release is a prompt allowing the user to Save setting (generates with new values), Discard changes (generates with reverted values) or Don't save yet (like current behaviour, generates with new values but does not overwrite setting so you can Revert later).
- When you click Cancel. New for this release is to always discard any unsaved settings - regardless of whether autosave is checked or not.

I've also fixed a couple of other longer term bugs - like when a font is missing as Jim found above. It will now revert to the default font without an error displayed (applies to your own or imported settings). The debug window will display the name of the font that could not be found.

Version number bumped up to 1.5, hopefully no other gremlins in there but if some kind folks could give this a quick sanity check it would be appreciated.

Last edited by kiwidude; 05-02-2012 at 03:25 PM. Reason: Removed attachment as latest version officially released
kiwidude is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] Goodreads Sync kiwidude Plugins 1719 04-10-2024 08:25 AM
[GUI Plugin] Clipboard Search kiwidude Plugins 29 04-02-2024 10:05 PM
[GUI Plugin] Open With kiwidude Plugins 403 04-01-2024 08:39 AM
[GUI Plugin] User Category kiwidude Plugins 123 03-16-2024 11:59 PM
[GUI Plugin] Quick Preferences kiwidude Plugins 62 03-16-2024 11:47 PM


All times are GMT -4. The time now is 05:45 AM.


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