From de81447b8f084037ba0dc2bff69982a9aef64000 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Tue, 30 Jun 2020 13:40:26 +1000 Subject: [PATCH] Set the maximum for the individual file history item to MB to avoid > 2GB crash --- onionshare_gui/tab/mode/history.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/onionshare_gui/tab/mode/history.py b/onionshare_gui/tab/mode/history.py index 1497813d..f445efa6 100644 --- a/onionshare_gui/tab/mode/history.py +++ b/onionshare_gui/tab/mode/history.py @@ -453,7 +453,7 @@ class IndividualFileHistoryItem(HistoryItem): else: self.total_bytes = data["filesize"] self.progress_bar.setMinimum(0) - self.progress_bar.setMaximum(data["filesize"]) + self.progress_bar.setMaximum(data["filesize"] / 1024) self.progress_bar.total_bytes = data["filesize"] # Start at 0 @@ -462,7 +462,7 @@ class IndividualFileHistoryItem(HistoryItem): def update(self, downloaded_bytes): self.downloaded_bytes = downloaded_bytes - self.progress_bar.setValue(downloaded_bytes) + self.progress_bar.setValue(downloaded_bytes / 1024) if (downloaded_bytes / 1024 ) == (self.progress_bar.total_bytes / 1024): self.status_code_label.setText("200") self.status_code_label.setStyleSheet(