diff --git a/Furious/Frozenlib/Globals.py b/Furious/Frozenlib/Globals.py index c2678b0..482d93a 100644 --- a/Furious/Frozenlib/Globals.py +++ b/Furious/Frozenlib/Globals.py @@ -26,6 +26,7 @@ import functools __all__ = [ 'APP', 'AppConnectionController', + 'AppEndpointInfoService', 'AppFontName', 'AppLogManager', 'AppLogPage', @@ -34,6 +35,7 @@ __all__ = [ 'AppSettingsController', 'AppSystemTray', 'AppThreadPool', + 'AppTrafficStatsManager', ] APP = functools.partial(QApplication.instance) @@ -44,8 +46,19 @@ def getAppAttributes(name: str): return getattr(APP(), name) +def getAppNestedAttributes(*names: str): + """Return an application-owned object through a stable attribute path.""" + value = APP() + + for name in names: + value = getattr(value, name) + + return value + + ( AppConnectionController, + AppEndpointInfoService, AppFontName, AppLogManager, AppLogPage, @@ -54,8 +67,15 @@ def getAppAttributes(name: str): AppSettingsController, AppSystemTray, AppThreadPool, + AppTrafficStatsManager, ) = ( functools.partial(getAppAttributes, 'connectionController'), + functools.partial( + getAppNestedAttributes, + 'mainWindow', + 'metricsPage', + 'endpointInfoService', + ), functools.partial(getAppAttributes, 'customFontName'), functools.partial(getAppAttributes, 'logManager'), functools.partial(getAppAttributes, 'logPage'), @@ -64,4 +84,5 @@ def getAppAttributes(name: str): functools.partial(getAppAttributes, 'settingsController'), functools.partial(getAppAttributes, 'systemTray'), functools.partial(getAppAttributes, 'threadPool'), + functools.partial(getAppNestedAttributes, 'mainWindow', 'trafficStatsManager'), ) diff --git a/Furious/Frozenlib/__init__.py b/Furious/Frozenlib/__init__.py index abcd5b6..70903f5 100644 --- a/Furious/Frozenlib/__init__.py +++ b/Furious/Frozenlib/__init__.py @@ -75,6 +75,7 @@ from .Enum import ( from .Globals import ( APP, AppConnectionController, + AppEndpointInfoService, AppFontName, AppLogManager, AppLogPage, @@ -83,6 +84,7 @@ from .Globals import ( AppSettingsController, AppSystemTray, AppThreadPool, + AppTrafficStatsManager, ) from .Mixins import Mixins from .PySide6Legacy import PySide6Legacy @@ -128,6 +130,7 @@ __all__ = [ 'AppBuiltinProxyMode', 'AppBuiltinRouting', 'AppConnectionController', + 'AppEndpointInfoService', 'AppFontName', 'AppLogManager', 'AppLogPage', @@ -138,6 +141,7 @@ __all__ = [ 'AppSettingsController', 'AppSystemTray', 'AppThreadPool', + 'AppTrafficStatsManager', 'CORE_CHECK_ALIVE_INTERVAL', 'CRASH_LOG_DIR', 'DATA_DIR',