Separate protocol action and editor titles

Signed-off-by: Loren Eteval <loren.eteval@proton.me>
This commit is contained in:
Loren Eteval
2026-08-20 21:49:52 +08:00
parent 3340e8bbb3
commit c78ebcf172
9 changed files with 159 additions and 64 deletions
+12 -9
View File
@@ -1789,23 +1789,26 @@ class ServerTableView(
"""Show all, manual, or one subscription group's profiles."""
self.proxyModel.setSubscriptionFilter(unique)
def addServerViaGui(
self,
protocol,
windowTitle: str = APPLICATION_NAME,
**kwargs,
):
def addServerViaGui(self, protocol, **kwargs):
"""Add server via GUI."""
factory = blankProfile(protocol)
guiEditor = self.getGuiEditorByFactory(factory, **kwargs)
windowTitle, translatable = (
kwargs.pop('windowTitle', APPLICATION_NAME),
kwargs.pop('translatable', True),
)
if translatable is True:
windowTitle = _(windowTitle)
guiEditor = self.getGuiEditorByFactory(
factory, windowTitle=windowTitle, translatable=translatable, **kwargs
)
if guiEditor is None:
# Unrecognized. Do nothing
return
guiEditor.setWindowTitle(windowTitle)
try:
guiEditor.factoryToInput(factory)
except Exception as ex: