mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-25 10:42:58 -03:00
Create the timer before the TorConnectionDialog dialog, but start it after. This way if you cancel the dialog, then click save in the settings, OnionShareGui.timer will already exist, even though though TorConnectionDialog hasn't closed yet
This commit is contained in:
parent
8f585db127
commit
6ab6ea564a
1 changed files with 6 additions and 4 deletions
|
@ -136,15 +136,17 @@ class OnionShareGui(QtWidgets.QMainWindow):
|
|||
# The server isn't active yet
|
||||
self.set_server_active(False)
|
||||
|
||||
# Create the timer
|
||||
self.timer = QtCore.QTimer()
|
||||
self.timer.timeout.connect(self.check_for_requests)
|
||||
|
||||
# Start the "Connecting to Tor" dialog, which calls onion.connect()
|
||||
tor_con = TorConnectionDialog(self.qtapp, 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()
|
||||
|
||||
# Check for requests frequently
|
||||
self.timer = QtCore.QTimer()
|
||||
self.timer.timeout.connect(self.check_for_requests)
|
||||
# Start the timer
|
||||
self.timer.start(500)
|
||||
|
||||
# After connecting to Tor, check for updates
|
||||
|
@ -224,7 +226,7 @@ class OnionShareGui(QtWidgets.QMainWindow):
|
|||
# connection. If so, restart the timer.
|
||||
if self.onion.is_authenticated():
|
||||
if not self.timer.isActive():
|
||||
self.timer.start()
|
||||
self.timer.start(500)
|
||||
# If there were some files listed for sharing, we should be ok to
|
||||
# re-enable the 'Start Sharing' button now.
|
||||
if self.server_status.file_selection.get_num_files() > 0:
|
||||
|
|
Loading…
Add table
Reference in a new issue