Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor diversion rules #2378

Open
1 of 3 tasks
MattHag opened this issue Mar 10, 2024 · 0 comments
Open
1 of 3 tasks

Refactor diversion rules #2378

MattHag opened this issue Mar 10, 2024 · 0 comments

Comments

@MattHag
Copy link
Collaborator

MattHag commented Mar 10, 2024

  • Solaar version: 1.1.11

Description

The biggest source file is the ui/diversion_rules.py with 2700 lines of code. It creates the Rule editor UI and loads/stores the configured rules. It is tightly coupled with GTK and more dependencies, which makes it is hard to add new features and tackle UI and UX problems with the existing code base (e.g. see Related #2349, #2267).

Decoupling
The diversion related models are coupled with the GTK GUI and that's bad for testing, maintenance and adding features. A conversion to the MVP architecture seems the best to make the code future-proof and support work on new features and a better overall user experience.

More resources to MVP:

Tasks

Refactor and simplify the code, until it supports unit testing

  • Split it into smaller files Split diversion rules #2390
  • Add type hints
  • Rewrite diversion GUI using MVP (Model-View-Presenter) architecture
MattHag added a commit to MattHag/Solaar that referenced this issue Mar 10, 2024
MattHag added a commit to MattHag/Solaar that referenced this issue Mar 10, 2024
MattHag added a commit to MattHag/Solaar that referenced this issue Mar 10, 2024
MattHag added a commit to MattHag/Solaar that referenced this issue Mar 10, 2024
MattHag added a commit to MattHag/Solaar that referenced this issue Mar 10, 2024
MattHag added a commit to MattHag/Solaar that referenced this issue Mar 10, 2024
pfps pushed a commit that referenced this issue Mar 11, 2024
* 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
MattHag added a commit to MattHag/Solaar that referenced this issue Mar 13, 2024
MattHag added a commit to MattHag/Solaar that referenced this issue Mar 13, 2024
Put rule conditions and actions into their into module

Related pwr-Solaar#2378
MattHag added a commit to MattHag/Solaar that referenced this issue Mar 13, 2024
MattHag added a commit to MattHag/Solaar that referenced this issue Mar 13, 2024
MattHag added a commit to MattHag/Solaar that referenced this issue Mar 13, 2024
Put rule conditions and actions into their into module

Related pwr-Solaar#2378
MattHag added a commit to MattHag/Solaar that referenced this issue Mar 13, 2024
MattHag added a commit to MattHag/Solaar that referenced this issue Mar 13, 2024
Put rule conditions and actions into their into module

Related pwr-Solaar#2378
MattHag added a commit to MattHag/Solaar that referenced this issue Mar 13, 2024
MattHag added a commit to MattHag/Solaar that referenced this issue Mar 13, 2024
pfps pushed a commit that referenced this issue Mar 14, 2024
pfps pushed a commit that referenced this issue Mar 14, 2024
Put rule conditions and actions into their into module

Related #2378
pfps pushed a commit that referenced this issue Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant