mirror of
https://github.com/onionshare/onionshare.git
synced 2025-02-06 01:45:30 -05:00
reorganize, add comment
This commit is contained in:
parent
b1dd45a94b
commit
d0f085f756
@ -56,7 +56,7 @@ class Download(object):
|
|||||||
elapsed = time.time() - self.started
|
elapsed = time.time() - self.started
|
||||||
if elapsed < 10:
|
if elapsed < 10:
|
||||||
# Wait a couple of seconds for the download rate to stabilize.
|
# Wait a couple of seconds for the download rate to stabilize.
|
||||||
# This prevents an "Windows copy dialog"-esque experience at
|
# This prevents a "Windows copy dialog"-esque experience at
|
||||||
# the beginning of the download.
|
# the beginning of the download.
|
||||||
pb_fmt = strings._('gui_download_progress_starting').format(
|
pb_fmt = strings._('gui_download_progress_starting').format(
|
||||||
helpers.human_readable_filesize(downloaded_bytes))
|
helpers.human_readable_filesize(downloaded_bytes))
|
||||||
|
@ -98,6 +98,13 @@ class OnionShareGui(QtWidgets.QMainWindow):
|
|||||||
|
|
||||||
# downloads
|
# downloads
|
||||||
self.downloads = Downloads()
|
self.downloads = Downloads()
|
||||||
|
self.downloads_layout = QtWidgets.QGroupBox()
|
||||||
|
self.downloads_layout.setLayout(self.downloads)
|
||||||
|
self.downloads_layout_container = QtWidgets.QScrollArea()
|
||||||
|
self.downloads_layout_container.setWidget(self.downloads_layout)
|
||||||
|
self.downloads_layout_container.setWidgetResizable(True)
|
||||||
|
self.downloads_layout_container.setFixedHeight(80)
|
||||||
|
self.vbar = self.downloads_layout_container.verticalScrollBar()
|
||||||
|
|
||||||
# options
|
# options
|
||||||
self.options = Options(web, self.app)
|
self.options = Options(web, self.app)
|
||||||
@ -112,15 +119,6 @@ class OnionShareGui(QtWidgets.QMainWindow):
|
|||||||
|
|
||||||
# main layout
|
# main layout
|
||||||
self.layout = QtWidgets.QVBoxLayout()
|
self.layout = QtWidgets.QVBoxLayout()
|
||||||
|
|
||||||
self.downloads_layout = QtWidgets.QGroupBox()
|
|
||||||
self.downloads_layout.setLayout(self.downloads)
|
|
||||||
self.downloads_layout_container = QtWidgets.QScrollArea()
|
|
||||||
self.downloads_layout_container.setWidget(self.downloads_layout)
|
|
||||||
self.downloads_layout_container.setWidgetResizable(True)
|
|
||||||
self.downloads_layout_container.setFixedHeight(80)
|
|
||||||
self.vbar = self.downloads_layout_container.verticalScrollBar()
|
|
||||||
|
|
||||||
self.layout.addLayout(self.file_selection)
|
self.layout.addLayout(self.file_selection)
|
||||||
self.layout.addLayout(self.server_status)
|
self.layout.addLayout(self.server_status)
|
||||||
self.layout.addWidget(self.filesize_warning)
|
self.layout.addWidget(self.filesize_warning)
|
||||||
@ -219,7 +217,10 @@ class OnionShareGui(QtWidgets.QMainWindow):
|
|||||||
events.append(r)
|
events.append(r)
|
||||||
except web.queue.Empty:
|
except web.queue.Empty:
|
||||||
done = True
|
done = True
|
||||||
|
|
||||||
|
# scroll to the bottom of the dl progress bar log pane
|
||||||
self.vbar.setValue(self.vbar.maximum())
|
self.vbar.setValue(self.vbar.maximum())
|
||||||
|
|
||||||
for event in events:
|
for event in events:
|
||||||
if event["type"] == web.REQUEST_LOAD:
|
if event["type"] == web.REQUEST_LOAD:
|
||||||
self.status_bar.showMessage(strings._('download_page_loaded', True))
|
self.status_bar.showMessage(strings._('download_page_loaded', True))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user