From 79cf5cb86f23b52ff14c52e80f2fd3ce7eee0a26 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Mon, 22 May 2023 12:22:24 -0600 Subject: [PATCH 1/5] GUI: Add Cursor checkbox --- resources/wx_gui/gui_settings.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/resources/wx_gui/gui_settings.py b/resources/wx_gui/gui_settings.py index 1fff6e03c..dbdf4ab33 100644 --- a/resources/wx_gui/gui_settings.py +++ b/resources/wx_gui/gui_settings.py @@ -713,6 +713,16 @@ class SettingsFrame(wx.Frame): "condition": gui_support.CheckProperties(self.constants).host_is_non_metal(general_check=True) }, + "Beach Ball Cursor Workaround": { + "type": "checkbox", + "value": self._get_system_settings("Moraea.EnableSpinHack"), + "variable": "Moraea.EnableSpinHack", + "description": [ + "Note: May be more CPU intensive.", + ], + "override_function": self._update_system_defaults, + "condition": gui_support.CheckProperties(self.constants).host_is_non_metal(general_check=True) + }, "wrap_around 2": { "type": "wrap_around", }, From 1e86681d3c4457090f15fe8434838e86be6892f9 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Mon, 22 May 2023 12:23:07 -0600 Subject: [PATCH 2/5] Validation: Support root patch validation on GA --- resources/validation.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/resources/validation.py b/resources/validation.py index 8ef0b6aca..b0b8fee7c 100644 --- a/resources/validation.py +++ b/resources/validation.py @@ -4,7 +4,7 @@ from pathlib import Path from resources.sys_patch import sys_patch_helpers from resources.build import build -from resources import constants +from resources import constants, network_handler from data import example_data, model_array, sys_patch_dict, os_data @@ -134,8 +134,11 @@ class PatcherValidation: """ if not Path(self.constants.payload_local_binaries_root_path_dmg).exists(): - logging.info("- Skipping Root Patch File integrity validation") - return + dl_obj = network_handler.DownloadObject(f"https://github.com/dortania/PatcherSupportPkg/releases/download/{self.constants.patcher_support_pkg_version}/Universal-Binaries.dmg", self.constants.payload_local_binaries_root_path_dmg) + dl_obj.download(spawn_thread=False) + if dl_obj.download_complete is False: + logging.info("Failed to download Universal-Binaries.dmg") + raise Exception("Failed to download Universal-Binaries.dmg") logging.info("Validating Root Patch File integrity") output = subprocess.run( From 4c9c7965b61d828046813f5f2d4e921d92a889f1 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Mon, 22 May 2023 12:31:33 -0600 Subject: [PATCH 3/5] GUI: Add conditional to Graphics override --- resources/wx_gui/gui_settings.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/wx_gui/gui_settings.py b/resources/wx_gui/gui_settings.py index dbdf4ab33..97fd75167 100644 --- a/resources/wx_gui/gui_settings.py +++ b/resources/wx_gui/gui_settings.py @@ -229,7 +229,8 @@ class SettingsFrame(wx.Frame): """ models = [model for model in smbios_data.smbios_dictionary if "_" not in model and " " not in model and smbios_data.smbios_dictionary[model]["Board ID"] is not None] - socketed_gpu_models = ["iMac9,1", "iMac10,1", "iMac11,1", "iMac11,2", "iMac11,3", "iMac12,1", "iMac12,2", "MacPro3,1", "MacPro4,1", "MacPro5,1", "Xserve2,1", "Xserve3,1"] + socketed_imac_models = ["iMac9,1", "iMac10,1", "iMac11,1", "iMac11,2", "iMac11,3", "iMac12,1", "iMac12,2"] + socketed_gpu_models = socketed_imac_models + ["MacPro3,1", "MacPro4,1", "MacPro5,1", "Xserve2,1", "Xserve3,1"] settings = { "Build": { @@ -541,6 +542,7 @@ class SettingsFrame(wx.Frame): "Override detected/assumed GPU on", "socketed MXM-based iMacs.", ], + "condition": bool((not self.constants.custom_model and self.constants.computer.real_model in socketed_imac_models) or (self.constants.custom_model and self.constants.custom_model in socketed_imac_models)) }, "Populate Graphics Override": { "type": "populate", From 5f30adab73902470389220bdd238164138998179 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Mon, 22 May 2023 12:38:39 -0600 Subject: [PATCH 4/5] logging_handler.py: Add CLI check --- resources/constants.py | 2 +- resources/logging_handler.py | 3 +++ resources/main.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/resources/constants.py b/resources/constants.py index fd800a3a2..fa0dc916f 100644 --- a/resources/constants.py +++ b/resources/constants.py @@ -117,7 +117,7 @@ class Constants: ## Internal settings self.allow_oc_everywhere: bool = False # Set whether Patcher can be run on unsupported Macs self.gui_mode: bool = False # Determine whether running in a GUI or TUI - self.cli_mode: bool = False # Determine if running in CLI mode + self.cli_mode: bool = True # Determine if running in CLI mode self.validate: bool = False # Enable validation testing for CI self.recovery_status: bool = False # Detect if booted into RecoveryOS self.ignore_updates: bool = False # Ignore OCLP updates diff --git a/resources/logging_handler.py b/resources/logging_handler.py index cddaa85e0..88cdc2022 100644 --- a/resources/logging_handler.py +++ b/resources/logging_handler.py @@ -159,6 +159,9 @@ class InitializeLoggingSupport: """ logging.error("Uncaught exception in main thread", exc_info=(type, value, tb)) + if self.constants.cli_mode is True: + return + error_msg = f"OpenCore Legacy Patcher encountered the following internal error:\n\n" error_msg += f"{type.__name__}: {value}" if tb: diff --git a/resources/main.py b/resources/main.py index f2ab0dc38..770a68729 100644 --- a/resources/main.py +++ b/resources/main.py @@ -93,6 +93,7 @@ class OpenCoreLegacyPatcher: threading.Thread(target=analytics_handler.Analytics, args=(self.constants,)).start() if utilities.check_cli_args() is None: + self.constants.cli_mode = False logging.info(f"- No arguments present, loading {'GUI' if self.constants.wxpython_variant is True else 'TUI'} mode") return @@ -102,7 +103,6 @@ class OpenCoreLegacyPatcher: ignore_args = ["--auto_patch", "--gui_patch", "--gui_unpatch", "--update_installed"] if not any(x in sys.argv for x in ignore_args): self.constants.current_path = Path.cwd() - self.constants.cli_mode = True if getattr(sys, "frozen", False) and hasattr(sys, "_MEIPASS"): logging.info("- Rerouting payloads location") self.constants.payload_path = sys._MEIPASS / Path("payloads") From ba5dd162014ef357ba875a435359b78ec1e88dac Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Mon, 22 May 2023 13:09:40 -0600 Subject: [PATCH 5/5] Sync PatcherSupportPkg --- CHANGELOG.md | 2 +- resources/constants.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e350d6361..9dbcd291d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,7 +47,7 @@ - Resolve exception handler not logging to file - Display raised exceptions from main thread to users - Increment Binaries: - - PatcherSupportPkg 1.0.2 - release + - PatcherSupportPkg 1.1.0 - release - OpenCorePkg 0.9.2 - release - Lilu 1.6.6 - rolling (d8f3782) - RestrictEvents 1.1.1 - release diff --git a/resources/constants.py b/resources/constants.py index fa0dc916f..ad2d12e61 100644 --- a/resources/constants.py +++ b/resources/constants.py @@ -13,7 +13,7 @@ class Constants: def __init__(self) -> None: # Patcher Versioning self.patcher_version: str = "0.6.6" # OpenCore-Legacy-Patcher - self.patcher_support_pkg_version: str = "1.0.2" # PatcherSupportPkg + self.patcher_support_pkg_version: str = "1.1.0" # PatcherSupportPkg self.copyright_date: str = "Copyright © 2020-2023 Dortania" self.patcher_name: str = "OpenCore Legacy Patcher"