diff --git a/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs b/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs index 7adcaa3c..ce9c899c 100644 --- a/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/ProfilesViewModel.cs @@ -56,6 +56,7 @@ namespace ServiceLib.ViewModels //servers delete public ReactiveCommand EditServerCmd { get; } + public ReactiveCommand RemoveServerCmd { get; } public ReactiveCommand RemoveDuplicateServerCmd { get; } public ReactiveCommand CopyServerCmd { get; } @@ -66,12 +67,14 @@ namespace ServiceLib.ViewModels //servers move public ReactiveCommand MoveTopCmd { get; } + public ReactiveCommand MoveUpCmd { get; } public ReactiveCommand MoveDownCmd { get; } public ReactiveCommand MoveBottomCmd { get; } //servers ping public ReactiveCommand MixedTestServerCmd { get; } + public ReactiveCommand TcpingServerCmd { get; } public ReactiveCommand RealPingServerCmd { get; } public ReactiveCommand SpeedServerCmd { get; } @@ -79,6 +82,7 @@ namespace ServiceLib.ViewModels //servers export public ReactiveCommand Export2ClientConfigCmd { get; } + public ReactiveCommand Export2ClientConfigClipboardCmd { get; } public ReactiveCommand Export2ShareUrlCmd { get; } public ReactiveCommand Export2ShareUrlBase64Cmd { get; } @@ -95,7 +99,11 @@ namespace ServiceLib.ViewModels _config = AppHandler.Instance.Config; _updateView = updateView; - MessageBus.Current.Listen(EMsgCommand.RefreshProfiles.ToString()).Subscribe(async x => await _updateView?.Invoke(EViewAction.DispatcherRefreshServersBiz, null)); + if (_updateView != null) + { + MessageBus.Current.Listen(EMsgCommand.RefreshProfiles.ToString()) + .Subscribe(async x => await _updateView?.Invoke(EViewAction.DispatcherRefreshServersBiz, null)); + } SelectedProfile = new(); SelectedSub = new(); diff --git a/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs b/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs index 397cbb38..c76198f2 100644 --- a/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs @@ -52,6 +52,18 @@ namespace ServiceLib.ViewModels [Reactive] public bool BlSystemProxyPac { get; set; } + [Reactive] + public bool BlNotSystemProxyClear { get; set; } + + [Reactive] + public bool BlNotSystemProxySet { get; set; } + + [Reactive] + public bool BlNotSystemProxyNothing { get; set; } + + [Reactive] + public bool BlNotSystemProxyPac { get; set; } + public ReactiveCommand SystemProxyClearCmd { get; } public ReactiveCommand SystemProxySetCmd { get; } public ReactiveCommand SystemProxyNothingCmd { get; } @@ -321,6 +333,11 @@ namespace ServiceLib.ViewModels BlSystemProxyNothing = (type == ESysProxyType.Unchanged); BlSystemProxyPac = (type == ESysProxyType.Pac); + BlNotSystemProxyClear = !BlSystemProxyClear; + BlNotSystemProxySet = !BlSystemProxySet; + BlNotSystemProxyNothing = !BlSystemProxyNothing; + BlNotSystemProxyPac = !BlSystemProxyPac; + if (blChange) { _updateView?.Invoke(EViewAction.DispatcherRefreshIcon, null); diff --git a/v2rayN/v2rayN.Desktop/App.axaml b/v2rayN/v2rayN.Desktop/App.axaml index 4abccec4..cabf69a2 100644 --- a/v2rayN/v2rayN.Desktop/App.axaml +++ b/v2rayN/v2rayN.Desktop/App.axaml @@ -28,21 +28,47 @@ + ToolTipText="{Binding RunningServerToolTipText}"> - - - + + + + + + + + - + diff --git a/v2rayN/v2rayN.Desktop/App.axaml.cs b/v2rayN/v2rayN.Desktop/App.axaml.cs index 3e7251f2..5cc69809 100644 --- a/v2rayN/v2rayN.Desktop/App.axaml.cs +++ b/v2rayN/v2rayN.Desktop/App.axaml.cs @@ -74,21 +74,6 @@ public partial class App : Application { } - private void TrayIcon_Clicked(object? sender, EventArgs e) - { - if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) - { - if (desktop.MainWindow.IsVisible) - { - desktop.MainWindow?.Hide(); - } - else - { - desktop.MainWindow?.Show(); - } - } - } - private void MenuAddServerViaClipboardClick(object? sender, EventArgs e) { if (Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)