Make ReceiveMode start using Uploads

This commit is contained in:
Micah Lee 2018-05-07 15:44:04 -07:00
parent a0db6d0ee7
commit 23821ebae6
No known key found for this signature in database
GPG key ID: 403C2657CD994F73
3 changed files with 29 additions and 23 deletions

View file

@ -87,15 +87,6 @@ class ReceiveMode(Mode):
self.layout.insertWidget(0, self.receive_info)
self.layout.insertWidget(0, self.info_widget)
def timer_callback_custom(self):
"""
This method is called regularly on a timer while share mode is active.
"""
# Scroll to the bottom of the download progress bar log pane if a new download has been added
#if self.new_download:
# self.downloads.downloads_container.vbar.setValue(self.downloads.downloads_container.vbar.maximum())
# self.new_download = False
def get_stop_server_shutdown_timeout_text(self):
"""
Return the string to put on the stop server button, if there's a shutdown timeout
@ -116,9 +107,8 @@ class ReceiveMode(Mode):
# Reset web counters
self.web.error404_count = 0
# Hide and reset the downloads if we have previously shared
#self.downloads.reset_downloads()
#self.reset_info_counters()
# Hide and reset the uploads if we have previously shared
self.reset_info_counters()
def start_server_step2_custom(self):
"""
@ -141,6 +131,17 @@ class ReceiveMode(Mode):
self.stop_server()
self.system_tray.showMessage(strings._('systray_close_server_title', True), strings._('systray_close_server_message', True))
def reset_info_counters(self):
"""
Set the info counters back to zero.
"""
self.uploads_completed = 0
self.uploads_in_progress = 0
self.update_uploads_completed()
self.update_uploads_in_progress()
self.info_show_uploads.setIcon(QtGui.QIcon(self.common.get_resource_path('images/upload_window_gray.png')))
self.uploads.reset()
def update_uploads_completed(self):
"""
Update the 'Downloads completed' info widget.

View file

@ -21,6 +21,7 @@ from PyQt5 import QtCore, QtWidgets, QtGui
from onionshare import strings
class Uploads(QtWidgets.QScrollArea):
"""
The uploads chunk of the GUI. This lists all of the active upload
@ -55,3 +56,9 @@ class Uploads(QtWidgets.QScrollArea):
layout.addStretch()
widget.setLayout(layout)
self.setWidget(widget)
def reset(self):
"""
Reset the uploads back to zero
"""
pass