From 56e5c8b90879d7c7053e506fe9d913736717539a Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Tue, 9 Oct 2018 22:21:03 -0700 Subject: [PATCH] Add "download started" date/time to download history progress bars --- onionshare_gui/mode/history.py | 7 +++++-- share/locale/en.json | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/onionshare_gui/mode/history.py b/onionshare_gui/mode/history.py index cf944aa0..8cfa0ed5 100644 --- a/onionshare_gui/mode/history.py +++ b/onionshare_gui/mode/history.py @@ -50,11 +50,13 @@ class DownloadHistoryItem(HistoryItem): self.common = common self.id = id - self.started = time.time() self.total_bytes = total_bytes self.downloaded_bytes = 0 + self.started = time.time() + self.started_dt = datetime.fromtimestamp(self.started) - self.setStyleSheet('QWidget { border: 1px solid red; }') + # Label + self.label = QtWidgets.QLabel(strings._('gui_download_in_progress').format(self.started_dt.strftime("%b %d, %I:%M%p"))) # Progress bar self.progress_bar = QtWidgets.QProgressBar() @@ -69,6 +71,7 @@ class DownloadHistoryItem(HistoryItem): # Layout layout = QtWidgets.QVBoxLayout() + layout.addWidget(self.label) layout.addWidget(self.progress_bar) self.setLayout(layout) diff --git a/share/locale/en.json b/share/locale/en.json index 3537b0a2..e5d9a3be 100644 --- a/share/locale/en.json +++ b/share/locale/en.json @@ -180,5 +180,6 @@ "gui_upload_in_progress": "Upload Started {}", "gui_upload_finished_range": "Uploaded {} to {}", "gui_upload_finished": "Uploaded {}", + "gui_download_in_progress": "Download Started {}", "gui_open_folder_error_nautilus": "Cannot open folder because nautilus is not available. The file is here: {}" }