Fix custom routing change handling

Signed-off-by: Loren Eteval <loren.eteval@proton.me>
This commit is contained in:
Loren Eteval
2026-09-19 13:38:49 +08:00
parent 8fb02d3b59
commit 8645b412d5
5 changed files with 417 additions and 8 deletions
+21
View File
@@ -132,6 +132,27 @@ class RoutingController(QtCore.QObject):
return self.state()
def invalidateRouting(self, routing: str) -> bool:
"""Persist the fallback after an explicit removal or disabling of a choice."""
if AppSettings.get('Routing') != routing:
return False
profile = self.currentProfileForRouting()
if profile is None:
return False
fallback = getPluginRegistry().normalizeRouting(profile, routing)
if fallback == routing:
return False
AppSettings.set('Routing', fallback)
self.refresh(force=True)
return True
@QtCore.Slot(str)
def selectRouting(self, routing: str) -> bool:
"""Persist a supported route and reconnect the active proxy if needed."""