Fixes for the edge case where Tor connection dialog is canceled, but the Tor process remains open in the background, which was causing onion.is_authenticated() to True. Remove excessive alerts

This commit is contained in:
Miguel Jacq 2017-12-21 14:08:13 +11:00
parent b442b5d41b
commit 6f4d7f7f44
No known key found for this signature in database
GPG key ID: EEA4341C6D97A0B6
5 changed files with 15 additions and 8 deletions

View file

@ -176,6 +176,7 @@ class OnionShareGui(QtWidgets.QMainWindow):
quit, or open settings.
"""
common.log('OnionShareGui', '_tor_connection_canceled')
self.timer.stop()
def ask():
a = Alert(strings._('gui_tor_connection_ask', True), QtWidgets.QMessageBox.Question, buttons=QtWidgets.QMessageBox.NoButton, autostart=False)
@ -394,11 +395,14 @@ class OnionShareGui(QtWidgets.QMainWindow):
"""
self.update()
# Has the Tor Connection dialog finished, but we've since lost connection to Tor somehow?
if not self.onion.is_authenticated() and self.tor_con.t.isFinished():
self.timer.stop()
self.start_server_error(strings._('error_tor_protocol_error'))
self._tor_connection_canceled()
# Have we lost connection to Tor somehow?
if self.tor_con.t.isFinished():
if not self.onion.is_authenticated():
self.timer.stop()
if self.server_status.status != self.server_status.STATUS_STOPPED:
self.server_status.stop_server()
self.status_bar.clearMessage()
self._tor_connection_canceled()
# scroll to the bottom of the dl progress bar log pane
# if a new download has been added