Created by: viniciusbm
See discussion in #988.
This PR adds a GUI to display, create and edit diversion rules. It still needs to be improved in many ways, but it's already functional. It displays built-in rules (read-only) and rules defined by the user (which are editable). To see the available options, right-click a row. To edit the contents of a row, click it and change the values on the bottom panel. For types that require a string from a list, suggestions are shown under the text field in a case-insensitive way, ignoring underscores and spaces, considering any allowed value that contains the input text as a substring at any position (e.g. for KeyPress
, typing "volume" shows the suggestions XF86_AudioLowerVolume
and XF86_AudioRaiseVolume
).
TESTING SUGGESTIONS:
Before testing, read docs/rules.md so that you understand something about what these rules do in Solaar. Create the file ~/.config/solaar/rules.yaml with a few rules. There are some sample rules at the end of docs/rules.md
Then click on the button for editing rules. Check that all your rules show up and that the built-in rules also show up. Report on any problems.
Then try to edit some rules. Do some easy changes, like changing a KeyPress or MouseScroll action or a Test condition. Do some structural changes, like adding a condition to a rule or adding an entirely new rule. Check that these rules are saved correctly. Report on any problems.
Suggestions for UI changes are welcome. Changes that are hard to implement will likely be deferred to some indefinite future.