From ed77dce2dcfeee2693fa7aadac6400ebfee48592 Mon Sep 17 00:00:00 2001 From: Loren Eteval Date: Sun, 5 Apr 2026 01:31:16 +0800 Subject: [PATCH] Update Connect.py to fix some warnings Signed-off-by: Loren Eteval --- Furious/TrayActions/Connect.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Furious/TrayActions/Connect.py b/Furious/TrayActions/Connect.py index c2dbe2a..e87a1cb 100644 --- a/Furious/TrayActions/Connect.py +++ b/Furious/TrayActions/Connect.py @@ -358,40 +358,48 @@ class ConnectAction(AppQAction): if exitcode == CoreProcessFactory.ExitCode.SystemShuttingDown.value: # System shutting down. Do nothing - return + return None if exitcode == CoreProcessFactory.ExitCode.ConfigurationError.value: - return putItem( + putItem( functools.partial( self.doDisconnectWithTrayMessage, f'{core.name()}: ' + _('Invalid server configuration'), ) ) + return None + if exitcode == CoreProcessFactory.ExitCode.ServerStartFailure.value: - return putItem( + putItem( functools.partial( self.doDisconnectWithTrayMessage, f'{core.name()}: ' + _('Failed to start core'), ) ) + return None + if isinstance(core, Hysteria1): if exitcode == Hysteria1.ExitCode.RemoteNetworkError.value: - return putItem( + putItem( functools.partial( self.doDisconnectWithTrayMessage, f'{core.name()}: ' + _('Connection to server has been lost'), ) ) - return putItem( + return None + + putItem( functools.partial( self.doDisconnectWithTrayMessage, f'{core.name()}: ' + _('Core terminated unexpectedly'), ) ) + return None + def triggeredCallback(self, checked): if checked: self.doConnect()