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

@ -23,7 +23,6 @@ from PyQt5 import QtCore, QtWidgets, QtGui
from onionshare import strings
class Download(object):
def __init__(self, common, download_id, total_bytes):
self.common = common
@ -33,7 +32,14 @@ class Download(object):
self.downloaded_bytes = 0
# make a new progress bar
cssStyleData ="""
self.progress_bar = QtWidgets.QProgressBar()
self.progress_bar.setTextVisible(True)
self.progress_bar.setAttribute(QtCore.Qt.WA_DeleteOnClose)
self.progress_bar.setAlignment(QtCore.Qt.AlignHCenter)
self.progress_bar.setMinimum(0)
self.progress_bar.setMaximum(total_bytes)
self.progress_bar.setValue(0)
self.progress_bar.setStyleSheet("""
QProgressBar {
border: 1px solid #4e064f;
background-color: #ffffff !important;
@ -45,15 +51,7 @@ class Download(object):
QProgressBar::chunk {
background-color: #4e064f;
width: 10px;
}"""
self.progress_bar = QtWidgets.QProgressBar()
self.progress_bar.setTextVisible(True)
self.progress_bar.setAttribute(QtCore.Qt.WA_DeleteOnClose)
self.progress_bar.setAlignment(QtCore.Qt.AlignHCenter)
self.progress_bar.setMinimum(0)
self.progress_bar.setMaximum(total_bytes)
self.progress_bar.setValue(0)
self.progress_bar.setStyleSheet(cssStyleData)
}""")
self.progress_bar.total_bytes = total_bytes
# start at 0