mirror of
https://github.com/onionshare/onionshare.git
synced 2025-08-02 11:26:16 -04:00
Refactor ReceiveMode and Downloads, to push more download-related logic into Downloads
This commit is contained in:
parent
ed28fdf123
commit
30c9f50d2e
2 changed files with 20 additions and 25 deletions
|
@ -131,11 +131,17 @@ class Downloads(QtWidgets.QWidget):
|
|||
"""
|
||||
Add a new download progress bar.
|
||||
"""
|
||||
# add it to the list
|
||||
# Hide the no_downloads_label
|
||||
self.no_downloads_label.hide()
|
||||
|
||||
# Add it to the list
|
||||
download = Download(self.common, download_id, total_bytes)
|
||||
self.downloads[download_id] = download
|
||||
self.downloads_layout.addWidget(download.progress_bar)
|
||||
|
||||
# Scroll to the bottom
|
||||
self.downloads_container.vbar.setValue(self.downloads_container.vbar.maximum())
|
||||
|
||||
def update_download(self, download_id, downloaded_bytes):
|
||||
"""
|
||||
Update the progress of a download progress bar.
|
||||
|
@ -156,3 +162,6 @@ class Downloads(QtWidgets.QWidget):
|
|||
self.downloads_layout.removeWidget(download.progress_bar)
|
||||
download.progress_bar.close()
|
||||
self.downloads = {}
|
||||
|
||||
self.no_downloads_label.show()
|
||||
self.downloads_container.resize(self.downloads_container.sizeHint())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue