mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-21 06:30:52 +10:00
gui_settings.py: Fix typing for boolean values
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
# OpenCore Legacy Patcher changelog
|
# OpenCore Legacy Patcher changelog
|
||||||
|
|
||||||
|
## 2.1.1
|
||||||
|
- Resolve boolean GUI settings saving incorrectly as Python's None type
|
||||||
|
|
||||||
## 2.1.0
|
## 2.1.0
|
||||||
- Disable FeatureUnlock by default
|
- Disable FeatureUnlock by default
|
||||||
- Intended to maintain long term stability
|
- Intended to maintain long term stability
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ from .detections import device_probe
|
|||||||
class Constants:
|
class Constants:
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
# Patcher Versioning
|
# 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.patcher_support_pkg_version: str = "1.8.4" # PatcherSupportPkg
|
||||||
self.copyright_date: str = "Copyright © 2020-2024 Dortania"
|
self.copyright_date: str = "Copyright © 2020-2024 Dortania"
|
||||||
self.patcher_name: str = "OpenCore Legacy Patcher"
|
self.patcher_name: str = "OpenCore Legacy Patcher"
|
||||||
|
|||||||
@@ -1115,13 +1115,17 @@ Hardware Information:
|
|||||||
def _update_setting(self, variable, value):
|
def _update_setting(self, variable, value):
|
||||||
logging.info(f"Updating Local Setting: {variable} = {value}")
|
logging.info(f"Updating Local Setting: {variable} = {value}")
|
||||||
setattr(self.constants, 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)
|
global_settings.GlobalEnviromentSettings().write_property(f"GUI:{variable}", tmp_value)
|
||||||
|
|
||||||
|
|
||||||
def _update_global_settings(self, variable, value, global_setting = None):
|
def _update_global_settings(self, variable, value, global_setting = None):
|
||||||
logging.info(f"Updating Global Setting: {variable} = {value}")
|
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)
|
global_settings.GlobalEnviromentSettings().write_property(variable, tmp_value)
|
||||||
if global_setting is not None:
|
if global_setting is not None:
|
||||||
self._update_setting(global_setting, value)
|
self._update_setting(global_setting, value)
|
||||||
|
|||||||
Reference in New Issue
Block a user