diff --git a/v2rayN/ServiceLib/Events/AppEvents.cs b/v2rayN/ServiceLib/Events/AppEvents.cs index 5824bfc0..2f97bc6b 100644 --- a/v2rayN/ServiceLib/Events/AppEvents.cs +++ b/v2rayN/ServiceLib/Events/AppEvents.cs @@ -7,6 +7,7 @@ public static class AppEvents public static readonly EventChannel AddServerViaScanRequested = new(); public static readonly EventChannel AddServerViaClipboardRequested = new(); public static readonly EventChannel SubscriptionsUpdateRequested = new(); + public static readonly EventChannel HasUpdateNotified = new(); public static readonly EventChannel ProfilesRefreshRequested = new(); public static readonly EventChannel SubscriptionsRefreshRequested = new(); diff --git a/v2rayN/ServiceLib/Manager/TaskManager.cs b/v2rayN/ServiceLib/Manager/TaskManager.cs index 3fc64a2e..1e5b0c70 100644 --- a/v2rayN/ServiceLib/Manager/TaskManager.cs +++ b/v2rayN/ServiceLib/Manager/TaskManager.cs @@ -142,5 +142,10 @@ public class TaskManager await _updateFunc?.Invoke(false, msg); } NoticeManager.Instance.Enqueue(string.Join("\n", msgs)); + + if (msgs.Count > 0) + { + AppEvents.HasUpdateNotified.Publish(true); + } } } diff --git a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs index 84733c1b..c3a00a51 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.Designer.cs +++ b/v2rayN/ServiceLib/Resx/ResUI.Designer.cs @@ -1320,6 +1320,15 @@ namespace ServiceLib.Resx { } } + /// + /// 查找类似 New Update 的本地化字符串。 + /// + public static string menuNewUpdate { + get { + return ResourceManager.GetString("menuNewUpdate", resourceCulture); + } + } + /// /// 查找类似 Open the storage location 的本地化字符串。 /// diff --git a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx index 184337a6..246417a6 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx @@ -1743,4 +1743,7 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if IP Info + + New Update + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.fr.resx b/v2rayN/ServiceLib/Resx/ResUI.fr.resx index 230bf23f..c9dc042b 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.fr.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.fr.resx @@ -1740,4 +1740,7 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if IP Info + + New Update + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.hu.resx b/v2rayN/ServiceLib/Resx/ResUI.hu.resx index 562a36a6..f1e159c3 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.hu.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.hu.resx @@ -1743,4 +1743,7 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if IP Info + + New Update + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.resx b/v2rayN/ServiceLib/Resx/ResUI.resx index d5c0e10a..6cf545db 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.resx @@ -1743,4 +1743,7 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if IP Info + + New Update + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.ru.resx b/v2rayN/ServiceLib/Resx/ResUI.ru.resx index e93b8c01..bcf13d86 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.ru.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.ru.resx @@ -1743,4 +1743,7 @@ IP Info + + New Update + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx index 6515df45..21149534 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx @@ -1740,4 +1740,7 @@ IP 信息 + + 有更新 + \ No newline at end of file diff --git a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx index 111b1a95..7cb2f802 100644 --- a/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx +++ b/v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx @@ -1740,4 +1740,7 @@ IP 資訊 + + 有更新 + \ No newline at end of file diff --git a/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs b/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs index 53ad06c8..da798a8b 100644 --- a/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs @@ -65,6 +65,8 @@ public class MainWindowViewModel : MyReactiveObject [Reactive] public bool BlIsWindows { get; set; } + [Reactive] public bool BlNewUpdate { get; set; } + #endregion Menu #region Init @@ -251,6 +253,11 @@ public class MainWindowViewModel : MyReactiveObject .ObserveOn(RxSchedulers.MainThreadScheduler) .Subscribe(async blProxy => await UpdateSubscriptionProcess("", blProxy)); + AppEvents.HasUpdateNotified + .AsObservable() + .ObserveOn(RxSchedulers.MainThreadScheduler) + .Subscribe(async bl => BlNewUpdate = bl); + #endregion AppEvents _ = Init(); diff --git a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml index 8d9a5f85..5473f96f 100644 --- a/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml +++ b/v2rayN/v2rayN.Desktop/Views/MainWindow.axaml @@ -102,6 +102,13 @@ + +