![]() |
#526 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,465
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
![]() The "normal" reason for calling that method is that you are doing something on the GUI thread that takes a *long* time, or that your code is on a separate thread without normal event management. Making the call forces processing of queued GUI events, but it is doing so in the middle of processing some other event. My experience is that it is rare that such a call is needed, and if it is needed then it is often a programming error where long-running "jobs" are running on the GUI thread. One must ask:
|
|
![]() |
![]() |
![]() |
#527 | |||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,200
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Quote:
Not always, but it can be. Running long search and replace chain on huge libraries can take hours. I've done this when I was testing the plugin at the beginning. Quote:
Quote:
A temporary solution besides the timers, would be to turn this off for chains that are activated by that particular event. I will also test without the call to processEvents and see how much of a difference does it make. Last edited by capink; 04-13-2021 at 07:35 PM. |
|||
![]() |
![]() |
Advert | |
|
![]() |
#528 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,063
Karma: 75568269
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
On Windows, if a process goes five seconds without reading the event queue, the OS will assume it's hung and make the window white out and offer to end the process. I am unsure how other OSes handle this though.
|
![]() |
![]() |
![]() |
#529 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,063
Karma: 75568269
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Keyboard shortcuts will ignore conditionals and run the chain; I accidentally hit my shortcut for "update fanfic on device" (which is set to a connected_device_name('main') and greyed out in the menu) and got four messages in a row telling me the device wasn't connected before it updated my #onkobo column. Is this something that can be fixed, or outside of AC's control?
Last edited by ownedbycats; 04-14-2021 at 05:21 AM. |
![]() |
![]() |
![]() |
#530 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,200
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
This is a regression from some code refactoring I did. I have it fixed and will post a new version later today.
|
![]() |
![]() |
Advert | |
|
![]() |
#531 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,200
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Quote:
|
|
![]() |
![]() |
![]() |
#532 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,465
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
A thought: both the basic scope manager and the selection modifier support searching, but with different options. They also have options that appear to do the same thing. Perhaps the visual presentation and option descriptions should be made the same? Or perhaps embed the scopes dialog into the selection modifier, replacing the search part? If you did this then you wouldn't need to add "scopes" to the selection modifier because they would be built into it. |
|
![]() |
![]() |
![]() |
#533 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,200
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Quote:
Another limitation of the Selection Modifier is that the search entered by the user has to be validated or else the settings dialog will print an error message. This is done because if the user combines a search with the option to select all books in current view, and the search turns out to invalid, all books in current view (the whole library most likely) will be selected and acted upon by subsequent actions. The above point is whey I had to introduce the "Search Using Templates" as separate action because the search cannot be validated ahead of time as required by the selection modifier validator, since it results from a template that can only be evaluated at runtime I didn't have to bother with search validation in Basic Scopes, because if the user enters an invalid search it will simply return an empty book ids list, with no harmful consequences. Quote:
But your point made me realize that I can modify the "Search Using Templates" action to actually make it use and call "Template Scopes", thus removing the need to add an option to the selection modifier. ![]() |
||
![]() |
![]() |
![]() |
#534 |
Member
![]() Posts: 13
Karma: 10
Join Date: Apr 2013
Device: lots of, frequently changing
|
|
![]() |
![]() |
![]() |
#535 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,063
Karma: 75568269
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
|
![]() |
![]() |
![]() |
#536 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,063
Karma: 75568269
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Question: I have a 'view' action (bound to V and limited to 1 book to prevent mass-opening accidents) to open a book and populate a few columns:
Code:
{ "ActionsChainMenus": { "Menus": [ { "active": true, "chain_settings": { "chain_links": [ { "action_name": "Calibre Actions", "action_settings": { "disable_busy_cursor": false, "selection": [ { "display": "View", "path": [ "View", "View" ], "paths_text": "View" } ], "wait_jobs": false, "wait_progress": false }, "comment": "Open book" }, { "action_name": "Single Field Edit", "action_settings": { "col_name": "#read", "template": "program:\n\n\tif and(check_yes_no('#read', '', '', 1),) then \t'No'\n\telse $#read\n\tfi", "value_type": "template" }, "comment": "Set #read column (TEMPLATE)" }, { "action_name": "Single Field Edit", "action_settings": { "col_name": "#percentread", "template": "program:\n\tif raw_field('#percentread', '1') ==# '0' then '1'\n\telse raw_field('#percentread')\n\tfi", "value_type": "template" }, "comment": "Set #percentread to 1 (TEMPLATE)" }, { "action_name": "Single Field Edit", "action_settings": { "col_name": "#lastread", "value": [ { "__class__": "datetime.datetime", "__value__": "2021-03-30T00:13:43.637933+00:00" }, true ], "value_type": "predefined" }, "comment": "Set #lastread to current time" }, { "action_name": "Refresh View", "action_settings": {}, "comment": "Refresh view" } ], "refresh_gui": true }, "condition_settings": { "affect_menu": false, "cmp_type": "=", "datatype": "number", "icon": "", "template": "program: selection_count()", "tooltip": "", "value": 1.0 }, "image": "", "menuText": "View", "subMenu": "Invisible" } ] }, "schemaVersion": 1.5 } Last edited by ownedbycats; 04-17-2021 at 01:30 AM. |
![]() |
![]() |
![]() |
#537 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,200
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Two options:
|
![]() |
![]() |
![]() |
#538 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,063
Karma: 75568269
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
That worked.
![]() |
![]() |
![]() |
![]() |
#539 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,200
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
It works for anything the template language can access. I have a similar chain that takes different actions depending on what formats are present. I have it connected to the "double click" event + a custom "enter pressed" event.
|
![]() |
![]() |
![]() |
#540 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,063
Karma: 75568269
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Something I am curious about: I have a custom module to display a confirmation prompt. I mostly use it to avoid accidentally activations of chains I am testing.
would it be possible, with the vars or something, to prompt for a specific action in a chain? If you press 'yes,' it runs the next action; if you press 'no' it skips over that specific action but runs the rest. Last edited by ownedbycats; 04-18-2021 at 10:54 PM. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Action Chains Resources | capink | Plugins | 78 | 08-05-2025 04:01 AM |
[Editor Plugin] Editor Chains | capink | Plugins | 106 | 06-17-2025 05:36 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 |