Add startup and auto-connect app settings

Persist global app settings and expose startup/auto-connect controls. Adds AppSettings (StartWithWindows, AutoConnectOnStartup, LastActiveProfileId) plus LoadAppSettings/SaveAppSettings to ProfileService (appsettings.json). MainViewModel now loads/saves these settings, exposes StartWithWindows/AutoConnectOnStartup/LastActiveProfileId properties, restores last profile and triggers auto-connect on startup when enabled, and updates the HKCU Run registry entry to enable/disable startup (with a user warning message on enable). Adds corresponding UI controls to SettingsTabView and includes defensive error handling and sensible defaults.
This commit is contained in:
mohamad parvizi
2026-05-14 13:38:46 +03:30
parent 5f44e10e7b
commit aa345b1680
4 changed files with 189 additions and 0 deletions
@@ -113,6 +113,7 @@ public partial class MainViewModel
VpnIp = _vpnService.Status.VpnLocalIp;
VpnAdapterName = ResolveInterfaceName(_vpnService.Status.VpnInterfaceIndex);
_connectionStartTime = DateTime.Now;
LastActiveProfileId = _selectedProfile?.Id;
RaiseHealthStatusChanged();
// Start traffic routing for enabled apps