mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-20 10:44:32 +10:00
Strip unused functions
This commit is contained in:
@@ -17,7 +17,7 @@ class OpenCoreLegacyPatcher:
|
||||
self.constants = constants.Constants()
|
||||
self.generate_base_data()
|
||||
if utilities.check_cli_args() is None:
|
||||
self.main_menu(False)
|
||||
self.main_menu()
|
||||
|
||||
def generate_base_data(self):
|
||||
self.constants.detected_os = os_probe.detect_kernel_major()
|
||||
@@ -37,33 +37,8 @@ class OpenCoreLegacyPatcher:
|
||||
arguments.arguments().parse_arguments(self.constants)
|
||||
else:
|
||||
print("- No arguments present, loading TUI")
|
||||
|
||||
def first_setup(self):
|
||||
# Order of operations:
|
||||
# 1. Build OpenCore
|
||||
# 2. Download macOS
|
||||
# 3. Select USB drive
|
||||
# 4. Format USB drive
|
||||
# 5. Install OpenCore to ESP
|
||||
# 6. flash macOS
|
||||
# 7. Prompt user to reboot
|
||||
self.constants.walkthrough = True
|
||||
build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).build_opencore()
|
||||
cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).download_macOS()
|
||||
|
||||
|
||||
def post_install(self):
|
||||
# Order of operations:
|
||||
# 1. Build OpenCore
|
||||
# 2. Prompt drive to install OC to
|
||||
# 3. Install OpenCore to ESP
|
||||
# 4. Determine whether root patching needed
|
||||
# 5. Prompt user to reboot
|
||||
build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).build_opencore()
|
||||
install.tui_disk_installation(self.constants).copy_efi()
|
||||
cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).PatchVolume
|
||||
|
||||
def main_menu(self, walkthrough):
|
||||
def main_menu(self):
|
||||
response = None
|
||||
while not (response and response == -1):
|
||||
title = [
|
||||
@@ -92,31 +67,18 @@ class OpenCoreLegacyPatcher:
|
||||
|
||||
menu = utilities.TUIMenu(title, "Please select an option: ", in_between=in_between, auto_number=True, top_level=True)
|
||||
|
||||
if walkthrough is True:
|
||||
options = (
|
||||
[["First Time Setup", self.first_setup]]
|
||||
if ((self.constants.custom_model or self.computer.real_model) in model_array.SupportedSMBIOS) or self.constants.allow_oc_everywhere is True
|
||||
else []
|
||||
) + [
|
||||
#["Post-Installation setup", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).closing_message],
|
||||
["Change Model", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).change_model],
|
||||
["Patcher Settings", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).patcher_settings],
|
||||
["Credits", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).credits],
|
||||
["Legacy Menu", lambda: self.main_menu(False)],
|
||||
]
|
||||
else:
|
||||
options = (
|
||||
[["Build OpenCore", build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).build_opencore]]
|
||||
if ((self.constants.custom_model or self.computer.real_model) in model_array.SupportedSMBIOS) or self.constants.allow_oc_everywhere is True
|
||||
else []
|
||||
) + [
|
||||
["Install OpenCore to USB/internal drive", install.tui_disk_installation(self.constants).copy_efi],
|
||||
["Post-Install Volume Patch", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).PatchVolume],
|
||||
["Change Model", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).change_model],
|
||||
["Patcher Settings", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).patcher_settings],
|
||||
["Installer Creation", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).download_macOS],
|
||||
["Credits", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).credits],
|
||||
]
|
||||
options = (
|
||||
[["Build OpenCore", build.BuildOpenCore(self.constants.custom_model or self.constants.computer.real_model, self.constants).build_opencore]]
|
||||
if ((self.constants.custom_model or self.computer.real_model) in model_array.SupportedSMBIOS) or self.constants.allow_oc_everywhere is True
|
||||
else []
|
||||
) + [
|
||||
["Install OpenCore to USB/internal drive", install.tui_disk_installation(self.constants).copy_efi],
|
||||
["Post-Install Volume Patch", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).PatchVolume],
|
||||
["Change Model", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).change_model],
|
||||
["Patcher Settings", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).patcher_settings],
|
||||
["Installer Creation", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).download_macOS],
|
||||
["Credits", cli_menu.MenuOptions(self.constants.custom_model or self.computer.real_model, self.constants).credits],
|
||||
]
|
||||
|
||||
for option in options:
|
||||
menu.add_menu_option(option[0], function=option[1])
|
||||
|
||||
Reference in New Issue
Block a user