mirror of
https://github.com/onionshare/onionshare.git
synced 2025-07-30 01:48:50 -04:00
OnionShare connects fine when connection_type isn't bundled_tor, and it now displays errors and opens Settings when it can't connect to Tor
This commit is contained in:
parent
498de14a3d
commit
54607cb037
2 changed files with 26 additions and 4 deletions
|
@ -25,6 +25,7 @@ from onionshare.settings import Settings
|
|||
from onionshare.onion import *
|
||||
|
||||
from .tor_connection_dialog import TorConnectionDialog
|
||||
from .settings_dialog import SettingsDialog
|
||||
from .menu import Menu
|
||||
from .file_selection import FileSelection
|
||||
from .server_status import ServerStatus
|
||||
|
@ -59,6 +60,7 @@ class OnionShareGui(QtWidgets.QMainWindow):
|
|||
# Start the "Connecting to Tor" dialog, which calls onion.connect()
|
||||
tor_con = TorConnectionDialog(self.settings, self.onion)
|
||||
tor_con.canceled.connect(self._tor_connection_canceled)
|
||||
tor_con.open_settings.connect(self._tor_connection_open_settings)
|
||||
tor_con.start()
|
||||
|
||||
# Menu bar
|
||||
|
@ -146,9 +148,19 @@ class OnionShareGui(QtWidgets.QMainWindow):
|
|||
def quit():
|
||||
self.qtapp.quit()
|
||||
|
||||
# Wait 1ms for the event loop to finish closing the TorConnectionDialog before quitting
|
||||
# Wait 1ms for the event loop to finish closing the TorConnectionDialog
|
||||
QtCore.QTimer.singleShot(1, quit)
|
||||
|
||||
def _tor_connection_open_settings(self):
|
||||
"""
|
||||
The TorConnectionDialog wants to open the Settings dialog
|
||||
"""
|
||||
def open_settings():
|
||||
SettingsDialog(self.qtapp)
|
||||
|
||||
# Wait 1ms for the event loop to finish closing the TorConnectionDialog
|
||||
QtCore.QTimer.singleShot(1, open_settings)
|
||||
|
||||
def start_server(self):
|
||||
"""
|
||||
Start the onionshare server. This uses multiple threads to start the Tor onion
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue