Bottles icon indicating copy to clipboard operation
Bottles copied to clipboard

PreferencesWindow: Refactor

Open cyberphantom52 opened this issue 3 months ago • 5 comments

Description

Refactors the PreferencesWindow to use newer Adwaita widgets.

TODO:

  • [ ] Convert component lists into GtkListRow
  • [ ] Use property bindings and signals to simplify the code more.

Fixes #(issue)

Type of change

  • [X] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

  • [ ] Test A
  • [ ] Test B

cyberphantom52 avatar Mar 26 '24 01:03 cyberphantom52

Pylint result on modfied files:
************* Module bottles.frontend.views.preferences
bottles/frontend/views/preferences.py:89:0: C0303: Trailing whitespace (trailing-whitespace)
bottles/frontend/views/preferences.py:94:0: C0303: Trailing whitespace (trailing-whitespace)
bottles/frontend/views/preferences.py:103:0: C0303: Trailing whitespace (trailing-whitespace)
bottles/frontend/views/preferences.py:108:0: C0303: Trailing whitespace (trailing-whitespace)
bottles/frontend/views/preferences.py:113:0: C0303: Trailing whitespace (trailing-whitespace)
bottles/frontend/views/preferences.py:118:0: C0303: Trailing whitespace (trailing-whitespace)
bottles/frontend/views/preferences.py:129:0: C0303: Trailing whitespace (trailing-whitespace)
bottles/frontend/views/preferences.py:150:0: C0303: Trailing whitespace (trailing-whitespace)
bottles/frontend/views/preferences.py:23:0: E0611: No name 'Adw' in module 'gi.repository' (no-name-in-module)
bottles/frontend/views/preferences.py:78:0: W0613: Unused argument 'args' (unused-argument)
bottles/frontend/views/preferences.py:85:0: W0613: Unused argument 'args' (unused-argument)
bottles/frontend/views/preferences.py:91:0: W0613: Unused argument 'args' (unused-argument)
bottles/frontend/views/preferences.py:96:0: W0613: Unused argument 'args' (unused-argument)
bottles/frontend/views/preferences.py:100:0: W0613: Unused argument 'args' (unused-argument)
bottles/frontend/views/preferences.py:105:0: W0613: Unused argument 'args' (unused-argument)
bottles/frontend/views/preferences.py:110:0: W0613: Unused argument 'args' (unused-argument)
bottles/frontend/views/preferences.py:115:0: W0613: Unused argument 'args' (unused-argument)
bottles/frontend/views/preferences.py:120:0: W0613: Unused argument 'args' (unused-argument)
bottles/frontend/views/preferences.py:125:0: W0613: Unused argument 'args' (unused-argument)
bottles/frontend/views/preferences.py:131:0: W0613: Unused argument 'args' (unused-argument)
bottles/frontend/views/preferences.py:231:38: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/views/preferences.py:236:36: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/views/preferences.py:260:12: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
bottles/frontend/views/preferences.py:281:35: W0613: Unused argument 'widget' (unused-argument)
bottles/frontend/views/preferences.py:287:4: W0102: Dangerous default value [] as argument (dangerous-default-value)
bottles/frontend/views/preferences.py:33:0: R0904: Too many public methods (23/20) (too-many-public-methods)

github-actions[bot] avatar Mar 26 '24 02:03 github-actions[bot]

I'm thinking of converting all the component lists into GtkListBox then we can use gtk_list_box_bind_model to automatically populate them. But we will have to make changes in fetch_catalog method to return a GioListStore instead of a dict.

Thoughts? @mirkobrombin

cyberphantom52 avatar Mar 26 '24 03:03 cyberphantom52

I think it's a good idea but I have no experience with GioListStore, how complex do you think it is?

mirkobrombin avatar Mar 26 '24 08:03 mirkobrombin

I think it's a good idea but I have no experience with GioListStore, how complex do you think it is?

not too much, will do that once i'm free

cyberphantom52 avatar Mar 26 '24 10:03 cyberphantom52