![]() |
#1531 | |
Chalut o/
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 450
Karma: 678910
Join Date: Dec 2017
Device: Kobo
|
Quote:
If this book matches the condition, the action will be performed on all selected books, even those that do not match and on which you did not want to perform this action. And I don't think a real filter feature would be possible, because Action Chains often uses the selected books to retrive the id to perform their own action, so it real not depending of Action Chains that the Calibre actions are all or nothing. A real filter feature would involve deselecting and selecting dynamically wich rows is needed before run the Calibre actions, then redo that at each step of the chain. ... I think it's possible (Calibre is powerfull like that), but it would be terribly complicated, so I will give it no hope. Last edited by un_pogaz; Today at 05:38 AM. |
|
![]() |
![]() |
![]() |
#1532 |
Chalut o/
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 450
Karma: 678910
Join Date: Dec 2017
Device: Kobo
|
Okay. By checking the code, I found a possible way.
`gui.current_view().get_selected_ids()` allow to retrive the book id of the selected row, and `gui.current_view().select_rows()` allow to select the book base on their id `class calibre.gui2.library.views.BooksView. Additionaly, using this two function allow to mimic and preserve the selection order. Beside @capink, get_selected_ids() it probably a better ways to retrive the book id than you current way. Damn it, if you had GitHub or similiar, I could work on proposing a patch, to either transform the condition on a true filter, or add a new filter feature. I'll see what I can do, but it won't be as clean to share you the full files like that. Last edited by un_pogaz; Today at 05:40 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#1533 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,205
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
|
Quote:
Quote:
The solution in the post even allows for saving the initial selection into a variable, so that you can restore them mid-chain if you want, and allow for more flexible control. |
||
![]() |
![]() |
![]() |
#1534 |
Chalut o/
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 450
Karma: 678910
Join Date: Dec 2017
Device: Kobo
|
Interesing, but I think that a formal implementation of a filter system would be a big plus, certainly with its own column/settings.
Also, if I understand your idea of wanting to dynamically display the menu entry based on simple condition criteria and so limit this to a single metadata object for performance reason, I think that inside the chains themselves, this is too confusive. It's certainly too late to replace this column with a proper filter setting, but in any case, I really encourage the addition of such thing. Else, I worked of the idea and so here my proposal: Spoiler:
|
![]() |
![]() |
![]() |
#1535 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,500
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
FWIW: I'm currently implementing these changes to the base formatter.
Code:
program: ids = selected_books(); col = selected_column(); res = ''; for id in ids: with id: # prints information from the book with identifier 'id' print($title, field(col)); res = (if res then res & ',' fi) & field(col); template('program: print("inside template", $title)') htiw rof; list_remove_duplicates(res, ',') EDIT: I'm also going to implement "show_in_dialog()" that renders an html string. Last edited by chaley; Today at 10:17 AM. |
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
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 |