From b92daff30ea46701195566c488b15f666acb4ca2 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sun, 11 Jun 2023 12:55:59 -0600 Subject: [PATCH] GUI: Adjust default selection to latest non-Beta --- resources/wx_gui/gui_macos_installer_download.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/resources/wx_gui/gui_macos_installer_download.py b/resources/wx_gui/gui_macos_installer_download.py index 483b7f9ac..0145997c5 100644 --- a/resources/wx_gui/gui_macos_installer_download.py +++ b/resources/wx_gui/gui_macos_installer_download.py @@ -151,10 +151,14 @@ class macOSInstallerDownloadFrame(wx.Frame): installer_button.Centre(wx.HORIZONTAL) spacer += 25 - # Since installers are sorted by version, set the latest installer as the default button - # Note that on full display, the last installer is generally a beta - if show_full is False and app == list(installers.keys())[-1]: - installer_button.SetDefault() + # Since installers are sorted by version, set the latest installer as the default button + # Note that on full display, the last installer is generally a beta + for button in reversed(dialog.GetChildren()): + if not isinstance(button, wx.Button): + continue + if "Beta" not in button.GetLabel(): + button.SetDefault() + break else: logging.error("No installers found on SUCatalog") installer_button = wx.StaticText(dialog, label="Failed to fetch catalog from Apple", pos=(-1, subtitle_label.GetPosition()[1] + subtitle_label.GetSize()[1] + 5))