05-17-2022, 07:32 AM | #196 |
Calibre Plugins Developer
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
Ha, I do lurk now and again and also thankful to the maintainers who have persisted with keeping my plugins alive particularly through these Python/Qt upgrades. I still use many of them myself each week so grateful for everyone here keeping the dream alive...
|
05-17-2022, 10:17 AM | #197 | |
Grand Sorcerer
Posts: 24,907
Karma: 47303748
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
|
|
07-26-2022, 04:20 AM | #198 |
Member
Posts: 13
Karma: 10
Join Date: Aug 2019
Location: Germany, Jena
Device: Kindle & Android Tablet
|
Plugin no longer working
Hi Kovid,
my Plugin Toc View Generator is no longer working. The code generated by PyQt designer generates the following error message (displayed in error dialog): Code:
calibre, version 6.1.0 FEHLER: Unbehandelter Ausnahmefehler: <b>AttributeError</b>:type object 'QLocale' has no attribute 'English' calibre 6.1 embedded-python: True Windows-10-10.0.22000-SP0 Windows ('64bit', 'WindowsPE') ('Windows', '10', '10.0.22000') Python 3.10.1 Windows: ('10', '10.0.22000', 'SP0', 'Multiprocessor Free') Interface language: de Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 49, 0) && DeDRM (10, 0, 3) && Package KFX (from KFX Input) (1, 49, 0) && Count Pages (1, 11, 2) && KFX metadata reader (from KFX Input) (1, 49, 0) && KFX Input (1, 49, 0) && TOC View Generator (2, 1, 3) Traceback (most recent call last): File "calibre\gui2\preferences\plugins.py", line 301, in customize_plugin File "calibre\gui2\preferences\plugins.py", line 379, in modify_plugin File "calibre\customize\__init__.py", line 166, in do_user_config File "calibre_plugins.toc_view_generator.__init__", line 128, in config_widget File "calibre_plugins.toc_view_generator.gui.Config", line 44, in __init__ File "calibre_plugins.toc_view_generator.gui.TempConfig", line 38, in __init__ File "calibre_plugins.toc_view_generator.gui.Config_ui", line 16, in setupUi AttributeError: type object 'QLocale' has no attribute 'English' Can You help? Mick2nd |
07-26-2022, 04:22 AM | #199 |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Use the pyqt6 designer and you will be fine. Or manually replace QLocale.English with QLocale.Language.English
|
07-26-2022, 04:39 AM | #200 |
Member
Posts: 13
Karma: 10
Join Date: Aug 2019
Location: Germany, Jena
Device: Kindle & Android Tablet
|
|
09-14-2023, 08:10 AM | #201 | |
Groupie
Posts: 161
Karma: 1842
Join Date: Jan 2016
Device: Kobo Glo HD
|
Quote:
if I understand this correctly I should be able to create an icon theme with light and dark versions for plugin icons too? I'm on windows 10, I tried to create icons in the "resources\images\Name of the plugin" folder but it works when I use icon.png but if I use icon-for-dark-theme.png or icon-for-light-theme.png the icon doesn't show up in calibre. Even with @JimmXinu plugin's like EpubMerge which specifies in the version note "Use Cal6 get_icons() so icon themes apply" I can't get it to work. What should I do concretely with the light and dark icons ? |
|
09-14-2023, 08:48 AM | #202 |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Themeing means the user installs an icon theme that has support for your plugin, then get_icons() will use icons from that theme if available, falling back to the icons in the plugin zip file when no icon is found in the theme.
|
09-14-2023, 08:54 AM | #203 | |
Guru
Posts: 927
Karma: 1177583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
|
Quote:
1) Look for user overrides in '../resources/images/Plugin name' 2) Look for themed versions (for-dark-theme / for-light-theme) 3) Look in the theme package 4) Use the plugin zipped image But, most of the plugins I checked, have their on implementation of a get_icon() function, created by @kiwidude. This was created back when calibre couldn't handle this. The point is: calibre changed but many plugins still uses the old scheme. Some plugin developers updated their function, like you mentioned (@JimmXinu and @kiwidude, for example). Also, I don't see anyone looking for themed icons (maybe I missed some). I implemented this for my plugins. This is my calibre 6+ get_icon() function: Spoiler:
This function also deals with themed icons inside the zip file. I always create two set of icons, to work with light and dark theme. P.S.: 'Check books' and 'Reading goal' are examples of plugins that can handle themed versions. Last edited by thiago.eec; 09-14-2023 at 09:08 AM. Reason: add examples |
|
09-14-2023, 09:51 AM | #204 | |
Groupie
Posts: 161
Karma: 1842
Join Date: Jan 2016
Device: Kobo Glo HD
|
Quote:
It works with your plugin with the for-dark-theme / for-light-theme like I was thinking. I made the highlight theme a few years ago with icons for a majority of the plugins at the time and I wanted to update it to be compatible with light and dark themes |
|
09-14-2023, 10:01 AM | #205 | |
Groupie
Posts: 161
Karma: 1842
Join Date: Jan 2016
Device: Kobo Glo HD
|
Quote:
yes I've mad the material and highlight themes for calibre a few years ago but the for-dark-theme / for-light-theme icons don't seem to work for themes. It works with thiago.eec's plugins but I downloaded the Interface Plugin Demo from calibre website (Interface Plugin Demo.zip) and it doesn't see the custom icons. The code for the demo plugin is Code:
icon = get_icons('images/icon.png', 'Interface Plugin Demo') thiago.eec's plugin that works doesn't seem to use the default implementation. |
|
09-14-2023, 10:25 AM | #206 |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Yes the default implementation doesnt check for dark/light. But plugin authors are free to roll their own.
|
09-14-2023, 10:39 AM | #207 | |
Groupie
Posts: 161
Karma: 1842
Join Date: Jan 2016
Device: Kobo Glo HD
|
Quote:
Do you think you will change this so that light and dark themes can be applied to plugins? Should I had a feature request in calibre bug tracker? |
|
09-14-2023, 10:41 AM | #208 |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
actually I think I am mis-remembering, the default implementation uses ICon.ic() and that does work with light/dark variants automatically.
|
09-14-2023, 10:58 AM | #209 |
Groupie
Posts: 161
Karma: 1842
Join Date: Jan 2016
Device: Kobo Glo HD
|
Then I don't know why but it doesn't seem to work.
Maybe @thiago.eec can confirm that it's not working with get_icons() |
09-14-2023, 11:37 AM | #210 | |
Guru
Posts: 927
Karma: 1177583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
|
Quote:
You need this too: ..\resources\images\PLUGIN_NAME\icon-for-dark-theme.png ..\resources\images\PLUGIN_NAME\icon-for-light-theme.png |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Suggestion for PI Devs | BetterRed | Plugins | 11 | 09-27-2020 06:18 PM |
Attn plugin devs: porting to python 3 | kovidgoyal | Plugins | 129 | 06-16-2020 01:31 AM |
Attention All Plugin Devs: Remove vestiges from python 2? | KevinH | Plugins | 11 | 05-29-2020 03:16 PM |
Plugin Devs: Should we include a License or COPYING file? | KevinH | Plugins | 3 | 08-15-2017 01:09 PM |
New Plugin Features in the upcoming Sigil 0.8.900 | KevinH | Plugins | 6 | 09-14-2015 02:48 PM |