This commit is contained in:
Jazzzny
2023-09-29 17:51:51 -04:00
parent 25f5ea2457
commit ce0928ba38
3 changed files with 9 additions and 4 deletions

View File

@@ -60,8 +60,8 @@ def seconds_to_readable_time(seconds) -> str:
seconds = int(seconds)
time = ""
if seconds == 0:
return "0m "
if seconds < 60:
return "Less than a minute "
if seconds < 0:
return "Indeterminate time "

View File

@@ -50,7 +50,7 @@ class DownloadFrame(wx.Frame):
title_label.SetFont(gui_support.font_factory(19, wx.FONTWEIGHT_BOLD))
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)
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()
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:
amount_str = f"{utilities.human_fmt(self.download_obj.downloaded_file_size)} downloaded ({utilities.human_fmt(self.download_obj.get_speed())}/s)"

View File

@@ -402,6 +402,7 @@ class MainFrame(wx.Frame):
sizer.Add(buttonsizer, 0, wx.ALIGN_RIGHT | wx.ALL, 20)
panel.SetSizer(sizer)
frame.Show()
frame.Centre()
def _onWebviewNav(self, event):
url = event.GetURL()