From 422283a3ac76f7d733a8b551bda5a44416db77e1 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sat, 13 May 2023 09:52:28 -0600 Subject: [PATCH] GUI: Add extra padding for pre-Big Sur UI --- resources/wx_gui/gui_install_oc.py | 10 ++++++++-- resources/wx_gui/gui_macos_installer_download.py | 2 +- resources/wx_gui/gui_macos_installer_flash.py | 11 +++++++++-- resources/wx_gui/gui_support.py | 4 ++-- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/resources/wx_gui/gui_install_oc.py b/resources/wx_gui/gui_install_oc.py index e5cc8aabf..c7174fb2e 100644 --- a/resources/wx_gui/gui_install_oc.py +++ b/resources/wx_gui/gui_install_oc.py @@ -71,6 +71,12 @@ class InstallOCFrame(wx.Frame): """ self.available_disks = install.tui_disk_installation(self.constants).list_disks() + # Need to clean up output on pre-Sierra + # Disk images are mixed in with regular disks (ex. payloads.dmg) + for disk in self.available_disks.copy(): + if "read-only" in self.available_disks[disk]['name']: + del self.available_disks[disk] + def _display_disks(self) -> None: """ @@ -143,12 +149,12 @@ class InstallOCFrame(wx.Frame): disk_label.Center(wx.HORIZONTAL) # Add button: Search for disks again - search_button = wx.Button(dialog, label="Search for disks again", size=(150,30), pos=(-1, disk_label.GetPosition()[1] + disk_label.GetSize()[1] + 5)) + search_button = wx.Button(dialog, label="Search for disks again", size=(160,30), pos=(-1, disk_label.GetPosition()[1] + disk_label.GetSize()[1] + 5)) search_button.Center(wx.HORIZONTAL) search_button.Bind(wx.EVT_BUTTON, self.on_reload_frame) # Add button: Return to main menu - return_button = wx.Button(dialog, label="Return to main menu", size=(150,30), pos=(-1, search_button.GetPosition()[1] + 20)) + return_button = wx.Button(dialog, label="Return to main menu", size=(160,30), pos=(-1, search_button.GetPosition()[1] + 20)) return_button.Center(wx.HORIZONTAL) return_button.Bind(wx.EVT_BUTTON, self.on_return_to_main_menu) diff --git a/resources/wx_gui/gui_macos_installer_download.py b/resources/wx_gui/gui_macos_installer_download.py index 1b86b6c4f..31eeac4d0 100644 --- a/resources/wx_gui/gui_macos_installer_download.py +++ b/resources/wx_gui/gui_macos_installer_download.py @@ -139,7 +139,7 @@ class macOSInstallerFrame(wx.Frame): installer_button.SetDefault() # Show all available installers - show_all_button = wx.Button(dialog, label="Show all available installers" if show_full is False else "Show only latest installers", pos=(-1, installer_button.GetPosition()[1] + installer_button.GetSize()[1]), size=(180, 30)) + show_all_button = wx.Button(dialog, label="Show all available installers" if show_full is False else "Show only latest installers", pos=(-1, installer_button.GetPosition()[1] + installer_button.GetSize()[1]), size=(200, 30)) show_all_button.Bind(wx.EVT_BUTTON, lambda event: self._display_available_installers(event, not show_full)) show_all_button.Center(wx.HORIZONTAL) diff --git a/resources/wx_gui/gui_macos_installer_flash.py b/resources/wx_gui/gui_macos_installer_flash.py index 0cd5116ba..601e9b3c1 100644 --- a/resources/wx_gui/gui_macos_installer_flash.py +++ b/resources/wx_gui/gui_macos_installer_flash.py @@ -141,6 +141,13 @@ class macOSInstallerFlashFrame(wx.Frame): def fetch_disks(): self.available_disks = macos_installer_handler.InstallerCreation().list_disk_to_format() + # Need to clean up output on pre-Sierra + # Disk images are mixed in with regular disks (ex. payloads.dmg) + for disk in self.available_disks.copy(): + if "read-only" in self.available_disks[disk]['name']: + del self.available_disks[disk] + + thread = threading.Thread(target=fetch_disks) thread.start() @@ -177,12 +184,12 @@ class macOSInstallerFlashFrame(wx.Frame): disk_button.Center(wx.HORIZONTAL) # Search for disks again - search_button = wx.Button(self.frame_modal, label="Search for disks again", pos=(-1, disk_button.GetPosition()[1] + disk_button.GetSize()[1]), size=(150, 30)) + search_button = wx.Button(self.frame_modal, label="Search for disks again", pos=(-1, disk_button.GetPosition()[1] + disk_button.GetSize()[1]), size=(160, 30)) search_button.Bind(wx.EVT_BUTTON, self.on_select) search_button.Center(wx.HORIZONTAL) # Button: Return to Main Menu - cancel_button = wx.Button(self.frame_modal, label="Return to Main Menu", pos=(-1, search_button.GetPosition()[1] + search_button.GetSize()[1] - 10), size=(150, 30)) + cancel_button = wx.Button(self.frame_modal, label="Return to Main Menu", pos=(-1, search_button.GetPosition()[1] + search_button.GetSize()[1] - 10), size=(160, 30)) cancel_button.Bind(wx.EVT_BUTTON, self.on_return_to_main_menu) cancel_button.Center(wx.HORIZONTAL) diff --git a/resources/wx_gui/gui_support.py b/resources/wx_gui/gui_support.py index 2fe0ece1d..192635867 100644 --- a/resources/wx_gui/gui_support.py +++ b/resources/wx_gui/gui_support.py @@ -84,12 +84,12 @@ class CheckProperties: """ Check if host supports building OpenCore configs """ + if self.constants.custom_model: + return True if self.constants.host_is_hackintosh is True: return False if self.constants.allow_oc_everywhere is True: return True - if self.constants.custom_model: - return True if self.constants.computer.real_model in model_array.SupportedSMBIOS: return True