mirror of
https://github.com/onionshare/onionshare.git
synced 2025-06-02 21:33:12 -04:00
Now when you cancel connecting to Tor, it prompts you if you want to quit or open settings
This commit is contained in:
parent
ad2c5e94b4
commit
58f70b1d9b
4 changed files with 23 additions and 9 deletions
|
@ -143,13 +143,25 @@ class OnionShareGui(QtWidgets.QMainWindow):
|
|||
|
||||
def _tor_connection_canceled(self):
|
||||
"""
|
||||
If the user cancels before Tor finishes connecting, quit.
|
||||
If the user cancels before Tor finishes connecting, ask if they want to
|
||||
quit, or open settings.
|
||||
"""
|
||||
def quit():
|
||||
self.qtapp.quit()
|
||||
def quit_settings_dialog():
|
||||
a = Alert("Would you like to open OnionShare settings to troubleshoot connecting to Tor?", QtWidgets.QMessageBox.Question, buttons=QtWidgets.QMessageBox.NoButton, autostart=False)
|
||||
settings_button = QtWidgets.QPushButton("Open Settings")
|
||||
quit_button = QtWidgets.QPushButton("Quit")
|
||||
a.addButton(settings_button, QtWidgets.QMessageBox.AcceptRole)
|
||||
a.addButton(quit_button, QtWidgets.QMessageBox.RejectRole)
|
||||
a.setDefaultButton(settings_button)
|
||||
a.exec_()
|
||||
|
||||
if a.clickedButton() == settings_button:
|
||||
SettingsDialog(self.qtapp)
|
||||
else:
|
||||
self.qtapp.quit()
|
||||
|
||||
# Wait 1ms for the event loop to finish closing the TorConnectionDialog
|
||||
QtCore.QTimer.singleShot(1, quit)
|
||||
QtCore.QTimer.singleShot(1, quit_settings_dialog)
|
||||
|
||||
def _tor_connection_open_settings(self):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue