angr / angr-management

The official angr GUI.
BSD 2-Clause "Simplified" License
868 stars 109 forks source link

No 'current' theme #805

Open zwimer opened 1 year ago

zwimer commented 1 year ago

Description

When loading a theme in angr-management, there are 3 options: Light, Dark, and Current. Selecting Current can cause:

Traceback (most recent call last):
  File "/Users/zwimer/.virtualenvs/am-dev/lib/python3.10/site-packages/angrmanagement/ui/dialogs/preferences.py", line 151, in _on_load_scheme_clicked
    self._load_color_scheme(self._schemes_combo.currentText())
  File "/Users/zwimer/.virtualenvs/am-dev/lib/python3.10/site-packages/angrmanagement/ui/dialogs/preferences.py", line 146, in _load_color_scheme
    for prop, value in COLOR_SCHEMES[name].items():
KeyError: 'Current'

Steps to reproduce the bug

rm -rf ~/.config/angr-management
angr-management

Open preferences "Themes and Colors" Beside "Load Theme" select Current Click "Load"

Environment

https://github.com/angr/angr-management/commit/41b574ed070e8112b1cf5e61e43e81286d569c86

Additional context

No response

zwimer commented 1 year ago

@mborgerson What is "Current" as a theme choice supposed to do? A no-op?

zwimer commented 1 year ago

Is it supposed to be the System theme? If so, I think we should rename this to "System".

mborgerson commented 1 year ago

'Current' is supposed to mean whatever is currently configured. e.g. if the user loads the Dark theme, Dark theme values are copied to Current

zwimer commented 1 year ago

What is the rational for having "Current" when the loaded theme is already in the combobox selector and should be auto-selected when the preference tab opens? Or what does it add?

zwimer commented 1 year ago

I'll remove the Current for now, this will is done in #806