Running over non selected books is something I always pondered, not just for Single Field Edit, but for all builtin actions with the exception of calibre actions, which have to be always selection based, since the actions are not under the plugin control.
The way I imagined it was a template based solution, where the template returns list of ids. For example, to run over all ids the template below can be used:
Code:
program:
from_search('id', '')
The book_vars ids will need a new template function, since book_vars always act on one selected row (the row containing the current index). Or maybe modify both book_vars and set_book_vars and make them accept id values.
The stumbling block was whether to implement this for each action separately, or can there be a better way to implement a general mechanism used by all actions. Any suggestions would be welcome. This might take some time until I reach a solution I am comfortable with.
Until then we can experiment with custom actions. To that end, I will introduce a change in the next version which will add a new action method — maybe call it loop_ids() — which can be overridden by subclasses to return the ids that will be acted on by the action.
Edit: One concern with this approach will be how handle invalid template output as they will be difficult to validate ahead of time.