From 910ab09dbd8ccc29782df469075d9a2b53b84b7f Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Tue, 27 Sep 2022 18:53:30 -0600 Subject: [PATCH] gui_main.py: Add LV and AMFI patch configuration --- gui/gui_main.py | 44 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/gui/gui_main.py b/gui/gui_main.py index 8f1992a97..e8a7b8c6b 100644 --- a/gui/gui_main.py +++ b/gui/gui_main.py @@ -2543,16 +2543,36 @@ class wx_python_gui: if self.computer.third_party_sata_ssd is False and not self.constants.custom_model: self.set_enhanced_3rd_party_ssd_checkbox.Disable() + # Disable Library Validation + self.disable_library_validation_checkbox = wx.CheckBox(self.frame_modal, label="Disable Library Validation") + self.disable_library_validation_checkbox.SetValue(self.constants.disable_cs_lv) + self.disable_library_validation_checkbox.Bind(wx.EVT_CHECKBOX, self.disable_library_validation_click) + self.disable_library_validation_checkbox.SetPosition(wx.Point( + self.set_enhanced_3rd_party_ssd_checkbox.GetPosition().x, + self.set_enhanced_3rd_party_ssd_checkbox.GetPosition().y + self.set_enhanced_3rd_party_ssd_checkbox.GetSize().height + )) + + # Disable AMFI + self.disable_amfi_checkbox = wx.CheckBox(self.frame_modal, label="Disable AMFI") + self.disable_amfi_checkbox.SetValue(self.constants.disable_amfi) + self.disable_amfi_checkbox.Bind(wx.EVT_CHECKBOX, self.disable_amfi_click) + self.disable_amfi_checkbox.SetPosition(wx.Point( + self.disable_library_validation_checkbox.GetPosition().x, + self.disable_library_validation_checkbox.GetPosition().y + self.disable_library_validation_checkbox.GetSize().height + )) + if self.constants.disable_cs_lv is False: + self.disable_amfi_checkbox.Disable() + + # Set Ignore App Updates self.set_ignore_app_updates_checkbox = wx.CheckBox(self.frame_modal, label="Ignore App Updates") self.set_ignore_app_updates_checkbox.SetValue(self.constants.ignore_updates) self.set_ignore_app_updates_checkbox.Bind(wx.EVT_CHECKBOX, self.set_ignore_app_updates_click) self.set_ignore_app_updates_checkbox.SetPosition(wx.Point( - self.set_enhanced_3rd_party_ssd_checkbox.GetPosition().x, - self.set_enhanced_3rd_party_ssd_checkbox.GetPosition().y + self.set_enhanced_3rd_party_ssd_checkbox.GetSize().height)) + self.disable_amfi_checkbox.GetPosition().x, + self.disable_amfi_checkbox.GetPosition().y + self.disable_amfi_checkbox.GetSize().height)) self.set_ignore_app_updates_checkbox.SetToolTip(wx.ToolTip("This will set whether OpenCore will ignore App Updates on launch.\nEnable this option if you do not want to be prompted for App Updates")) - # Button: Developer Debug Info self.debug_button = wx.Button(self.frame_modal, label="Developer Debug Info") self.debug_button.Bind(wx.EVT_BUTTON, self.additional_info_menu) @@ -2574,6 +2594,24 @@ class wx_python_gui: self.frame_modal.SetSize(wx.Size(-1, self.return_to_main_menu_button.GetPosition().y + self.return_to_main_menu_button.GetSize().height + 40)) self.frame_modal.ShowWindowModal() + def disable_library_validation_click(self, event): + if self.disable_library_validation_checkbox.GetValue(): + print("Disable Library Validation") + self.disable_amfi_checkbox.Enable() + self.constants.disable_cs_lv = True + else: + print("Enable Library Validation") + self.disable_amfi_checkbox.Disable() + self.constants.disable_cs_lv = False + + def disable_amfi_click(self, event): + if self.disable_amfi_checkbox.GetValue(): + print("Disable AMFI") + self.constants.disable_amfi = True + else: + print("Enable AMFI") + self.constants.disable_amfi = False + def set_ignore_app_updates_click(self, event): self.constants.ignore_updates = self.set_ignore_app_updates_checkbox.GetValue() if self.constants.ignore_updates is True: