![]() |
#211 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
I am afraid you will have to write the code for that. I don't know much about calibre editor. The plugin was designed to access some calibre interface action —through Calibre Actions— in the main calibre program only.
|
![]() |
![]() |
![]() |
#212 | |
Hedge Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 802
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
|
Quote:
I have an easy alternate way of doing what I wanted using some third party software, so no biggy. |
|
![]() |
![]() |
![]() |
#213 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Event Manager
The new event manager gives the user the ability to make chains run automatically in response to events. Events can be either builtin or user-defined. See example below for how to write custom events.
The plugin currently ships with these builtin events:
This new event manager was made possible by the introduction of the conditions dialog, because running chains in response to events without reining them with conditions would have been impractical. See this post for more on how to set conditions for chains. Events can pass arguments that are stored in a chain variable called _event_args. Currently only these Events pass arguments:
Here is an example of how to add extra events using the plugin's module editor, you do it by returning the signal associated with the event. Code:
from calibre_plugins.action_chains.events import ChainEvent class SearchChanged(ChainEvent): # replace with the name of your event name = 'Search Changed' def get_event_signal(self): return self.gui.search.changed Note2: The event manager does not respond to any events that happen when chains or other events are running. Last edited by capink; 02-26-2025 at 04:37 PM. |
|
![]() |
![]() |
![]() |
#214 | |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,994
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#215 | |
Hedge Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 802
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
|
Quote:
I know about Pulover's Macro Creator and have used it in the past. I have problems with it, although it is very powerful. Also it would be overkill for what I want to do so I am trying out MiniMouse. |
|
![]() |
![]() |
![]() |
#216 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,994
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
I created a one-action chain to switch to my custom "on device" view in View Manager. I set Events Manager to run it when a device gets connected. It works.
![]() Small typo in the dialog: "Validate chains before runnig..." Last edited by ownedbycats; 12-28-2020 at 10:37 PM. |
![]() |
![]() |
![]() |
#217 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#218 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,012
Karma: 500000
Join Date: Jun 2015
Device: Rocketbook, kobo aura h2o, kobo forma, kobo libra color
|
How would you set up an event for adding a book.... and how would it handle multiple books imported at once... would this make sense?
|
![]() |
![]() |
![]() |
#219 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
You will have to look in calibre code for signals associated with these events, and add them as action chains events.
As for import, if you are using something like Import List plugin, a better approach is to create a chain with Import List as the first action, followed by whatever actions you want after that. This cannot be done for adding books, as the action for adding books starts on a separate thread without blocking the main thread, which does not work with action chains sequential nature. Hence, it was removed. |
![]() |
![]() |
![]() |
#220 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,012
Karma: 500000
Join Date: Jun 2015
Device: Rocketbook, kobo aura h2o, kobo forma, kobo libra color
|
This is not something I'd ever likely use. I just import books with a tag marking them as needing attention and then manually process them. But someone asked a question that this might be a solution for.
Quote:
Maybe it'd just be easier to run it by hand and rely on the tag that marks newly imported books. |
|
![]() |
![]() |
![]() |
#221 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,196
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
This just needs someone to wrap the adding action into a function that calls it and blocks the main thread until all books are added (most a probably there is signal or something that can be used to check using qtimer), and then return control. After that you can select all added books with the selection modifier (books modified by last action).
I am not interested in this myself, so I have not looked on how it could be implemented. |
![]() |
![]() |
![]() |
#222 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,994
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
One thing that would be easy to chain I'd think is adding the same file to multiple book records as long as the file path stayed the same. A bit useless for most situations though—the only use I can think of is to add a dummy.paperbook file to records of physical books.
Last edited by ownedbycats; 12-29-2020 at 10:58 PM. |
![]() |
![]() |
![]() |
#223 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,994
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Small idea:
I can see several uses for an "add/remove specified amount" to Single Field Edit > Integer-type, e.g. a column tracking how many times the book's been read. Possibly can already done via template though. I'm not planning anything requiring its use in the near future, but something to consider. ![]() Last edited by ownedbycats; 12-29-2020 at 10:59 PM. |
![]() |
![]() |
![]() |
#224 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,636
Karma: 12595249
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#225 |
Interested in the matter
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 421
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
|
Issue with version 0.5.2
Until this version everything is fine. I think the screenshot explains it clearly.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Editor Plugin] Editor Chains | capink | Plugins | 106 | 06-17-2025 05:36 PM |
Action Chains Resources | capink | Plugins | 77 | 06-16-2025 12:45 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 |