![]() |
#1291 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,229
Karma: 63194753
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
From smarteject_plugin.py is the option to display a prompt if the user attempts to ejected with unsynced books on a Reading List:
Code:
if 'Reading List' in self.gui.iactions and prefs['checkreadinglistsync']: rl_plugin = self.gui.iactions['Reading List'] list_names = rl_plugin.get_list_names(exclude_auto=True) all_list_names = rl_plugin.get_list_names(exclude_auto=False) auto_list_names = list(set(all_list_names) - set(list_names)) if self.gui.device_manager.is_device_connected: sync_total = rl_plugin._count_books_for_connected_device() rl_plugin.sync_now_action.setEnabled(bool(sync_total > 0) or len(auto_list_names) > 0) if sync_total > 0: if question_dialog(self.gui, _("Sync Reading List?"), _("There are books that need syncing according to Reading List.<p>Sync Books?"), show_copy_button=False): rl_plugin.sync_now(force_sync=True) return Last edited by ownedbycats; 03-06-2024 at 07:44 PM. |
![]() |
![]() |
![]() |
#1292 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,134
Karma: 1954142
Join Date: Aug 2015
Device: Kindle
|
I am not really familiar with syncing in calibre, because the closed nature of kindle and the inability to manage collections, means it is better for me to just email one book at a time. But in principle, that code above could be adapted to a custom action or a "Run Python Code" action. For anyone interested, to halt the chain, instead of returning the function, you should call:
Code:
raise chain.UserInterrupt |
![]() |
![]() |
Advert | |
|
![]() |
#1293 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,134
Karma: 1954142
Join Date: Aug 2015
Device: Kindle
|
New test version
Version 1.20.0
The main change here is that some chains can be run as calibre jobs. Chains containing any of the following actions cannot not run as jobs:
The main reason for this is that these actions make changes to the GUI, and so they can only be run in the main thread. Note that this feature is experimental and requires setting the following plugin tweak: Code:
action_chains_experimental = True Last edited by capink; 04-09-2024 at 03:44 AM. |
![]() |
![]() |
![]() |
#1294 |
want to learn what I want
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,102
Karma: 6425162
Join Date: Sep 2020
Device: Calibre E-book viewer
|
Looking good, though I get this error when trying to choose an icon image not available in the current listing:
Spoiler:
If I choose an icon that has been used before, i. e., already listed in the chains dialog, all goes well. Also, I've noticed that a conflicting setting that I had disabled from JS+ plugin doesn't affect icon displaying anymore. I re-enabled that setting just to see if that new icon combo location had any positive effect on that. It has! However, the error I mentioned had happened before I re-enabled temporarily that setting. I haven't tested yet the new feature to run actions as jobs. This on Windows 10 21H1, Calibre 7.7 |
![]() |
![]() |
![]() |
#1295 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,229
Karma: 63194753
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
What're the advantages of run as job?
|
![]() |
![]() |
Advert | |
|
![]() |
#1296 |
want to learn what I want
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,102
Karma: 6425162
Join Date: Sep 2020
Device: Calibre E-book viewer
|
possibly useful to monitor job logs, depending on the log's verbosity level, I guess.
other than that, I too would like to know Count TOC nodes runs well with the new option enabled: Starting job: Run chain: Count TOC nodes Chain ran successfully |
![]() |
![]() |
![]() |
#1297 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,911
Karma: 7076137
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
![]() |
![]() |
![]() |
#1298 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,134
Karma: 1954142
Join Date: Aug 2015
Device: Kindle
|
Quote:
Quote:
|
||
![]() |
![]() |
![]() |
#1299 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,134
Karma: 1954142
Join Date: Aug 2015
Device: Kindle
|
|
![]() |
![]() |
![]() |
#1300 |
want to learn what I want
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,102
Karma: 6425162
Join Date: Sep 2020
Device: Calibre E-book viewer
|
I'm going to post a small video, shortly
|
![]() |
![]() |
![]() |
#1301 |
want to learn what I want
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,102
Karma: 6425162
Join Date: Sep 2020
Device: Calibre E-book viewer
|
I've tried to demonstrate two events:
- one triggers the message after cancelling the choose icon dialog - the other happens after the icon gets chosen And I also notice that an unselected line on the chains dialog has the 'Add New Image' selection kind of incorrectly, not sure. I'd think a more proper behaviour would be having this line displayed as blank (no icon). I had also instances of Calibre exiting ungracefully out of the blank, after the icon is chosen in that dialog - that's why I wasn't able to generate a useful debug log. |
![]() |
![]() |
![]() |
#1302 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,134
Karma: 1954142
Join Date: Aug 2015
Device: Kindle
|
OK. That did not happen to me with Linux. Anyways, I will post a new version later tonight with a persistent editor. If it does not work, will put the icon combo back into the Action Dialog.
|
![]() |
![]() |
![]() |
#1303 | |
want to learn what I want
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,102
Karma: 6425162
Join Date: Sep 2020
Device: Calibre E-book viewer
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#1304 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,134
Karma: 1954142
Join Date: Aug 2015
Device: Kindle
|
|
![]() |
![]() |
![]() |
#1305 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,134
Karma: 1954142
Join Date: Aug 2015
Device: Kindle
|
Here is a new version. Try it out and see whether it helps with the icon problem.
Last edited by capink; 03-15-2024 at 02:13 PM. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Editor Plugin] Editor Chains | capink | Plugins | 94 | 07-03-2024 07:26 PM |
Action Chains Resources | capink | Plugins | 65 | 07-01-2024 03:12 PM |
[GUI Plugin] Noosfere_util, a companion plugin to noosfere DB | lrpirlet | Plugins | 2 | 08-18-2022 03:15 PM |
[GUI Plugin] Save Virtual Libraries To Column (GUI) | chaley | Plugins | 14 | 04-04-2021 05:25 AM |