mirror of
https://github.com/2dust/v2rayN.git
synced 2026-04-16 12:35:46 +00:00
Merge branch '2dust:master' into master
This commit is contained in:
commit
2c91f64ee6
35 changed files with 149 additions and 141 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
<Project>
|
<Project>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Version>7.19.3</Version>
|
<Version>7.19.4</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
|
|
|
||||||
|
|
@ -9,18 +9,18 @@
|
||||||
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="11.3.12" />
|
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="11.3.12" />
|
||||||
<PackageVersion Include="Avalonia.Desktop" Version="11.3.12" />
|
<PackageVersion Include="Avalonia.Desktop" Version="11.3.12" />
|
||||||
<PackageVersion Include="Avalonia.Diagnostics" Version="11.3.12" />
|
<PackageVersion Include="Avalonia.Diagnostics" Version="11.3.12" />
|
||||||
<PackageVersion Include="ReactiveUI.Avalonia" Version="11.3.8" />
|
<PackageVersion Include="ReactiveUI.Avalonia" Version="11.4.12" />
|
||||||
<PackageVersion Include="CliWrap" Version="3.10.0" />
|
<PackageVersion Include="CliWrap" Version="3.10.0" />
|
||||||
<PackageVersion Include="Downloader" Version="4.1.1" />
|
<PackageVersion Include="Downloader" Version="5.1.0" />
|
||||||
<PackageVersion Include="H.NotifyIcon.Wpf" Version="2.4.1" />
|
<PackageVersion Include="H.NotifyIcon.Wpf" Version="2.4.1" />
|
||||||
<PackageVersion Include="MaterialDesignThemes" Version="5.3.0" />
|
<PackageVersion Include="MaterialDesignThemes" Version="5.3.0" />
|
||||||
<PackageVersion Include="MessageBox.Avalonia" Version="3.3.1.1" />
|
<PackageVersion Include="MessageBox.Avalonia" Version="3.3.1.1" />
|
||||||
<PackageVersion Include="QRCoder" Version="1.7.0" />
|
<PackageVersion Include="QRCoder" Version="1.7.0" />
|
||||||
<PackageVersion Include="ReactiveUI" Version="22.3.1" />
|
<PackageVersion Include="ReactiveUI" Version="23.1.8" />
|
||||||
<PackageVersion Include="ReactiveUI.Fody" Version="19.5.41" />
|
<PackageVersion Include="ReactiveUI.Fody" Version="19.5.41" />
|
||||||
<PackageVersion Include="ReactiveUI.WPF" Version="22.3.1" />
|
<PackageVersion Include="ReactiveUI.WPF" Version="23.1.8" />
|
||||||
<PackageVersion Include="Semi.Avalonia" Version="11.3.7.3" />
|
<PackageVersion Include="Semi.Avalonia" Version="11.3.7.3" />
|
||||||
<PackageVersion Include="Semi.Avalonia.AvaloniaEdit" Version="11.2.0.1" />
|
<PackageVersion Include="Semi.Avalonia.AvaloniaEdit" Version="11.2.0.2" />
|
||||||
<PackageVersion Include="Semi.Avalonia.DataGrid" Version="11.3.7.3" />
|
<PackageVersion Include="Semi.Avalonia.DataGrid" Version="11.3.7.3" />
|
||||||
<PackageVersion Include="NLog" Version="6.1.1" />
|
<PackageVersion Include="NLog" Version="6.1.1" />
|
||||||
<PackageVersion Include="sqlite-net-pcl" Version="1.9.172" />
|
<PackageVersion Include="sqlite-net-pcl" Version="1.9.172" />
|
||||||
|
|
|
||||||
|
|
@ -95,10 +95,7 @@ public static class ConfigHandler
|
||||||
config.GuiItem ??= new();
|
config.GuiItem ??= new();
|
||||||
config.MsgUIItem ??= new();
|
config.MsgUIItem ??= new();
|
||||||
|
|
||||||
config.UiItem ??= new UIItem()
|
config.UiItem ??= new();
|
||||||
{
|
|
||||||
EnableUpdateSubOnlyRemarksExist = true
|
|
||||||
};
|
|
||||||
config.UiItem.MainColumnItem ??= new();
|
config.UiItem.MainColumnItem ??= new();
|
||||||
config.UiItem.WindowSizeItem ??= new();
|
config.UiItem.WindowSizeItem ??= new();
|
||||||
|
|
||||||
|
|
@ -1132,6 +1129,84 @@ public static class ConfigHandler
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Searches the specified collection for a profile item that matches the target profile item based on a series of
|
||||||
|
/// criteria.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>The method attempts to find a match by comparing the target's remarks, address, port, and
|
||||||
|
/// password in various combinations. The search is performed in order of specificity, starting with the most
|
||||||
|
/// detailed comparison. If no match is found at any stage, the method returns null.</remarks>
|
||||||
|
/// <param name="source">An enumerable collection of profile items to search. This parameter can be null.</param>
|
||||||
|
/// <param name="target">The profile item to match against items in the source collection. This parameter can be null.</param>
|
||||||
|
/// <returns>A profile item from the source collection that matches the target item according to defined criteria; otherwise,
|
||||||
|
/// null if no match is found or if either parameter is null.</returns>
|
||||||
|
private static ProfileItem? FindMatchedProfileItem(IEnumerable<ProfileItem>? source, ProfileItem? target)
|
||||||
|
{
|
||||||
|
if (source == null || target == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var matchedItem = source.FirstOrDefault(t => CompareProfileItem(t, target, true));
|
||||||
|
if (matchedItem != null)
|
||||||
|
{
|
||||||
|
return matchedItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (target.Remarks.IsNotEmpty())
|
||||||
|
{
|
||||||
|
matchedItem = source.FirstOrDefault(t => t.Remarks == target.Remarks);
|
||||||
|
if (matchedItem != null)
|
||||||
|
{
|
||||||
|
return matchedItem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (target.Address.IsNotEmpty() && target.Port > 0 && target.Password.IsNotEmpty())
|
||||||
|
{
|
||||||
|
matchedItem = source.FirstOrDefault(t =>
|
||||||
|
IsSameText(t.Address, target.Address) &&
|
||||||
|
t.Port == target.Port &&
|
||||||
|
IsSameText(t.Password, target.Password));
|
||||||
|
if (matchedItem != null)
|
||||||
|
{
|
||||||
|
return matchedItem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (target.Address.IsNotEmpty() && target.Port > 0)
|
||||||
|
{
|
||||||
|
matchedItem = source.FirstOrDefault(t =>
|
||||||
|
IsSameText(t.Address, target.Address) &&
|
||||||
|
t.Port == target.Port);
|
||||||
|
if (matchedItem != null)
|
||||||
|
{
|
||||||
|
return matchedItem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (target.Address.IsNotEmpty())
|
||||||
|
{
|
||||||
|
matchedItem = source.FirstOrDefault(t => IsSameText(t.Address, target.Address));
|
||||||
|
if (matchedItem != null)
|
||||||
|
{
|
||||||
|
return matchedItem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
|
||||||
|
static bool IsSameText(string? left, string? right)
|
||||||
|
{
|
||||||
|
if (left.IsNullOrEmpty() || right.IsNullOrEmpty())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return string.Equals(left.TrimEx(), right.TrimEx(), StringComparison.OrdinalIgnoreCase);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Remove a single server profile by its index ID
|
/// Remove a single server profile by its index ID
|
||||||
/// Deletes the configuration file if it's a custom config
|
/// Deletes the configuration file if it's a custom config
|
||||||
|
|
@ -1628,7 +1703,7 @@ public static class ConfigHandler
|
||||||
if (activeProfile != null)
|
if (activeProfile != null)
|
||||||
{
|
{
|
||||||
var lstSub = await AppManager.Instance.ProfileItems(subid);
|
var lstSub = await AppManager.Instance.ProfileItems(subid);
|
||||||
var existItem = lstSub?.FirstOrDefault(t => config.UiItem.EnableUpdateSubOnlyRemarksExist ? t.Remarks == activeProfile.Remarks : CompareProfileItem(t, activeProfile, true));
|
var existItem = FindMatchedProfileItem(lstSub, activeProfile);
|
||||||
if (existItem != null)
|
if (existItem != null)
|
||||||
{
|
{
|
||||||
await ConfigHandler.SetDefaultServerIndex(config, existItem.IndexId);
|
await ConfigHandler.SetDefaultServerIndex(config, existItem.IndexId);
|
||||||
|
|
@ -1641,7 +1716,7 @@ public static class ConfigHandler
|
||||||
var lstSub = await AppManager.Instance.ProfileItems(subid);
|
var lstSub = await AppManager.Instance.ProfileItems(subid);
|
||||||
foreach (var item in lstSub)
|
foreach (var item in lstSub)
|
||||||
{
|
{
|
||||||
var existItem = lstOriSub?.FirstOrDefault(t => config.UiItem.EnableUpdateSubOnlyRemarksExist ? t.Remarks == item.Remarks : CompareProfileItem(t, item, true));
|
var existItem = FindMatchedProfileItem(lstOriSub, item);
|
||||||
if (existItem != null)
|
if (existItem != null)
|
||||||
{
|
{
|
||||||
await StatisticsManager.Instance.CloneServerStatItem(existItem.IndexId, item.IndexId);
|
await StatisticsManager.Instance.CloneServerStatItem(existItem.IndexId, item.IndexId);
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,6 @@ public class MsgUIItem
|
||||||
public class UIItem
|
public class UIItem
|
||||||
{
|
{
|
||||||
public bool EnableAutoAdjustMainLvColWidth { get; set; }
|
public bool EnableAutoAdjustMainLvColWidth { get; set; }
|
||||||
public bool EnableUpdateSubOnlyRemarksExist { get; set; }
|
|
||||||
public int MainGirdHeight1 { get; set; }
|
public int MainGirdHeight1 { get; set; }
|
||||||
public int MainGirdHeight2 { get; set; }
|
public int MainGirdHeight2 { get; set; }
|
||||||
public EGirdOrientation MainGirdOrientation { get; set; } = EGirdOrientation.Vertical;
|
public EGirdOrientation MainGirdOrientation { get; set; } = EGirdOrientation.Vertical;
|
||||||
|
|
|
||||||
11
v2rayN/ServiceLib/Resx/ResUI.Designer.cs
generated
11
v2rayN/ServiceLib/Resx/ResUI.Designer.cs
generated
|
|
@ -3376,7 +3376,7 @@ namespace ServiceLib.Resx {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Process (Tun mode) 的本地化字符串。
|
/// 查找类似 Process (Linux/Windows) 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string TbRoutingRuleProcess {
|
public static string TbRoutingRuleProcess {
|
||||||
get {
|
get {
|
||||||
|
|
@ -3816,15 +3816,6 @@ namespace ServiceLib.Resx {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 Updating subscription, only determining if remarks exist 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
public static string TbSettingsEnableUpdateSubOnlyRemarksExist {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("TbSettingsEnableUpdateSubOnlyRemarksExist", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Exception 的本地化字符串。
|
/// 查找类似 Exception 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -1027,7 +1027,7 @@
|
||||||
<value>پروتکل sing-box Mux</value>
|
<value>پروتکل sing-box Mux</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbRoutingRuleProcess" xml:space="preserve">
|
<data name="TbRoutingRuleProcess" xml:space="preserve">
|
||||||
<value>Process (Tun mode)</value>
|
<value>Process (Linux/Windows)</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbRoutingRuleIP" xml:space="preserve">
|
<data name="TbRoutingRuleIP" xml:space="preserve">
|
||||||
<value>IP or IP CIDR</value>
|
<value>IP or IP CIDR</value>
|
||||||
|
|
@ -1098,9 +1098,6 @@
|
||||||
<data name="TbSettingsSpeedPingTestUrl" xml:space="preserve">
|
<data name="TbSettingsSpeedPingTestUrl" xml:space="preserve">
|
||||||
<value>آدرس اینترنتی تست پینگ سرعت</value>
|
<value>آدرس اینترنتی تست پینگ سرعت</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsEnableUpdateSubOnlyRemarksExist" xml:space="preserve">
|
|
||||||
<value>اشتراک در حال بهروزرسانی، فقط مشخص کنید که ملاحظاتی آیا وجود دارد!</value>
|
|
||||||
</data>
|
|
||||||
<data name="SpeedtestingStop" xml:space="preserve">
|
<data name="SpeedtestingStop" xml:space="preserve">
|
||||||
<value>پایان تست...</value>
|
<value>پایان تست...</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
||||||
|
|
@ -1024,7 +1024,7 @@
|
||||||
<value>Protocole de multiplexage Mux (sing-box)</value>
|
<value>Protocole de multiplexage Mux (sing-box)</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbRoutingRuleProcess" xml:space="preserve">
|
<data name="TbRoutingRuleProcess" xml:space="preserve">
|
||||||
<value>Process (Tun mode)</value>
|
<value>Process (Linux/Windows)</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbRoutingRuleIP" xml:space="preserve">
|
<data name="TbRoutingRuleIP" xml:space="preserve">
|
||||||
<value>IP ou IP CIDR</value>
|
<value>IP ou IP CIDR</value>
|
||||||
|
|
@ -1095,9 +1095,6 @@
|
||||||
<data name="TbSettingsSpeedPingTestUrl" xml:space="preserve">
|
<data name="TbSettingsSpeedPingTestUrl" xml:space="preserve">
|
||||||
<value>Adresse de test de connexion réelle</value>
|
<value>Adresse de test de connexion réelle</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsEnableUpdateSubOnlyRemarksExist" xml:space="preserve">
|
|
||||||
<value>Ne vérifier l’existence de l’alias qu’à la maj. des abonnements</value>
|
|
||||||
</data>
|
|
||||||
<data name="SpeedtestingStop" xml:space="preserve">
|
<data name="SpeedtestingStop" xml:space="preserve">
|
||||||
<value>Arrêt du test en cours...</value>
|
<value>Arrêt du test en cours...</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
||||||
|
|
@ -1027,7 +1027,7 @@
|
||||||
<value>sing-box Mux protokoll</value>
|
<value>sing-box Mux protokoll</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbRoutingRuleProcess" xml:space="preserve">
|
<data name="TbRoutingRuleProcess" xml:space="preserve">
|
||||||
<value>Process (Tun mode)</value>
|
<value>Process (Linux/Windows)</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbRoutingRuleIP" xml:space="preserve">
|
<data name="TbRoutingRuleIP" xml:space="preserve">
|
||||||
<value>IP vagy IP CIDR</value>
|
<value>IP vagy IP CIDR</value>
|
||||||
|
|
@ -1098,9 +1098,6 @@
|
||||||
<data name="TbSettingsSpeedPingTestUrl" xml:space="preserve">
|
<data name="TbSettingsSpeedPingTestUrl" xml:space="preserve">
|
||||||
<value>Sebesség Ping Teszt URL</value>
|
<value>Sebesség Ping Teszt URL</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsEnableUpdateSubOnlyRemarksExist" xml:space="preserve">
|
|
||||||
<value>Előfizetés frissítése, csak a megjegyzések létezésének ellenőrzése</value>
|
|
||||||
</data>
|
|
||||||
<data name="SpeedtestingStop" xml:space="preserve">
|
<data name="SpeedtestingStop" xml:space="preserve">
|
||||||
<value>Teszt megszakítása...</value>
|
<value>Teszt megszakítása...</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
||||||
|
|
@ -1027,7 +1027,7 @@
|
||||||
<value>sing-box Mux Protocol</value>
|
<value>sing-box Mux Protocol</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbRoutingRuleProcess" xml:space="preserve">
|
<data name="TbRoutingRuleProcess" xml:space="preserve">
|
||||||
<value>Process (Tun mode)</value>
|
<value>Process (Linux/Windows)</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbRoutingRuleIP" xml:space="preserve">
|
<data name="TbRoutingRuleIP" xml:space="preserve">
|
||||||
<value>IP or IP CIDR</value>
|
<value>IP or IP CIDR</value>
|
||||||
|
|
@ -1098,9 +1098,6 @@
|
||||||
<data name="TbSettingsSpeedPingTestUrl" xml:space="preserve">
|
<data name="TbSettingsSpeedPingTestUrl" xml:space="preserve">
|
||||||
<value>Speed Ping Test URL</value>
|
<value>Speed Ping Test URL</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsEnableUpdateSubOnlyRemarksExist" xml:space="preserve">
|
|
||||||
<value>Updating subscription, only determining if remarks exist</value>
|
|
||||||
</data>
|
|
||||||
<data name="SpeedtestingStop" xml:space="preserve">
|
<data name="SpeedtestingStop" xml:space="preserve">
|
||||||
<value>Test terminating...</value>
|
<value>Test terminating...</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
||||||
|
|
@ -1027,7 +1027,7 @@
|
||||||
<value>Протокол Mux для sing-box</value>
|
<value>Протокол Mux для sing-box</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbRoutingRuleProcess" xml:space="preserve">
|
<data name="TbRoutingRuleProcess" xml:space="preserve">
|
||||||
<value>Process (Tun mode)</value>
|
<value>Process (Linux/Windows)</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbRoutingRuleIP" xml:space="preserve">
|
<data name="TbRoutingRuleIP" xml:space="preserve">
|
||||||
<value>IP-адрес или сеть CIDR</value>
|
<value>IP-адрес или сеть CIDR</value>
|
||||||
|
|
@ -1098,9 +1098,6 @@
|
||||||
<data name="TbSettingsSpeedPingTestUrl" xml:space="preserve">
|
<data name="TbSettingsSpeedPingTestUrl" xml:space="preserve">
|
||||||
<value>URL для быстрой проверки реальной задержки</value>
|
<value>URL для быстрой проверки реальной задержки</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsEnableUpdateSubOnlyRemarksExist" xml:space="preserve">
|
|
||||||
<value>Обновляя подписку, проверять лишь наличие примечаний</value>
|
|
||||||
</data>
|
|
||||||
<data name="SpeedtestingStop" xml:space="preserve">
|
<data name="SpeedtestingStop" xml:space="preserve">
|
||||||
<value>Отмена тестирования...</value>
|
<value>Отмена тестирования...</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
||||||
|
|
@ -1024,7 +1024,7 @@
|
||||||
<value>sing-box Mux 多路复用协议</value>
|
<value>sing-box Mux 多路复用协议</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbRoutingRuleProcess" xml:space="preserve">
|
<data name="TbRoutingRuleProcess" xml:space="preserve">
|
||||||
<value>进程 (Tun 模式)</value>
|
<value>进程 (Linux/Windows)</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbRoutingRuleIP" xml:space="preserve">
|
<data name="TbRoutingRuleIP" xml:space="preserve">
|
||||||
<value>IP 或 IP CIDR</value>
|
<value>IP 或 IP CIDR</value>
|
||||||
|
|
@ -1095,9 +1095,6 @@
|
||||||
<data name="TbSettingsSpeedPingTestUrl" xml:space="preserve">
|
<data name="TbSettingsSpeedPingTestUrl" xml:space="preserve">
|
||||||
<value>真连接测试地址</value>
|
<value>真连接测试地址</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsEnableUpdateSubOnlyRemarksExist" xml:space="preserve">
|
|
||||||
<value>更新订阅时只判断别名已存在否</value>
|
|
||||||
</data>
|
|
||||||
<data name="SpeedtestingStop" xml:space="preserve">
|
<data name="SpeedtestingStop" xml:space="preserve">
|
||||||
<value>测试终止中...</value>
|
<value>测试终止中...</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
||||||
|
|
@ -1024,7 +1024,7 @@
|
||||||
<value>sing-box Mux 多路復用協定</value>
|
<value>sing-box Mux 多路復用協定</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbRoutingRuleProcess" xml:space="preserve">
|
<data name="TbRoutingRuleProcess" xml:space="preserve">
|
||||||
<value>行程 (Tun 模式)</value>
|
<value>行程 (Linux/Windows)</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbRoutingRuleIP" xml:space="preserve">
|
<data name="TbRoutingRuleIP" xml:space="preserve">
|
||||||
<value>IP 或 IP CIDR</value>
|
<value>IP 或 IP CIDR</value>
|
||||||
|
|
@ -1095,9 +1095,6 @@
|
||||||
<data name="TbSettingsSpeedPingTestUrl" xml:space="preserve">
|
<data name="TbSettingsSpeedPingTestUrl" xml:space="preserve">
|
||||||
<value>真連線測試位址</value>
|
<value>真連線測試位址</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="TbSettingsEnableUpdateSubOnlyRemarksExist" xml:space="preserve">
|
|
||||||
<value>更新訂閱時只判斷別名是否存在</value>
|
|
||||||
</data>
|
|
||||||
<data name="SpeedtestingStop" xml:space="preserve">
|
<data name="SpeedtestingStop" xml:space="preserve">
|
||||||
<value>測試終止中...</value>
|
<value>測試終止中...</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,7 @@ public class CheckUpdateViewModel : MyReactiveObject
|
||||||
|
|
||||||
private async Task UpdateFinishedSub(bool blReload)
|
private async Task UpdateFinishedSub(bool blReload)
|
||||||
{
|
{
|
||||||
RxApp.MainThreadScheduler.Schedule(blReload, (scheduler, blReload) =>
|
RxSchedulers.MainThreadScheduler.Schedule(blReload, (scheduler, blReload) =>
|
||||||
{
|
{
|
||||||
_ = UpdateFinishedResult(blReload);
|
_ = UpdateFinishedResult(blReload);
|
||||||
return Disposable.Empty;
|
return Disposable.Empty;
|
||||||
|
|
@ -317,7 +317,7 @@ public class CheckUpdateViewModel : MyReactiveObject
|
||||||
Remarks = msg,
|
Remarks = msg,
|
||||||
};
|
};
|
||||||
|
|
||||||
RxApp.MainThreadScheduler.Schedule(item, (scheduler, model) =>
|
RxSchedulers.MainThreadScheduler.Schedule(item, (scheduler, model) =>
|
||||||
{
|
{
|
||||||
_ = UpdateViewResult(model);
|
_ = UpdateViewResult(model);
|
||||||
return Disposable.Empty;
|
return Disposable.Empty;
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ public class ClashConnectionsViewModel : MyReactiveObject
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
RxApp.MainThreadScheduler.Schedule(ret?.connections, (scheduler, model) =>
|
RxSchedulers.MainThreadScheduler.Schedule(ret?.connections, (scheduler, model) =>
|
||||||
{
|
{
|
||||||
_ = RefreshConnections(model);
|
_ = RefreshConnections(model);
|
||||||
return Disposable.Empty;
|
return Disposable.Empty;
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ public class ClashProxiesViewModel : MyReactiveObject
|
||||||
|
|
||||||
AppEvents.ProxiesReloadRequested
|
AppEvents.ProxiesReloadRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
.ObserveOn(RxApp.MainThreadScheduler)
|
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(async _ => await ProxiesReload());
|
.Subscribe(async _ => await ProxiesReload());
|
||||||
|
|
||||||
#endregion AppEvents
|
#endregion AppEvents
|
||||||
|
|
@ -173,7 +173,7 @@ public class ClashProxiesViewModel : MyReactiveObject
|
||||||
|
|
||||||
if (refreshUI)
|
if (refreshUI)
|
||||||
{
|
{
|
||||||
RxApp.MainThreadScheduler.Schedule(() => _ = RefreshProxyGroups());
|
RxSchedulers.MainThreadScheduler.Schedule(() => _ = RefreshProxyGroups());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -387,7 +387,7 @@ public class ClashProxiesViewModel : MyReactiveObject
|
||||||
}
|
}
|
||||||
|
|
||||||
var model = new SpeedTestResult() { IndexId = item.Name, Delay = result };
|
var model = new SpeedTestResult() { IndexId = item.Name, Delay = result };
|
||||||
RxApp.MainThreadScheduler.Schedule(model, (scheduler, model) =>
|
RxSchedulers.MainThreadScheduler.Schedule(model, (scheduler, model) =>
|
||||||
{
|
{
|
||||||
_ = ProxiesDelayTestResult(model);
|
_ = ProxiesDelayTestResult(model);
|
||||||
return Disposable.Empty;
|
return Disposable.Empty;
|
||||||
|
|
|
||||||
|
|
@ -228,22 +228,22 @@ public class MainWindowViewModel : MyReactiveObject
|
||||||
|
|
||||||
AppEvents.ReloadRequested
|
AppEvents.ReloadRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
.ObserveOn(RxApp.MainThreadScheduler)
|
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(async _ => await Reload());
|
.Subscribe(async _ => await Reload());
|
||||||
|
|
||||||
AppEvents.AddServerViaScanRequested
|
AppEvents.AddServerViaScanRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
.ObserveOn(RxApp.MainThreadScheduler)
|
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(async _ => await AddServerViaScanAsync());
|
.Subscribe(async _ => await AddServerViaScanAsync());
|
||||||
|
|
||||||
AppEvents.AddServerViaClipboardRequested
|
AppEvents.AddServerViaClipboardRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
.ObserveOn(RxApp.MainThreadScheduler)
|
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(async _ => await AddServerViaClipboardAsync(null));
|
.Subscribe(async _ => await AddServerViaClipboardAsync(null));
|
||||||
|
|
||||||
AppEvents.SubscriptionsUpdateRequested
|
AppEvents.SubscriptionsUpdateRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
.ObserveOn(RxApp.MainThreadScheduler)
|
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(async blProxy => await UpdateSubscriptionProcess("", blProxy));
|
.Subscribe(async blProxy => await UpdateSubscriptionProcess("", blProxy));
|
||||||
|
|
||||||
#endregion AppEvents
|
#endregion AppEvents
|
||||||
|
|
@ -583,7 +583,7 @@ public class MainWindowViewModel : MyReactiveObject
|
||||||
|
|
||||||
private void ReloadResult(bool showClashUI)
|
private void ReloadResult(bool showClashUI)
|
||||||
{
|
{
|
||||||
RxApp.MainThreadScheduler.Schedule(() =>
|
RxSchedulers.MainThreadScheduler.Schedule(() =>
|
||||||
{
|
{
|
||||||
ShowClashUI = showClashUI;
|
ShowClashUI = showClashUI;
|
||||||
TabMainSelectedIndex = showClashUI ? TabMainSelectedIndex : 0;
|
TabMainSelectedIndex = showClashUI ? TabMainSelectedIndex : 0;
|
||||||
|
|
@ -592,7 +592,7 @@ public class MainWindowViewModel : MyReactiveObject
|
||||||
|
|
||||||
private void SetReloadEnabled(bool enabled)
|
private void SetReloadEnabled(bool enabled)
|
||||||
{
|
{
|
||||||
RxApp.MainThreadScheduler.Schedule(() => BlReloadEnabled = enabled);
|
RxSchedulers.MainThreadScheduler.Schedule(() => BlReloadEnabled = enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task LoadCore(CoreConfigContext? mainContext, CoreConfigContext? preContext)
|
private async Task LoadCore(CoreConfigContext? mainContext, CoreConfigContext? preContext)
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ public class MsgViewModel : MyReactiveObject
|
||||||
|
|
||||||
AppEvents.SendMsgViewRequested
|
AppEvents.SendMsgViewRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
//.ObserveOn(RxApp.MainThreadScheduler)
|
//.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(content => _ = AppendQueueMsg(content));
|
.Subscribe(content => _ = AppendQueueMsg(content));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,6 @@ public class OptionSettingViewModel : MyReactiveObject
|
||||||
[Reactive] public bool KeepOlderDedupl { get; set; }
|
[Reactive] public bool KeepOlderDedupl { get; set; }
|
||||||
[Reactive] public bool DisplayRealTimeSpeed { get; set; }
|
[Reactive] public bool DisplayRealTimeSpeed { get; set; }
|
||||||
[Reactive] public bool EnableAutoAdjustMainLvColWidth { get; set; }
|
[Reactive] public bool EnableAutoAdjustMainLvColWidth { get; set; }
|
||||||
[Reactive] public bool EnableUpdateSubOnlyRemarksExist { get; set; }
|
|
||||||
[Reactive] public bool AutoHideStartup { get; set; }
|
[Reactive] public bool AutoHideStartup { get; set; }
|
||||||
[Reactive] public bool Hide2TrayWhenClose { get; set; }
|
[Reactive] public bool Hide2TrayWhenClose { get; set; }
|
||||||
[Reactive] public bool MacOSShowInDock { get; set; }
|
[Reactive] public bool MacOSShowInDock { get; set; }
|
||||||
|
|
@ -180,7 +179,6 @@ public class OptionSettingViewModel : MyReactiveObject
|
||||||
DisplayRealTimeSpeed = _config.GuiItem.DisplayRealTimeSpeed;
|
DisplayRealTimeSpeed = _config.GuiItem.DisplayRealTimeSpeed;
|
||||||
KeepOlderDedupl = _config.GuiItem.KeepOlderDedupl;
|
KeepOlderDedupl = _config.GuiItem.KeepOlderDedupl;
|
||||||
EnableAutoAdjustMainLvColWidth = _config.UiItem.EnableAutoAdjustMainLvColWidth;
|
EnableAutoAdjustMainLvColWidth = _config.UiItem.EnableAutoAdjustMainLvColWidth;
|
||||||
EnableUpdateSubOnlyRemarksExist = _config.UiItem.EnableUpdateSubOnlyRemarksExist;
|
|
||||||
AutoHideStartup = _config.UiItem.AutoHideStartup;
|
AutoHideStartup = _config.UiItem.AutoHideStartup;
|
||||||
Hide2TrayWhenClose = _config.UiItem.Hide2TrayWhenClose;
|
Hide2TrayWhenClose = _config.UiItem.Hide2TrayWhenClose;
|
||||||
MacOSShowInDock = _config.UiItem.MacOSShowInDock;
|
MacOSShowInDock = _config.UiItem.MacOSShowInDock;
|
||||||
|
|
@ -345,7 +343,6 @@ public class OptionSettingViewModel : MyReactiveObject
|
||||||
_config.GuiItem.DisplayRealTimeSpeed = DisplayRealTimeSpeed;
|
_config.GuiItem.DisplayRealTimeSpeed = DisplayRealTimeSpeed;
|
||||||
_config.GuiItem.KeepOlderDedupl = KeepOlderDedupl;
|
_config.GuiItem.KeepOlderDedupl = KeepOlderDedupl;
|
||||||
_config.UiItem.EnableAutoAdjustMainLvColWidth = EnableAutoAdjustMainLvColWidth;
|
_config.UiItem.EnableAutoAdjustMainLvColWidth = EnableAutoAdjustMainLvColWidth;
|
||||||
_config.UiItem.EnableUpdateSubOnlyRemarksExist = EnableUpdateSubOnlyRemarksExist;
|
|
||||||
_config.UiItem.AutoHideStartup = AutoHideStartup;
|
_config.UiItem.AutoHideStartup = AutoHideStartup;
|
||||||
_config.UiItem.Hide2TrayWhenClose = Hide2TrayWhenClose;
|
_config.UiItem.Hide2TrayWhenClose = Hide2TrayWhenClose;
|
||||||
_config.UiItem.MacOSShowInDock = MacOSShowInDock;
|
_config.UiItem.MacOSShowInDock = MacOSShowInDock;
|
||||||
|
|
|
||||||
|
|
@ -188,14 +188,9 @@ public class ProfilesSelectViewModel : MyReactiveObject
|
||||||
{
|
{
|
||||||
SubItems.Add(item);
|
SubItems.Add(item);
|
||||||
}
|
}
|
||||||
if (_subIndexId != null && SubItems.FirstOrDefault(t => t.Id == _subIndexId) != null)
|
SelectedSub = (_config.SubIndexId.IsNotEmpty()
|
||||||
{
|
? SubItems.FirstOrDefault(t => t.Id == _config.SubIndexId)
|
||||||
SelectedSub = SubItems.FirstOrDefault(t => t.Id == _subIndexId);
|
: null) ?? SubItems.LastOrDefault();
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SelectedSub = SubItems.First();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<List<ProfileItemModel>?> GetProfileItemsEx(string subid, string filter)
|
private async Task<List<ProfileItemModel>?> GetProfileItemsEx(string subid, string filter)
|
||||||
|
|
|
||||||
|
|
@ -228,22 +228,22 @@ public class ProfilesViewModel : MyReactiveObject
|
||||||
|
|
||||||
AppEvents.ProfilesRefreshRequested
|
AppEvents.ProfilesRefreshRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
.ObserveOn(RxApp.MainThreadScheduler)
|
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(async _ => await RefreshServersBiz());
|
.Subscribe(async _ => await RefreshServersBiz());
|
||||||
|
|
||||||
AppEvents.SubscriptionsRefreshRequested
|
AppEvents.SubscriptionsRefreshRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
.ObserveOn(RxApp.MainThreadScheduler)
|
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(async _ => await RefreshSubscriptions());
|
.Subscribe(async _ => await RefreshSubscriptions());
|
||||||
|
|
||||||
AppEvents.DispatcherStatisticsRequested
|
AppEvents.DispatcherStatisticsRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
.ObserveOn(RxApp.MainThreadScheduler)
|
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(async result => await UpdateStatistics(result));
|
.Subscribe(async result => await UpdateStatistics(result));
|
||||||
|
|
||||||
AppEvents.SetDefaultServerRequested
|
AppEvents.SetDefaultServerRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
.ObserveOn(RxApp.MainThreadScheduler)
|
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(async indexId => await SetDefaultServer(indexId));
|
.Subscribe(async indexId => await SetDefaultServer(indexId));
|
||||||
|
|
||||||
#endregion AppEvents
|
#endregion AppEvents
|
||||||
|
|
@ -391,14 +391,9 @@ public class ProfilesViewModel : MyReactiveObject
|
||||||
{
|
{
|
||||||
SubItems.Add(item);
|
SubItems.Add(item);
|
||||||
}
|
}
|
||||||
if (_config.SubIndexId != null && SubItems.FirstOrDefault(t => t.Id == _config.SubIndexId) != null)
|
SelectedSub = (_config.SubIndexId.IsNotEmpty()
|
||||||
{
|
? SubItems.FirstOrDefault(t => t.Id == _config.SubIndexId)
|
||||||
SelectedSub = SubItems.FirstOrDefault(t => t.Id == _config.SubIndexId);
|
: null) ?? SubItems.LastOrDefault();
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SelectedSub = SubItems.First();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<List<ProfileItemModel>?> GetProfileItemsEx(string subid, string filter)
|
private async Task<List<ProfileItemModel>?> GetProfileItemsEx(string subid, string filter)
|
||||||
|
|
@ -732,7 +727,7 @@ public class ProfilesViewModel : MyReactiveObject
|
||||||
|
|
||||||
_speedtestService ??= new SpeedtestService(_config, async (SpeedTestResult result) =>
|
_speedtestService ??= new SpeedtestService(_config, async (SpeedTestResult result) =>
|
||||||
{
|
{
|
||||||
RxApp.MainThreadScheduler.Schedule(result, (scheduler, result) =>
|
RxSchedulers.MainThreadScheduler.Schedule(result, (scheduler, result) =>
|
||||||
{
|
{
|
||||||
_ = SetSpeedTestResult(result);
|
_ = SetSpeedTestResult(result);
|
||||||
return Disposable.Empty;
|
return Disposable.Empty;
|
||||||
|
|
|
||||||
|
|
@ -200,27 +200,27 @@ public class StatusBarViewModel : MyReactiveObject
|
||||||
|
|
||||||
AppEvents.DispatcherStatisticsRequested
|
AppEvents.DispatcherStatisticsRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
.ObserveOn(RxApp.MainThreadScheduler)
|
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(async result => await UpdateStatistics(result));
|
.Subscribe(async result => await UpdateStatistics(result));
|
||||||
|
|
||||||
AppEvents.RoutingsMenuRefreshRequested
|
AppEvents.RoutingsMenuRefreshRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
.ObserveOn(RxApp.MainThreadScheduler)
|
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(async _ => await RefreshRoutingsMenu());
|
.Subscribe(async _ => await RefreshRoutingsMenu());
|
||||||
|
|
||||||
AppEvents.TestServerRequested
|
AppEvents.TestServerRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
.ObserveOn(RxApp.MainThreadScheduler)
|
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(async _ => await TestServerAvailability());
|
.Subscribe(async _ => await TestServerAvailability());
|
||||||
|
|
||||||
AppEvents.InboundDisplayRequested
|
AppEvents.InboundDisplayRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
.ObserveOn(RxApp.MainThreadScheduler)
|
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(async _ => await InboundDisplayStatus());
|
.Subscribe(async _ => await InboundDisplayStatus());
|
||||||
|
|
||||||
AppEvents.SysProxyChangeRequested
|
AppEvents.SysProxyChangeRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
.ObserveOn(RxApp.MainThreadScheduler)
|
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(async result => await SetListenerType(result));
|
.Subscribe(async result => await SetListenerType(result));
|
||||||
|
|
||||||
#endregion AppEvents
|
#endregion AppEvents
|
||||||
|
|
@ -243,7 +243,7 @@ public class StatusBarViewModel : MyReactiveObject
|
||||||
{
|
{
|
||||||
AppEvents.ProfilesRefreshRequested
|
AppEvents.ProfilesRefreshRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
.ObserveOn(RxApp.MainThreadScheduler)
|
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(async _ => await RefreshServersBiz()); //.DisposeWith(_disposables);
|
.Subscribe(async _ => await RefreshServersBiz()); //.DisposeWith(_disposables);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -362,7 +362,7 @@ public class StatusBarViewModel : MyReactiveObject
|
||||||
|
|
||||||
private async Task TestServerAvailabilitySub(string msg)
|
private async Task TestServerAvailabilitySub(string msg)
|
||||||
{
|
{
|
||||||
RxApp.MainThreadScheduler.Schedule(msg, (scheduler, msg) =>
|
RxSchedulers.MainThreadScheduler.Schedule(msg, (scheduler, msg) =>
|
||||||
{
|
{
|
||||||
_ = TestServerAvailabilityResult(msg);
|
_ = TestServerAvailabilityResult(msg);
|
||||||
return Disposable.Empty;
|
return Disposable.Empty;
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ internal class Program
|
||||||
//.WithInterFont()
|
//.WithInterFont()
|
||||||
.WithFontByDefault()
|
.WithFontByDefault()
|
||||||
.LogToTrace()
|
.LogToTrace()
|
||||||
.UseReactiveUI();
|
.UseReactiveUI(_ => { });
|
||||||
|
|
||||||
if (OperatingSystem.IsMacOS())
|
if (OperatingSystem.IsMacOS())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ public partial class ClashConnectionsView : ReactiveUserControl<ClashConnections
|
||||||
|
|
||||||
AppEvents.AppExitRequested
|
AppEvents.AppExitRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
.ObserveOn(RxApp.MainThreadScheduler)
|
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(_ => StorageUI())
|
.Subscribe(_ => StorageUI())
|
||||||
.DisposeWith(disposables);
|
.DisposeWith(disposables);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -128,25 +128,25 @@ public partial class MainWindow : WindowBase<MainWindowViewModel>
|
||||||
|
|
||||||
AppEvents.SendSnackMsgRequested
|
AppEvents.SendSnackMsgRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
.ObserveOn(RxApp.MainThreadScheduler)
|
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(async content => await DelegateSnackMsg(content))
|
.Subscribe(async content => await DelegateSnackMsg(content))
|
||||||
.DisposeWith(disposables);
|
.DisposeWith(disposables);
|
||||||
|
|
||||||
AppEvents.AppExitRequested
|
AppEvents.AppExitRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
.ObserveOn(RxApp.MainThreadScheduler)
|
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(_ => StorageUI())
|
.Subscribe(_ => StorageUI())
|
||||||
.DisposeWith(disposables);
|
.DisposeWith(disposables);
|
||||||
|
|
||||||
AppEvents.ShutdownRequested
|
AppEvents.ShutdownRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
.ObserveOn(RxApp.MainThreadScheduler)
|
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(content => Shutdown(content))
|
.Subscribe(content => Shutdown(content))
|
||||||
.DisposeWith(disposables);
|
.DisposeWith(disposables);
|
||||||
|
|
||||||
AppEvents.ShowHideWindowRequested
|
AppEvents.ShowHideWindowRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
.ObserveOn(RxApp.MainThreadScheduler)
|
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(blShow => ShowHideWindow(blShow))
|
.Subscribe(blShow => ShowHideWindow(blShow))
|
||||||
.DisposeWith(disposables);
|
.DisposeWith(disposables);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -410,19 +410,6 @@
|
||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
HorizontalAlignment="Left" />
|
HorizontalAlignment="Left" />
|
||||||
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="6"
|
|
||||||
Grid.Column="0"
|
|
||||||
Margin="{StaticResource Margin4}"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{x:Static resx:ResUI.TbSettingsEnableUpdateSubOnlyRemarksExist}" />
|
|
||||||
<ToggleSwitch
|
|
||||||
x:Name="togEnableUpdateSubOnlyRemarksExist"
|
|
||||||
Grid.Row="6"
|
|
||||||
Grid.Column="1"
|
|
||||||
Margin="{StaticResource Margin4}"
|
|
||||||
HorizontalAlignment="Left" />
|
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="8"
|
Grid.Row="8"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,6 @@ public partial class OptionSettingWindow : WindowBase<OptionSettingViewModel>
|
||||||
this.Bind(ViewModel, vm => vm.DisplayRealTimeSpeed, v => v.togDisplayRealTimeSpeed.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.DisplayRealTimeSpeed, v => v.togDisplayRealTimeSpeed.IsChecked).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.KeepOlderDedupl, v => v.togKeepOlderDedupl.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.KeepOlderDedupl, v => v.togKeepOlderDedupl.IsChecked).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.EnableAutoAdjustMainLvColWidth, v => v.togEnableAutoAdjustMainLvColWidth.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.EnableAutoAdjustMainLvColWidth, v => v.togEnableAutoAdjustMainLvColWidth.IsChecked).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.EnableUpdateSubOnlyRemarksExist, v => v.togEnableUpdateSubOnlyRemarksExist.IsChecked).DisposeWith(disposables);
|
|
||||||
this.Bind(ViewModel, vm => vm.AutoHideStartup, v => v.togAutoHideStartup.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.AutoHideStartup, v => v.togAutoHideStartup.IsChecked).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.Hide2TrayWhenClose, v => v.togHide2TrayWhenClose.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.Hide2TrayWhenClose, v => v.togHide2TrayWhenClose.IsChecked).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.MacOSShowInDock, v => v.togMacOSShowInDock.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.MacOSShowInDock, v => v.togMacOSShowInDock.IsChecked).DisposeWith(disposables);
|
||||||
|
|
|
||||||
|
|
@ -90,13 +90,13 @@ public partial class ProfilesView : ReactiveUserControl<ProfilesViewModel>
|
||||||
|
|
||||||
AppEvents.AppExitRequested
|
AppEvents.AppExitRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
.ObserveOn(RxApp.MainThreadScheduler)
|
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(_ => StorageUI())
|
.Subscribe(_ => StorageUI())
|
||||||
.DisposeWith(disposables);
|
.DisposeWith(disposables);
|
||||||
|
|
||||||
AppEvents.AdjustMainLvColWidthRequested
|
AppEvents.AdjustMainLvColWidthRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
.ObserveOn(RxApp.MainThreadScheduler)
|
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(_ => AutofitColumnWidth())
|
.Subscribe(_ => AutofitColumnWidth())
|
||||||
.DisposeWith(disposables);
|
.DisposeWith(disposables);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,11 @@ public partial class App : Application
|
||||||
}
|
}
|
||||||
|
|
||||||
AppManager.Instance.InitComponents();
|
AppManager.Instance.InitComponents();
|
||||||
|
|
||||||
|
RxAppBuilder.CreateReactiveUIBuilder()
|
||||||
|
.WithWpf()
|
||||||
|
.BuildApp();
|
||||||
|
|
||||||
base.OnStartup(e);
|
base.OnStartup(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ global using System.Windows.Threading;
|
||||||
global using DynamicData;
|
global using DynamicData;
|
||||||
global using DynamicData.Binding;
|
global using DynamicData.Binding;
|
||||||
global using ReactiveUI;
|
global using ReactiveUI;
|
||||||
|
global using ReactiveUI.Builder;
|
||||||
global using ReactiveUI.Fody.Helpers;
|
global using ReactiveUI.Fody.Helpers;
|
||||||
global using ServiceLib;
|
global using ServiceLib;
|
||||||
global using ServiceLib.Base;
|
global using ServiceLib.Base;
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ public partial class ClashConnectionsView
|
||||||
|
|
||||||
AppEvents.AppExitRequested
|
AppEvents.AppExitRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
.ObserveOn(RxApp.MainThreadScheduler)
|
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(_ => StorageUI())
|
.Subscribe(_ => StorageUI())
|
||||||
.DisposeWith(disposables);
|
.DisposeWith(disposables);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -127,25 +127,25 @@ public partial class MainWindow
|
||||||
|
|
||||||
AppEvents.SendSnackMsgRequested
|
AppEvents.SendSnackMsgRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
.ObserveOn(RxApp.MainThreadScheduler)
|
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(async content => await DelegateSnackMsg(content))
|
.Subscribe(async content => await DelegateSnackMsg(content))
|
||||||
.DisposeWith(disposables);
|
.DisposeWith(disposables);
|
||||||
|
|
||||||
AppEvents.AppExitRequested
|
AppEvents.AppExitRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
.ObserveOn(RxApp.MainThreadScheduler)
|
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(_ => StorageUI())
|
.Subscribe(_ => StorageUI())
|
||||||
.DisposeWith(disposables);
|
.DisposeWith(disposables);
|
||||||
|
|
||||||
AppEvents.ShutdownRequested
|
AppEvents.ShutdownRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
.ObserveOn(RxApp.MainThreadScheduler)
|
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(content => Shutdown(content))
|
.Subscribe(content => Shutdown(content))
|
||||||
.DisposeWith(disposables);
|
.DisposeWith(disposables);
|
||||||
|
|
||||||
AppEvents.ShowHideWindowRequested
|
AppEvents.ShowHideWindowRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
.ObserveOn(RxApp.MainThreadScheduler)
|
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(blShow => ShowHideWindow(blShow))
|
.Subscribe(blShow => ShowHideWindow(blShow))
|
||||||
.DisposeWith(disposables);
|
.DisposeWith(disposables);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -630,20 +630,6 @@
|
||||||
Margin="{StaticResource Margin8}"
|
Margin="{StaticResource Margin8}"
|
||||||
HorizontalAlignment="Left" />
|
HorizontalAlignment="Left" />
|
||||||
|
|
||||||
<TextBlock
|
|
||||||
Grid.Row="6"
|
|
||||||
Grid.Column="0"
|
|
||||||
Margin="{StaticResource Margin8}"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Style="{StaticResource ToolbarTextBlock}"
|
|
||||||
Text="{x:Static resx:ResUI.TbSettingsEnableUpdateSubOnlyRemarksExist}" />
|
|
||||||
<ToggleButton
|
|
||||||
x:Name="togEnableUpdateSubOnlyRemarksExist"
|
|
||||||
Grid.Row="6"
|
|
||||||
Grid.Column="1"
|
|
||||||
Margin="{StaticResource Margin8}"
|
|
||||||
HorizontalAlignment="Left" />
|
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="8"
|
Grid.Row="8"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,6 @@ public partial class OptionSettingWindow
|
||||||
this.Bind(ViewModel, vm => vm.DisplayRealTimeSpeed, v => v.togDisplayRealTimeSpeed.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.DisplayRealTimeSpeed, v => v.togDisplayRealTimeSpeed.IsChecked).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.KeepOlderDedupl, v => v.togKeepOlderDedupl.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.KeepOlderDedupl, v => v.togKeepOlderDedupl.IsChecked).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.EnableAutoAdjustMainLvColWidth, v => v.togEnableAutoAdjustMainLvColWidth.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.EnableAutoAdjustMainLvColWidth, v => v.togEnableAutoAdjustMainLvColWidth.IsChecked).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.EnableUpdateSubOnlyRemarksExist, v => v.togEnableUpdateSubOnlyRemarksExist.IsChecked).DisposeWith(disposables);
|
|
||||||
this.Bind(ViewModel, vm => vm.AutoHideStartup, v => v.togAutoHideStartup.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.AutoHideStartup, v => v.togAutoHideStartup.IsChecked).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.EnableDragDropSort, v => v.togEnableDragDropSort.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.EnableDragDropSort, v => v.togEnableDragDropSort.IsChecked).DisposeWith(disposables);
|
||||||
this.Bind(ViewModel, vm => vm.DoubleClick2Activate, v => v.togDoubleClick2Activate.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.DoubleClick2Activate, v => v.togDoubleClick2Activate.IsChecked).DisposeWith(disposables);
|
||||||
|
|
|
||||||
|
|
@ -84,13 +84,13 @@ public partial class ProfilesView
|
||||||
|
|
||||||
AppEvents.AppExitRequested
|
AppEvents.AppExitRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
.ObserveOn(RxApp.MainThreadScheduler)
|
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(_ => StorageUI())
|
.Subscribe(_ => StorageUI())
|
||||||
.DisposeWith(disposables);
|
.DisposeWith(disposables);
|
||||||
|
|
||||||
AppEvents.AdjustMainLvColWidthRequested
|
AppEvents.AdjustMainLvColWidthRequested
|
||||||
.AsObservable()
|
.AsObservable()
|
||||||
.ObserveOn(RxApp.MainThreadScheduler)
|
.ObserveOn(RxSchedulers.MainThreadScheduler)
|
||||||
.Subscribe(_ => AutofitColumnWidth())
|
.Subscribe(_ => AutofitColumnWidth())
|
||||||
.DisposeWith(disposables);
|
.DisposeWith(disposables);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
<TargetFramework>net8.0-windows10.0.17763</TargetFramework>
|
<TargetFramework>net8.0-windows10.0.19041.0</TargetFramework>
|
||||||
<GenerateSatelliteAssembliesForCore>true</GenerateSatelliteAssembliesForCore>
|
<GenerateSatelliteAssembliesForCore>true</GenerateSatelliteAssembliesForCore>
|
||||||
<UseWPF>true</UseWPF>
|
<UseWPF>true</UseWPF>
|
||||||
<ApplicationIcon>Resources\v2rayN.ico</ApplicationIcon>
|
<ApplicationIcon>Resources\v2rayN.ico</ApplicationIcon>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue