Skip to content

Commit

Permalink
derp: only convert booleans to yes/no strings
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Jan 7, 2025
1 parent aa6d4e9 commit d0959a3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions xpra/gtk/configure/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,13 @@ def save_user_config_file(options: dict) -> None:
f.write(f"{k} = {item}\n")


def update_config_attribute(attribute: str, value) -> None:
log(f"update config: {attribute}={value}")
def update_config_attribute(attribute: str, value: str | int | float) -> None:
config = parse_user_config_file()
config[attribute] = "yes" if bool(value) else "no"
value_str = str(value)
if isinstance(value, bool):
value_str = "yes" if bool(value) else "no"
config[attribute] = value_str
log(f"update config: {attribute}={value_str}")
save_user_config_file(config)


Expand Down
2 changes: 1 addition & 1 deletion xpra/gtk/configure/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def configure_switches(self, defaults):

@staticmethod
def toggle_subsystem(_widget, state, subsystem):
update_config_attribute(subsystem, state)
update_config_attribute(subsystem, bool(state))


def main(_args) -> int:
Expand Down

0 comments on commit d0959a3

Please sign in to comment.