gui_settings.py: Fix typing for boolean values

This commit is contained in:
Mykola Grymalyuk
2024-11-02 18:19:43 -06:00
parent bb56544182
commit 2a578734b9
3 changed files with 10 additions and 3 deletions

View File

@@ -13,7 +13,7 @@ from .detections import device_probe
class Constants:
def __init__(self) -> None:
# Patcher Versioning
self.patcher_version: str = "2.1.0" # OpenCore-Legacy-Patcher
self.patcher_version: str = "2.1.1" # OpenCore-Legacy-Patcher
self.patcher_support_pkg_version: str = "1.8.4" # PatcherSupportPkg
self.copyright_date: str = "Copyright © 2020-2024 Dortania"
self.patcher_name: str = "OpenCore Legacy Patcher"

View File

@@ -1115,13 +1115,17 @@ Hardware Information:
def _update_setting(self, variable, value):
logging.info(f"Updating Local Setting: {variable} = {value}")
setattr(self.constants, variable, value)
tmp_value = value or "PYTHON_NONE_VALUE"
tmp_value = value
if tmp_value is None:
tmp_value = "PYTHON_NONE_VALUE"
global_settings.GlobalEnviromentSettings().write_property(f"GUI:{variable}", tmp_value)
def _update_global_settings(self, variable, value, global_setting = None):
logging.info(f"Updating Global Setting: {variable} = {value}")
tmp_value = value or "PYTHON_NONE_VALUE"
tmp_value = value
if tmp_value is None:
tmp_value = "PYTHON_NONE_VALUE"
global_settings.GlobalEnviromentSettings().write_property(variable, tmp_value)
if global_setting is not None:
self._update_setting(global_setting, value)