mirror of
https://github.com/onionshare/onionshare.git
synced 2025-08-18 10:58:34 -04:00
very poor auto scrolling
This commit is contained in:
parent
d0f085f756
commit
6379ca5e48
1 changed files with 9 additions and 5 deletions
|
@ -105,6 +105,7 @@ class OnionShareGui(QtWidgets.QMainWindow):
|
||||||
self.downloads_layout_container.setWidgetResizable(True)
|
self.downloads_layout_container.setWidgetResizable(True)
|
||||||
self.downloads_layout_container.setFixedHeight(80)
|
self.downloads_layout_container.setFixedHeight(80)
|
||||||
self.vbar = self.downloads_layout_container.verticalScrollBar()
|
self.vbar = self.downloads_layout_container.verticalScrollBar()
|
||||||
|
self.new_download = False
|
||||||
|
|
||||||
# options
|
# options
|
||||||
self.options = Options(web, self.app)
|
self.options = Options(web, self.app)
|
||||||
|
@ -204,6 +205,11 @@ class OnionShareGui(QtWidgets.QMainWindow):
|
||||||
Check for messages communicated from the web app, and update the GUI accordingly.
|
Check for messages communicated from the web app, and update the GUI accordingly.
|
||||||
"""
|
"""
|
||||||
self.update()
|
self.update()
|
||||||
|
# scroll to the bottom of the dl progress bar log pane
|
||||||
|
# if a new download has been added
|
||||||
|
if self.new_download:
|
||||||
|
self.vbar.setValue(self.vbar.maximum())
|
||||||
|
self.new_download = False
|
||||||
# only check for requests if the server is running
|
# only check for requests if the server is running
|
||||||
if self.server_status.status != self.server_status.STATUS_STARTED:
|
if self.server_status.status != self.server_status.STATUS_STARTED:
|
||||||
return
|
return
|
||||||
|
@ -218,15 +224,13 @@ class OnionShareGui(QtWidgets.QMainWindow):
|
||||||
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())
|
|
||||||
|
|
||||||
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))
|
||||||
|
|
||||||
elif event["type"] == web.REQUEST_DOWNLOAD:
|
elif event["type"] == web.REQUEST_DOWNLOAD:
|
||||||
self.downloads.add_download(event["data"]["id"], web.zip_filesize)
|
self.downloads.add_download(event["data"]["id"], web.zip_filesize)
|
||||||
|
self.new_download = True
|
||||||
|
|
||||||
elif event["type"] == web.REQUEST_RATE_LIMIT:
|
elif event["type"] == web.REQUEST_RATE_LIMIT:
|
||||||
self.stop_server()
|
self.stop_server()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue