Add Tor connection status to the main window status bar

This commit is contained in:
Micah Lee 2017-04-13 23:08:25 -07:00
parent 8677ea35e5
commit f82cf01e6d
4 changed files with 16 additions and 6 deletions

View file

@ -171,9 +171,18 @@ class OnionShareGui(QtWidgets.QMainWindow):
# start the onion service in a new thread
def start_onion_service(self):
self.status_bar.showMessage(strings._('gui_starting_server1', True))
try:
self.app.start_onion_service()
# Show Tor connection status if connection type is bundled tor
if settings.get('connection_type') == 'bundled':
def bundled_tor_func(message):
self.status_bar.showMessage(message)
if 'Done' in message:
self.status_bar.showMessage(strings._('gui_starting_server1', True))
else:
self.status_bar.showMessage(strings._('gui_starting_server1', True))
bundled_tor_func = None
self.app.start_onion_service(bundled_tor_func)
self.starting_server_step2.emit()
except (onionshare.onion.TorTooOld, onionshare.onion.TorErrorInvalidSetting, onionshare.onion.TorErrorAutomatic, onionshare.onion.TorErrorSocketPort, onionshare.onion.TorErrorSocketFile, onionshare.onion.TorErrorMissingPassword, onionshare.onion.TorErrorUnreadableCookieFile, onionshare.onion.TorErrorAuthError, onionshare.onion.TorErrorProtocolError) as e: