mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-21 14:40:52 +10:00
Set defaults location on r/w
This commit is contained in:
+8
-8
@@ -180,7 +180,7 @@ class wx_python_gui:
|
|||||||
threading.Thread(target=self.check_for_updates).start()
|
threading.Thread(target=self.check_for_updates).start()
|
||||||
|
|
||||||
def check_for_updates(self, event=None):
|
def check_for_updates(self, event=None):
|
||||||
ignore_updates = subprocess.run(["defaults", "read", "com.dortania.opencore-legacy-patcher", "IgnoreAppUpdates"], capture_output=True).stdout.decode("utf-8").strip()
|
ignore_updates = subprocess.run(["defaults", "read", "~/Library/Preferences/com.dortania.opencore-legacy-patcher", "IgnoreAppUpdates"], capture_output=True).stdout.decode("utf-8").strip()
|
||||||
if ignore_updates not in ["1", "True", "TRUE"]:
|
if ignore_updates not in ["1", "True", "TRUE"]:
|
||||||
self.constants.ignore_updates = False
|
self.constants.ignore_updates = False
|
||||||
dict = updates.check_binary_updates(self.constants).check_binary_updates()
|
dict = updates.check_binary_updates(self.constants).check_binary_updates()
|
||||||
@@ -202,7 +202,7 @@ class wx_python_gui:
|
|||||||
elif responce == wx.ID_NO:
|
elif responce == wx.ID_NO:
|
||||||
print("- Setting IgnoreAppUpdates to True")
|
print("- Setting IgnoreAppUpdates to True")
|
||||||
self.constants.ignore_updates = True
|
self.constants.ignore_updates = True
|
||||||
subprocess.run(["defaults", "write", "com.dortania.opencore-legacy-patcher", "IgnoreAppUpdates", "-bool", "TRUE"])
|
subprocess.run(["defaults", "write", "~/Library/Preferences/com.dortania.opencore-legacy-patcher", "IgnoreAppUpdates", "-bool", "TRUE"])
|
||||||
else:
|
else:
|
||||||
self.constants.ignore_updates = True
|
self.constants.ignore_updates = True
|
||||||
print("- Ignoring App Updates due to defaults")
|
print("- Ignoring App Updates due to defaults")
|
||||||
@@ -2403,9 +2403,9 @@ class wx_python_gui:
|
|||||||
def set_ignore_app_updates_click(self, event):
|
def set_ignore_app_updates_click(self, event):
|
||||||
self.constants.ignore_updates = self.set_ignore_app_updates_checkbox.GetValue()
|
self.constants.ignore_updates = self.set_ignore_app_updates_checkbox.GetValue()
|
||||||
if self.constants.ignore_updates is True:
|
if self.constants.ignore_updates is True:
|
||||||
subprocess.run(["defaults", "write", "com.dortania.opencore-legacy-patcher", "IgnoreAppUpdates", "-bool", "TRUE"])
|
subprocess.run(["defaults", "write", "~/Library/Preferences/com.dortania.opencore-legacy-patcher", "IgnoreAppUpdates", "-bool", "TRUE"])
|
||||||
else:
|
else:
|
||||||
subprocess.run(["defaults", "write", "com.dortania.opencore-legacy-patcher", "IgnoreAppUpdates", "-bool", "FALSE"])
|
subprocess.run(["defaults", "write", "~/Library/Preferences/com.dortania.opencore-legacy-patcher", "IgnoreAppUpdates", "-bool", "FALSE"])
|
||||||
|
|
||||||
def firewire_click(self, event=None):
|
def firewire_click(self, event=None):
|
||||||
if self.firewire_boot_checkbox.GetValue():
|
if self.firewire_boot_checkbox.GetValue():
|
||||||
@@ -2466,21 +2466,21 @@ class wx_python_gui:
|
|||||||
def ts2_accel_click(self, event=None):
|
def ts2_accel_click(self, event=None):
|
||||||
if self.set_terascale_accel_checkbox.GetValue():
|
if self.set_terascale_accel_checkbox.GetValue():
|
||||||
print("TS2 Acceleration Enabled")
|
print("TS2 Acceleration Enabled")
|
||||||
subprocess.run(["defaults", "write", "com.dortania.opencore-legacy-patcher", "MacBookPro_TeraScale_2_Accel", "-bool", "TRUE"])
|
subprocess.run(["defaults", "write", "~/Library/Preferences/com.dortania.opencore-legacy-patcher", "MacBookPro_TeraScale_2_Accel", "-bool", "TRUE"])
|
||||||
self.constants.allow_ts2_accel = True
|
self.constants.allow_ts2_accel = True
|
||||||
else:
|
else:
|
||||||
print("TS2 Acceleration Disabled")
|
print("TS2 Acceleration Disabled")
|
||||||
subprocess.run(["defaults", "write", "com.dortania.opencore-legacy-patcher", "MacBookPro_TeraScale_2_Accel", "-bool", "FALSE"])
|
subprocess.run(["defaults", "write", "~/Library/Preferences/com.dortania.opencore-legacy-patcher", "MacBookPro_TeraScale_2_Accel", "-bool", "FALSE"])
|
||||||
self.constants.allow_ts2_accel = False
|
self.constants.allow_ts2_accel = False
|
||||||
|
|
||||||
def force_web_drivers_click(self, event=None):
|
def force_web_drivers_click(self, event=None):
|
||||||
if self.force_web_drivers_checkbox.GetValue():
|
if self.force_web_drivers_checkbox.GetValue():
|
||||||
print("Force Web Drivers Enabled")
|
print("Force Web Drivers Enabled")
|
||||||
subprocess.run(["defaults", "write", "com.dortania.opencore-legacy-patcher", "Force_Web_Drivers", "-bool", "TRUE"])
|
subprocess.run(["defaults", "write", "~/Library/Preferences/com.dortania.opencore-legacy-patcher", "Force_Web_Drivers", "-bool", "TRUE"])
|
||||||
self.constants.force_nv_web = True
|
self.constants.force_nv_web = True
|
||||||
else:
|
else:
|
||||||
print("Force Web Drivers Disabled")
|
print("Force Web Drivers Disabled")
|
||||||
subprocess.run(["defaults", "write", "com.dortania.opencore-legacy-patcher", "Force_Web_Drivers", "-bool", "FALSE"])
|
subprocess.run(["defaults", "write", "~/Library/Preferences/com.dortania.opencore-legacy-patcher", "Force_Web_Drivers", "-bool", "FALSE"])
|
||||||
self.constants.force_nv_web = False
|
self.constants.force_nv_web = False
|
||||||
|
|
||||||
def windows_gmux_click(self, event=None):
|
def windows_gmux_click(self, event=None):
|
||||||
|
|||||||
@@ -589,10 +589,10 @@ handle acceleration tasks.
|
|||||||
|
|
||||||
change_menu = input("Allow TeraScale 2 Acceleration?(y/n/q): ")
|
change_menu = input("Allow TeraScale 2 Acceleration?(y/n/q): ")
|
||||||
if change_menu in {"y", "Y", "yes", "Yes"}:
|
if change_menu in {"y", "Y", "yes", "Yes"}:
|
||||||
subprocess.run(["defaults", "write", "com.dortania.opencore-legacy-patcher", "MacBookPro_TeraScale_2_Accel", "-bool", "TRUE"])
|
subprocess.run(["defaults", "write", "~/Library/Preferences/com.dortania.opencore-legacy-patcher", "MacBookPro_TeraScale_2_Accel", "-bool", "TRUE"])
|
||||||
self.constants.allow_ts2_accel = True
|
self.constants.allow_ts2_accel = True
|
||||||
elif change_menu in {"n", "N", "no", "No"}:
|
elif change_menu in {"n", "N", "no", "No"}:
|
||||||
subprocess.run(["defaults", "write", "com.dortania.opencore-legacy-patcher", "MacBookPro_TeraScale_2_Accel", "-bool", "FALSE"])
|
subprocess.run(["defaults", "write", "~/Library/Preferences/com.dortania.opencore-legacy-patcher", "MacBookPro_TeraScale_2_Accel", "-bool", "FALSE"])
|
||||||
self.constants.allow_ts2_accel = False
|
self.constants.allow_ts2_accel = False
|
||||||
elif change_menu in {"q", "Q", "Quit", "quit"}:
|
elif change_menu in {"q", "Q", "Quit", "quit"}:
|
||||||
print("Returning to previous menu")
|
print("Returning to previous menu")
|
||||||
|
|||||||
@@ -122,11 +122,11 @@ class generate_defaults:
|
|||||||
if model in ["MacBookPro8,2", "MacBookPro8,3"]:
|
if model in ["MacBookPro8,2", "MacBookPro8,3"]:
|
||||||
# Users disabling TS2 most likely have a faulty dGPU
|
# Users disabling TS2 most likely have a faulty dGPU
|
||||||
# users can override this in settings
|
# users can override this in settings
|
||||||
ts2_status = subprocess.run(["defaults", "read", "com.dortania.opencore-legacy-patcher", "MacBookPro_TeraScale_2_Accel"], stdout=subprocess.PIPE).stdout.decode("utf-8").strip()
|
ts2_status = subprocess.run(["defaults", "read", "~/Library/Preferences/com.dortania.opencore-legacy-patcher", "MacBookPro_TeraScale_2_Accel"], stdout=subprocess.PIPE).stdout.decode("utf-8").strip()
|
||||||
if ts2_status in ["1", "true"]:
|
if ts2_status in ["1", "true"]:
|
||||||
settings.allow_ts2_accel = True
|
settings.allow_ts2_accel = True
|
||||||
else:
|
else:
|
||||||
subprocess.run(["defaults", "write", "com.dortania.opencore-legacy-patcher", "MacBookPro_TeraScale_2_Accel", "-bool", "FALSE"])
|
subprocess.run(["defaults", "write", "~/Library/Preferences/com.dortania.opencore-legacy-patcher", "MacBookPro_TeraScale_2_Accel", "-bool", "FALSE"])
|
||||||
settings.allow_ts2_accel = False
|
settings.allow_ts2_accel = False
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -174,9 +174,9 @@ class generate_defaults:
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
nv_web_status = subprocess.run(["defaults", "read", "com.dortania.opencore-legacy-patcher", "Force_Web_Drivers"], stdout=subprocess.PIPE).stdout.decode("utf-8").strip()
|
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"]:
|
if nv_web_status in ["1", "true"]:
|
||||||
settings.force_nv_web = True
|
settings.force_nv_web = True
|
||||||
else:
|
else:
|
||||||
subprocess.run(["defaults", "write", "com.dortania.opencore-legacy-patcher", "Force_Web_Drivers", "-bool", "FALSE"])
|
subprocess.run(["defaults", "write", "~/Library/Preferences/com.dortania.opencore-legacy-patcher", "Force_Web_Drivers", "-bool", "FALSE"])
|
||||||
settings.force_nv_web = False
|
settings.force_nv_web = False
|
||||||
@@ -112,7 +112,7 @@ class AutomaticSysPatch:
|
|||||||
|
|
||||||
print("- Determining if macOS drive matches boot drive")
|
print("- Determining if macOS drive matches boot drive")
|
||||||
|
|
||||||
should_notify = subprocess.run(["defaults", "read", "com.dortania.opencore-legacy-patcher", "AutoPatch_Notify_Mismatched_Disks"], stdout=subprocess.PIPE).stdout.decode("utf-8").strip()
|
should_notify = subprocess.run(["defaults", "read", "~/Library/Preferences/com.dortania.opencore-legacy-patcher", "AutoPatch_Notify_Mismatched_Disks"], stdout=subprocess.PIPE).stdout.decode("utf-8").strip()
|
||||||
if should_notify in ["0", "false"]:
|
if should_notify in ["0", "false"]:
|
||||||
print("- Skipping due to user preference")
|
print("- Skipping due to user preference")
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user