Convert NV Web default to global_settings.py

This commit is contained in:
Mykola Grymalyuk
2022-05-27 21:03:54 -06:00
parent b73f9f240a
commit f068e82bb5
4 changed files with 6 additions and 10 deletions

View File

@@ -2476,11 +2476,11 @@ class wx_python_gui:
def force_web_drivers_click(self, event=None):
if self.force_web_drivers_checkbox.GetValue():
print("Force Web Drivers Enabled")
subprocess.run(["defaults", "write", "~/Library/Preferences/com.dortania.opencore-legacy-patcher", "Force_Web_Drivers", "-bool", "TRUE"])
global_settings.global_settings().write_property("Force_Web_Drivers", True)
self.constants.force_nv_web = True
else:
print("Force Web Drivers Disabled")
subprocess.run(["defaults", "write", "~/Library/Preferences/com.dortania.opencore-legacy-patcher", "Force_Web_Drivers", "-bool", "FALSE"])
global_settings.global_settings().write_property("Force_Web_Drivers", False)
self.constants.force_nv_web = False
def windows_gmux_click(self, event=None):

View File

@@ -173,10 +173,6 @@ class generate_defaults:
except KeyError:
pass
nv_web_status = subprocess.run(["defaults", "read", "~/Library/Preferences/com.dortania.opencore-legacy-patcher", "Force_Web_Drivers"], stdout=subprocess.PIPE).stdout.decode("utf-8").strip()
if nv_web_status in ["1", "true"]:
settings.force_nv_web = True
else:
subprocess.run(["defaults", "write", "~/Library/Preferences/com.dortania.opencore-legacy-patcher", "Force_Web_Drivers", "-bool", "FALSE"])
settings.force_nv_web = False
nv_web_status = global_settings.global_settings().read_property("Force_Web_Drivers")
if nv_web_status is True:
settings.force_nv_web = True

View File

@@ -13,6 +13,7 @@ class global_settings:
self.global_settings_folder = "/Users/Shared"
self.global_settings_plist = f"{self.global_settings_folder}/{self.file_name}"
self.generate_settings_file()
self.convert_defaults_to_global_settings()
def generate_settings_file(self):
if Path(self.global_settings_plist).exists():

View File

@@ -46,7 +46,6 @@ class OpenCoreLegacyPatcher:
self.constants.unpack_thread.start()
defaults.generate_defaults.probe(self.computer.real_model, True, self.constants)
global_settings.global_settings().convert_defaults_to_global_settings()
if utilities.check_cli_args() is not None:
print("- Detected arguments, switching to CLI mode")