From 50326b6e26512e2f6dccf3f9035bc8c0ce237058 Mon Sep 17 00:00:00 2001 From: Saptak S Date: Sat, 30 Apr 2022 20:49:35 +0530 Subject: [PATCH] Keeps the same widget on cancelling a tor connection --- desktop/onionshare/connection_tab.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/desktop/onionshare/connection_tab.py b/desktop/onionshare/connection_tab.py index 6c35f21b..6bef4abe 100644 --- a/desktop/onionshare/connection_tab.py +++ b/desktop/onionshare/connection_tab.py @@ -326,11 +326,16 @@ class AutoConnectTab(QtWidgets.QWidget): """ self.tor_con.hide() - # If we're on first launch, switch to use bridge + # If we're on first launch, check if wasCancelled + # If cancelled, stay in first launch widget and show buttons + # Else, switch to use bridge if self.first_launch_widget.isVisible(): - self.first_launch_widget.show_buttons() - self.first_launch_widget.hide() - self.use_bridge_widget.show() + if self.tor_con.wasCanceled(): + self.first_launch_widget.show_buttons() + else: + self.first_launch_widget.show_buttons() + self.first_launch_widget.hide() + self.use_bridge_widget.show() else: self.use_bridge_widget.show_buttons()