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

@ -86,6 +86,7 @@ class TorConnectionDialog(QtWidgets.QProgressDialog):
def _canceled_connecting_to_tor(self):
common.log('TorConnectionDialog', '_canceled_connecting_to_tor')
self.active = False
self.onion.cleanup()
# Cancel connecting to Tor
QtCore.QTimer.singleShot(1, self.cancel)
@ -126,7 +127,7 @@ class TorConnectionThread(QtCore.QThread):
# Connect to the Onion
try:
self.onion.connect(self.settings, False, self._tor_status_update)
if self.onion.is_authenticated():
if self.onion.connected_to_tor:
self.connected_to_tor.emit()
else:
self.canceled_connecting_to_tor.emit()