Commit Graph

92 Commits

Author SHA1 Message Date
Matthias Hagmann 7d171b1d09 Refactor: Use dataclasses and enums
Replace NamedTuples with more flexible dataclass, which also support
type hints. Introduce enums to replace constant strings, which need to
be kept in sync. Also enhances interfaces by limiting it to the enum
values. Remove unused variables.
2024-05-22 21:14:41 -04:00
MattHag 959dd2a35b
Refactor rule loading for testability (#2456)
rules: Introduce tests for YAML rule loading functionality.
2024-04-27 17:56:27 -04:00
Peter F. Patel-Schneider 50c8013cb1 ui: reduce deprecation warnings in ui 2024-03-19 09:07:21 -04:00
Matthias Hagmann 2f6e3e21ec refactor: Split diversion rules into smaller modules
Put rule conditions and actions into their into module

Related #2378
2024-03-14 17:15:10 -04:00
Matthias Hagmann 4e7356385d refactor: Make _populate_model a function
Related #2378
2024-03-14 17:15:10 -04:00
Peter F. Patel-Schneider 154dd7017f rules: allow sub-second delays in Later 2024-03-14 17:08:47 -04:00
Matthias Hagmann 5b09ace1f5 ruff: Apply single line import format
# Usage
pre-commit run --all-files

Related #2295
2024-03-13 15:41:21 -04:00
Matthias Hagmann e92f1a8a0b Automatically upgrade strings to f-string
Used flynt to convert strings to f-strings, where safely possible.

Usage:
flynt .

Related #2372
2024-03-13 11:02:50 -04:00
MattHag 704d591448
ui: refactor diversion_rules
* refactor: Create close dialog in its own function

Related #2378

* refactor: Create selected rule edit panel in module level function

Related #2378

* refactor: Remove commented code

Related #2378

* refactor: Use Gdk constant for right click button comparison

Related #2378

* refactor: Make _menu_do_copy a function

Related #2378
2024-03-11 10:19:20 -04:00
Matthias Hagmann 7ef3059b69 clean up: Remove editor specific marks
Related #2273
2024-02-29 10:10:46 -05:00
Matthias Hagmann eb937fcc3a Manually fix linter issues
Related #2295
2024-02-20 15:41:10 -05:00
Matthias Hagmann 7774569971 Apply ruff format
Run ruff auto formatting using:
ruff format .

Related #2295
2024-02-20 15:41:10 -05:00
MattHag 87658fb189
logging: Simplify logger instantiation
* logging: Simplify logger instantiation

Relates #2254

* logging: Remove aliases

Relates #2254

* logging: Replace deprecated warn with warning

Related #2254

* logging: Fix mistake

Related #2257
2024-02-10 13:55:27 -05:00
Peter F. Patel-Schneider 90a0408bd6 rules: add single depress and release options for rule mouse click action 2023-09-16 10:28:56 -04:00
Peter F. Patel-Schneider fc38862e8b rules: add rule condition for hostname 2023-09-16 10:28:56 -04:00
Peter F. Patel-Schneider 78341f87e9 ui: add editing of Device rule condition 2023-02-18 11:25:25 -05:00
Peter F. Patel-Schneider 9d278edc82 ui: add KeyIsDown to list of conditions 2022-12-17 13:21:52 -05:00
Peter F. Patel-Schneider ceb174dc50 ui: allow editing of KeyIsDown conditions 2022-12-17 13:21:52 -05:00
Peter F. Patel-Schneider d6872422fd ui: allow editing of rules with parameters 2022-12-11 17:27:37 -05:00
ejsc1 5656f90cdb
misc: update yapf version
* misc: update yapf version v2

* Update .pre-commit-config.yaml

Co-authored-by: Peter F. Patel-Schneider <pfpschneider@gmail.com>
2022-11-26 22:37:32 -05:00
Peter F. Patel-Schneider 691227170f ui: reduce standard size of rule editor window 2022-11-06 16:21:50 -05:00
Peter F. Patel-Schneider aa5e75fa18 ui: add Later action to rules editor 2022-09-26 09:36:46 -04:00
Rongrong ccff54609f chore: clean a redundant space in a UI label 2022-09-10 10:18:16 -04:00
Peter F. Patel-Schneider a3e2552ee0 ui: use device list in Active condition 2022-08-28 09:52:33 -04:00
Peter F. Patel-Schneider 20ac8db787 ui: add description of rule components to rule editor 2022-08-28 09:52:33 -04:00
Peter F. Patel-Schneider f1d69ede2c ui: add Active condition to rule editor 2022-08-23 09:18:57 -04:00
Peter F. Patel-Schneider 95cbaeaba3 ui: don't produce warnings when editing rules in rule editor 2022-08-21 06:08:40 -04:00
Peter F. Patel-Schneider 97c65d05e2 ui: add depress and release KeyPress options to rule editor 2022-06-21 20:23:22 -04:00
Peter F. Patel-Schneider 39ec9337a2 rules: add recent diversion features to default list in rules UI 2022-04-15 09:13:46 -04:00
Peter F. Patel-Schneider 87e0ecacf3 ui: remove need for pggettext by changing name of field in rule editor 2022-04-11 13:20:42 -04:00
Vinícius c53c77f427 ui: add support to Setting condition 2022-03-16 18:29:52 -04:00
Vinícius 588d7ae533 ui: add support to TestBytes 2022-03-10 21:04:28 -05:00
Peter F. Patel-Schneider 27752778ab ui: fix bug in add and delete button actions 2022-02-28 09:04:12 -05:00
Peter F. Patel-Schneider eedf4bfffb rules: use local file for conversion from key names to keysyms 2022-02-27 08:21:52 -05:00
Peter F. Patel-Schneider 69046678ac ui: default editable to True in show method 2022-02-16 21:14:52 -05:00
Peter F. Patel-Schneider 7a9f9972a6 receiver: fix contains for NamedInts and eliminate use of has_element 2022-01-24 14:03:17 -05:00
Vinícius 25523315ab ui: fix tree row text when device contains options not in the full list 2022-01-24 11:12:04 -05:00
Vinícius 6f28a39a47 ui: fix choice field when device is connected 2022-01-24 11:12:04 -05:00
Vinícius 8be2ca110a ui: avoid conflicts when settings with the same name have different labels for the same number 2022-01-24 11:12:04 -05:00
Vinícius 2b26c9dc92 ui: do not accept numerical value typed by user 2022-01-24 11:12:04 -05:00
Vinícius 49f2c6d8b9 ui: fix bug that made setting values not appear 2022-01-24 11:12:04 -05:00
Vinícius bf8b861275 ui: don't show generic labels when specific ones are available for the same field 2022-01-24 11:12:04 -05:00
Vinícius 747d2e9c17 ui: show translated strings instead of internal names 2022-01-24 11:12:04 -05:00
Vinícius d6c2b30760 ui: show keys supported by device even if they are not in the known universe 2022-01-24 11:12:04 -05:00
Vinícius 4d8b22f764 ui: replace typed text with key/value default display name 2022-01-24 11:12:04 -05:00
Vinícius 6dd980c541 ui: replace typed id with device display name 2022-01-24 11:12:04 -05:00
Vinícius 68e2b8ce6e ui: add support to choices_extra 2022-01-24 11:12:04 -05:00
Vinícius fa0ecc6c2c ui: add blank field to toggle widgets 2022-01-24 11:12:04 -05:00
Vinícius 573cb6e985 ui: fix - typed text was not recognised as valid 2022-01-24 11:12:04 -05:00
Vinícius 2d2d3e3bc6 ui: make key and value fields case-insensitive 2022-01-24 11:12:04 -05:00