mirror of
https://github.com/onionshare/onionshare.git
synced 2025-05-04 23:45:04 -04:00
Resolve conflict with upstream's onion.py
This commit is contained in:
commit
448f6af796
11 changed files with 129 additions and 33 deletions
|
@ -78,6 +78,8 @@ class SettingsDialog(QtWidgets.QDialog):
|
|||
# Stealth
|
||||
stealth_details = QtWidgets.QLabel(strings._("gui_settings_stealth_option_details", True))
|
||||
stealth_details.setWordWrap(True)
|
||||
stealth_details.setTextInteractionFlags(QtCore.Qt.TextBrowserInteraction)
|
||||
stealth_details.setOpenExternalLinks(True)
|
||||
self.stealth_checkbox = QtWidgets.QCheckBox()
|
||||
self.stealth_checkbox.setCheckState(QtCore.Qt.Unchecked)
|
||||
self.stealth_checkbox.setText(strings._("gui_settings_stealth_option", True))
|
||||
|
@ -493,7 +495,8 @@ class SettingsDialog(QtWidgets.QDialog):
|
|||
# If Tor isn't connected, or if Tor settings have changed, Reinitialize
|
||||
# the Onion object
|
||||
reboot_onion = False
|
||||
if self.onion.connected_to_tor:
|
||||
if self.onion.is_authenticated():
|
||||
common.log('SettingsDialog', 'save_clicked', 'Connected to Tor')
|
||||
def changed(s1, s2, keys):
|
||||
"""
|
||||
Compare the Settings objects s1 and s2 and return true if any values
|
||||
|
@ -512,6 +515,7 @@ class SettingsDialog(QtWidgets.QDialog):
|
|||
reboot_onion = True
|
||||
|
||||
else:
|
||||
common.log('SettingsDialog', 'save_clicked', 'Not connected to Tor')
|
||||
# Tor isn't connected, so try connecting
|
||||
reboot_onion = True
|
||||
|
||||
|
@ -526,7 +530,7 @@ class SettingsDialog(QtWidgets.QDialog):
|
|||
|
||||
common.log('SettingsDialog', 'save_clicked', 'Onion done rebooting, connected to Tor: {}'.format(self.onion.connected_to_tor))
|
||||
|
||||
if self.onion.connected_to_tor and not tor_con.wasCanceled():
|
||||
if self.onion.is_authenticated() and not tor_con.wasCanceled():
|
||||
self.settings_saved.emit()
|
||||
self.close()
|
||||
|
||||
|
@ -539,7 +543,7 @@ class SettingsDialog(QtWidgets.QDialog):
|
|||
Cancel button clicked.
|
||||
"""
|
||||
common.log('SettingsDialog', 'cancel_clicked')
|
||||
if not self.onion.connected_to_tor:
|
||||
if not self.onion.is_authenticated():
|
||||
Alert(strings._('gui_tor_connection_canceled', True), QtWidgets.QMessageBox.Warning)
|
||||
sys.exit()
|
||||
else:
|
||||
|
@ -606,7 +610,7 @@ class SettingsDialog(QtWidgets.QDialog):
|
|||
common.log('SettingsDialog', 'closeEvent')
|
||||
|
||||
# On close, if Tor isn't connected, then quit OnionShare altogether
|
||||
if not self.onion.connected_to_tor:
|
||||
if not self.onion.is_authenticated():
|
||||
common.log('SettingsDialog', 'closeEvent', 'Closing while not connected to Tor')
|
||||
|
||||
# Wait 1ms for the event loop to finish, then quit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue