mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
Rename Downloads method names to remove the word "download"
This commit is contained in:
parent
be36f3a4b6
commit
a0db6d0ee7
@ -239,7 +239,7 @@ class ShareMode(Mode):
|
|||||||
"""
|
"""
|
||||||
Handle REQUEST_DOWNLOAD event.
|
Handle REQUEST_DOWNLOAD event.
|
||||||
"""
|
"""
|
||||||
self.downloads.add_download(event["data"]["id"], self.web.zip_filesize)
|
self.downloads.add(event["data"]["id"], self.web.zip_filesize)
|
||||||
self.downloads_in_progress += 1
|
self.downloads_in_progress += 1
|
||||||
self.update_downloads_in_progress()
|
self.update_downloads_in_progress()
|
||||||
|
|
||||||
@ -249,7 +249,7 @@ class ShareMode(Mode):
|
|||||||
"""
|
"""
|
||||||
Handle REQUEST_PROGRESS event.
|
Handle REQUEST_PROGRESS event.
|
||||||
"""
|
"""
|
||||||
self.downloads.update_download(event["data"]["id"], event["data"]["bytes"])
|
self.downloads.update(event["data"]["id"], event["data"]["bytes"])
|
||||||
|
|
||||||
# Is the download complete?
|
# Is the download complete?
|
||||||
if event["data"]["bytes"] == self.web.zip_filesize:
|
if event["data"]["bytes"] == self.web.zip_filesize:
|
||||||
@ -269,7 +269,7 @@ class ShareMode(Mode):
|
|||||||
self.server_status_label.setText(strings._('closing_automatically', True))
|
self.server_status_label.setText(strings._('closing_automatically', True))
|
||||||
else:
|
else:
|
||||||
if self.server_status.status == self.server_status.STATUS_STOPPED:
|
if self.server_status.status == self.server_status.STATUS_STOPPED:
|
||||||
self.downloads.cancel_download(event["data"]["id"])
|
self.downloads.cancel(event["data"]["id"])
|
||||||
self.downloads_in_progress = 0
|
self.downloads_in_progress = 0
|
||||||
self.update_downloads_in_progress()
|
self.update_downloads_in_progress()
|
||||||
|
|
||||||
@ -277,7 +277,7 @@ class ShareMode(Mode):
|
|||||||
"""
|
"""
|
||||||
Handle REQUEST_CANCELED event.
|
Handle REQUEST_CANCELED event.
|
||||||
"""
|
"""
|
||||||
self.downloads.cancel_download(event["data"]["id"])
|
self.downloads.cancel(event["data"]["id"])
|
||||||
|
|
||||||
# Update the 'in progress downloads' info
|
# Update the 'in progress downloads' info
|
||||||
self.downloads_in_progress -= 1
|
self.downloads_in_progress -= 1
|
||||||
@ -338,7 +338,7 @@ class ShareMode(Mode):
|
|||||||
self.update_downloads_completed()
|
self.update_downloads_completed()
|
||||||
self.update_downloads_in_progress()
|
self.update_downloads_in_progress()
|
||||||
self.info_show_downloads.setIcon(QtGui.QIcon(self.common.get_resource_path('images/download_window_gray.png')))
|
self.info_show_downloads.setIcon(QtGui.QIcon(self.common.get_resource_path('images/download_window_gray.png')))
|
||||||
self.downloads.reset_downloads()
|
self.downloads.reset()
|
||||||
|
|
||||||
def update_downloads_completed(self):
|
def update_downloads_completed(self):
|
||||||
"""
|
"""
|
||||||
|
@ -126,7 +126,7 @@ class Downloads(QtWidgets.QScrollArea):
|
|||||||
widget.setLayout(layout)
|
widget.setLayout(layout)
|
||||||
self.setWidget(widget)
|
self.setWidget(widget)
|
||||||
|
|
||||||
def add_download(self, download_id, total_bytes):
|
def add(self, download_id, total_bytes):
|
||||||
"""
|
"""
|
||||||
Add a new download progress bar.
|
Add a new download progress bar.
|
||||||
"""
|
"""
|
||||||
@ -141,19 +141,19 @@ class Downloads(QtWidgets.QScrollArea):
|
|||||||
# Scroll to the bottom
|
# Scroll to the bottom
|
||||||
self.vbar.setValue(self.vbar.maximum())
|
self.vbar.setValue(self.vbar.maximum())
|
||||||
|
|
||||||
def update_download(self, download_id, downloaded_bytes):
|
def update(self, download_id, downloaded_bytes):
|
||||||
"""
|
"""
|
||||||
Update the progress of a download progress bar.
|
Update the progress of a download progress bar.
|
||||||
"""
|
"""
|
||||||
self.downloads[download_id].update(downloaded_bytes)
|
self.downloads[download_id].update(downloaded_bytes)
|
||||||
|
|
||||||
def cancel_download(self, download_id):
|
def cancel(self, download_id):
|
||||||
"""
|
"""
|
||||||
Update a download progress bar to show that it has been canceled.
|
Update a download progress bar to show that it has been canceled.
|
||||||
"""
|
"""
|
||||||
self.downloads[download_id].cancel()
|
self.downloads[download_id].cancel()
|
||||||
|
|
||||||
def reset_downloads(self):
|
def reset(self):
|
||||||
"""
|
"""
|
||||||
Reset the downloads back to zero
|
Reset the downloads back to zero
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user