mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-19 13:50:00 +10:00
GUI: Wait for payloads.dmg mount
This commit is contained in:
@@ -6,14 +6,43 @@ import logging
|
||||
|
||||
import subprocess
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from resources import constants
|
||||
|
||||
class PayloadMount:
|
||||
|
||||
def __init__(self, global_constants: constants.Constants, frame: wx.Frame) -> None:
|
||||
self.constants: constants.Constants = global_constants
|
||||
self.frame: wx.Frame = frame
|
||||
|
||||
|
||||
def is_unpack_finished(self):
|
||||
if self.constants.unpack_thread.is_alive():
|
||||
return False
|
||||
|
||||
if Path(self.constants.payload_kexts_path).exists():
|
||||
return True
|
||||
|
||||
# Raise error to end program
|
||||
popup = wx.MessageDialog(
|
||||
self.frame,
|
||||
f"During unpacking of our internal files, we seemed to have encountered an error.\n\nIf you keep seeing this error, please try rebooting and redownloading the application.",
|
||||
"Internal Error occurred!",
|
||||
style = wx.OK | wx.ICON_EXCLAMATION
|
||||
)
|
||||
popup.ShowModal()
|
||||
self.frame.Freeze()
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
class ThreadHandler(logging.Handler):
|
||||
|
||||
def __init__(self, text_box: wx.TextCtrl):
|
||||
logging.Handler.__init__(self)
|
||||
self.text_box = text_box
|
||||
|
||||
|
||||
def emit(self, record):
|
||||
wx.CallAfter(self.text_box.AppendText, self.format(record) + '\n')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user