mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-23 19:40:15 +10:00
Changes
This commit is contained in:
@@ -60,8 +60,8 @@ def seconds_to_readable_time(seconds) -> str:
|
|||||||
seconds = int(seconds)
|
seconds = int(seconds)
|
||||||
time = ""
|
time = ""
|
||||||
|
|
||||||
if seconds == 0:
|
if seconds < 60:
|
||||||
return "0m "
|
return "Less than a minute "
|
||||||
if seconds < 0:
|
if seconds < 0:
|
||||||
return "Indeterminate time "
|
return "Indeterminate time "
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class DownloadFrame(wx.Frame):
|
|||||||
title_label.SetFont(gui_support.font_factory(19, wx.FONTWEIGHT_BOLD))
|
title_label.SetFont(gui_support.font_factory(19, wx.FONTWEIGHT_BOLD))
|
||||||
title_label.Centre(wx.HORIZONTAL)
|
title_label.Centre(wx.HORIZONTAL)
|
||||||
|
|
||||||
progress_bar = wx.Gauge(frame, range=100, pos=(-1, title_label.GetPosition()[1] + title_label.GetSize()[1] + 5), size=(300, 20))
|
progress_bar = wx.Gauge(frame, range=100, pos=(-1, title_label.GetPosition()[1] + title_label.GetSize()[1] + 5), size=(300, 20), style=wx.GA_SMOOTH|wx.GA_PROGRESS)
|
||||||
progress_bar.Centre(wx.HORIZONTAL)
|
progress_bar.Centre(wx.HORIZONTAL)
|
||||||
|
|
||||||
label_amount = wx.StaticText(frame, label="Preparing download", pos=(-1, progress_bar.GetPosition()[1] + progress_bar.GetSize()[1]))
|
label_amount = wx.StaticText(frame, label="Preparing download", pos=(-1, progress_bar.GetPosition()[1] + progress_bar.GetSize()[1]))
|
||||||
@@ -68,7 +68,11 @@ class DownloadFrame(wx.Frame):
|
|||||||
self.download_obj.download()
|
self.download_obj.download()
|
||||||
while self.download_obj.is_active():
|
while self.download_obj.is_active():
|
||||||
|
|
||||||
percentage: int = self.download_obj.get_percent()
|
percentage: int = round(self.download_obj.get_percent())
|
||||||
|
if percentage == 0:
|
||||||
|
percentage = 1
|
||||||
|
|
||||||
|
logging.info(f"Download progress: {percentage}%")
|
||||||
|
|
||||||
if percentage == -1:
|
if percentage == -1:
|
||||||
amount_str = f"{utilities.human_fmt(self.download_obj.downloaded_file_size)} downloaded ({utilities.human_fmt(self.download_obj.get_speed())}/s)"
|
amount_str = f"{utilities.human_fmt(self.download_obj.downloaded_file_size)} downloaded ({utilities.human_fmt(self.download_obj.get_speed())}/s)"
|
||||||
|
|||||||
@@ -402,6 +402,7 @@ class MainFrame(wx.Frame):
|
|||||||
sizer.Add(buttonsizer, 0, wx.ALIGN_RIGHT | wx.ALL, 20)
|
sizer.Add(buttonsizer, 0, wx.ALIGN_RIGHT | wx.ALL, 20)
|
||||||
panel.SetSizer(sizer)
|
panel.SetSizer(sizer)
|
||||||
frame.Show()
|
frame.Show()
|
||||||
|
frame.Centre()
|
||||||
|
|
||||||
def _onWebviewNav(self, event):
|
def _onWebviewNav(self, event):
|
||||||
url = event.GetURL()
|
url = event.GetURL()
|
||||||
|
|||||||
Reference in New Issue
Block a user