mirror of
https://github.com/onionshare/onionshare.git
synced 2025-02-02 09:35:33 -05:00
Dont start tor if torsettingstab opened from autoconnect
This commit is contained in:
parent
2ad9f8df58
commit
8d1d395d11
@ -152,7 +152,7 @@ class AutoConnectTab(QtWidgets.QWidget):
|
||||
self.curr_settings.save()
|
||||
|
||||
def open_tor_settings(self):
|
||||
self.parent.open_tor_settings_tab()
|
||||
self.parent.open_tor_settings_tab(from_autoconnect=True)
|
||||
|
||||
def connect_clicked(self):
|
||||
"""
|
||||
@ -164,11 +164,8 @@ class AutoConnectTab(QtWidgets.QWidget):
|
||||
self.connect_button.hide()
|
||||
self.configure_button.hide()
|
||||
|
||||
if not self.common.gui.local_only:
|
||||
self.tor_con.show()
|
||||
self.tor_con.start(self.curr_settings)
|
||||
else:
|
||||
self.close_this_tab.emit()
|
||||
|
||||
def tor_con_success(self):
|
||||
"""
|
||||
|
@ -23,8 +23,8 @@ import time
|
||||
from PySide2 import QtCore, QtWidgets, QtGui
|
||||
|
||||
from . import strings
|
||||
from .tor_connection import TorConnectionDialog
|
||||
from .widgets import Alert
|
||||
from .connection_tab import AutoConnectTab
|
||||
from .update_checker import UpdateThread
|
||||
from .tab_widget import TabWidget
|
||||
from .gui_common import GuiCommon
|
||||
@ -238,7 +238,8 @@ class MainWindow(QtWidgets.QMainWindow):
|
||||
Open the TorSettingsTab
|
||||
"""
|
||||
self.common.log("MainWindow", "open_tor_settings")
|
||||
self.tabs.open_tor_settings_tab()
|
||||
from_autoconnect = type(self.tabs.tabs[0]) is AutoConnectTab
|
||||
self.tabs.open_tor_settings_tab(from_autoconnect)
|
||||
|
||||
def open_settings(self):
|
||||
"""
|
||||
|
@ -241,7 +241,7 @@ class TabWidget(QtWidgets.QTabWidget):
|
||||
index = self.addTab(settings_tab, strings._("gui_settings_window_title"))
|
||||
self.setCurrentIndex(index)
|
||||
|
||||
def open_tor_settings_tab(self):
|
||||
def open_tor_settings_tab(self, from_autoconnect=False):
|
||||
self.common.log("TabWidget", "open_tor_settings_tab")
|
||||
|
||||
# See if a settings tab is already open, and if so switch to it
|
||||
@ -251,7 +251,7 @@ class TabWidget(QtWidgets.QTabWidget):
|
||||
return
|
||||
|
||||
self.tor_settings_tab = TorSettingsTab(
|
||||
self.common, self.current_tab_id, self.are_tabs_active(), self.status_bar
|
||||
self.common, self.current_tab_id, self.are_tabs_active(), self.status_bar, from_autoconnect
|
||||
)
|
||||
self.tor_settings_tab.close_this_tab.connect(self.close_tor_settings_tab)
|
||||
self.tor_settings_tab.tor_is_connected.connect(self.tor_is_connected)
|
||||
|
@ -43,7 +43,7 @@ class TorSettingsTab(QtWidgets.QWidget):
|
||||
tor_is_connected = QtCore.Signal()
|
||||
tor_is_disconnected = QtCore.Signal()
|
||||
|
||||
def __init__(self, common, tab_id, are_tabs_active, status_bar):
|
||||
def __init__(self, common, tab_id, are_tabs_active, status_bar, from_autoconnect=False):
|
||||
super(TorSettingsTab, self).__init__()
|
||||
|
||||
self.common = common
|
||||
@ -54,6 +54,7 @@ class TorSettingsTab(QtWidgets.QWidget):
|
||||
|
||||
self.system = platform.system()
|
||||
self.tab_id = tab_id
|
||||
self.from_autoconnect = from_autoconnect
|
||||
|
||||
# Connection type: either automatic, control port, or socket file
|
||||
|
||||
@ -692,7 +693,7 @@ class TorSettingsTab(QtWidgets.QWidget):
|
||||
# If Tor isn't connected, or if Tor settings have changed, Reinitialize
|
||||
# the Onion object
|
||||
reboot_onion = False
|
||||
if not self.common.gui.local_only:
|
||||
if not self.common.gui.local_only and not self.from_autoconnect:
|
||||
if self.common.gui.onion.is_authenticated():
|
||||
self.common.log(
|
||||
"TorSettingsTab", "save_clicked", "Connected to Tor"
|
||||
|
Loading…
x
Reference in New Issue
Block a user