mirror of https://github.com/2dust/v2rayN
parent
2edbbc523a
commit
9c4dc185be
|
@ -116,18 +116,16 @@
|
||||||
|
|
||||||
public static readonly List<string> GeoFilesSources = new() {
|
public static readonly List<string> GeoFilesSources = new() {
|
||||||
"",
|
"",
|
||||||
GeoUrl,
|
|
||||||
@"https://github.com/runetfreedom/russia-v2ray-rules-dat/releases/latest/download/{0}.dat",
|
@"https://github.com/runetfreedom/russia-v2ray-rules-dat/releases/latest/download/{0}.dat",
|
||||||
};
|
};
|
||||||
|
|
||||||
public static readonly List<string> SingboxRulesetSources = new() {
|
public static readonly List<string> SingboxRulesetSources = new() {
|
||||||
"",
|
"",
|
||||||
SingboxRulesetUrl,
|
|
||||||
@"https://raw.githubusercontent.com/runetfreedom/russia-v2ray-rules-dat/refs/heads/release/sing-box/rule-set-{0}/{1}.srs",
|
@"https://raw.githubusercontent.com/runetfreedom/russia-v2ray-rules-dat/refs/heads/release/sing-box/rule-set-{0}/{1}.srs",
|
||||||
};
|
};
|
||||||
|
|
||||||
public static readonly List<string> RoutingRulesSources = new() {
|
public static readonly List<string> RoutingRulesSources = new() {
|
||||||
"", //Default
|
"",
|
||||||
@"https://raw.githubusercontent.com/runetfreedom/russia-v2ray-custom-routing-list/refs/heads/main/template.json",
|
@"https://raw.githubusercontent.com/runetfreedom/russia-v2ray-custom-routing-list/refs/heads/main/template.json",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
using ServiceLib.Common;
|
using System.Data;
|
||||||
using System.Data;
|
|
||||||
using System.Text.Json.Nodes;
|
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
namespace ServiceLib.Handler
|
namespace ServiceLib.Handler
|
||||||
|
@ -1620,24 +1618,13 @@ namespace ServiceLib.Handler
|
||||||
|
|
||||||
public static int InitRouting(Config config, bool blImportAdvancedRules = false)
|
public static int InitRouting(Config config, bool blImportAdvancedRules = false)
|
||||||
{
|
{
|
||||||
if (!String.IsNullOrEmpty(config.constItem.routeRulesTemplateSourceUrl))
|
if (string.IsNullOrEmpty(config.constItem.routeRulesTemplateSourceUrl))
|
||||||
{
|
|
||||||
InitExternalRouting(config, blImportAdvancedRules);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
InitBuiltinRouting(config, blImportAdvancedRules);
|
InitBuiltinRouting(config, blImportAdvancedRules);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
if (GetLockedRoutingItem(config) == null)
|
|
||||||
{
|
{
|
||||||
var item1 = new RoutingItem()
|
InitExternalRouting(config, blImportAdvancedRules);
|
||||||
{
|
|
||||||
remarks = "locked",
|
|
||||||
url = string.Empty,
|
|
||||||
locked = true,
|
|
||||||
};
|
|
||||||
AddBatchRoutingRules(ref item1, Utils.GetEmbedText(Global.CustomRoutingFileName + "locked"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1645,10 +1632,10 @@ namespace ServiceLib.Handler
|
||||||
|
|
||||||
public static int InitExternalRouting(Config config, bool blImportAdvancedRules = false)
|
public static int InitExternalRouting(Config config, bool blImportAdvancedRules = false)
|
||||||
{
|
{
|
||||||
DownloadService downloadHandle = new DownloadService();
|
var downloadHandle = new DownloadService();
|
||||||
var templateContent = Task.Run(() => downloadHandle.TryDownloadString(config.constItem.routeRulesTemplateSourceUrl, false, "")).Result;
|
var templateContent = Task.Run(() => downloadHandle.TryDownloadString(config.constItem.routeRulesTemplateSourceUrl, false, "")).Result;
|
||||||
if (String.IsNullOrEmpty(templateContent))
|
if (String.IsNullOrEmpty(templateContent))
|
||||||
return InitBuiltinRouting(config, blImportAdvancedRules); // fallback
|
return InitBuiltinRouting(config, blImportAdvancedRules); // fallback
|
||||||
|
|
||||||
var template = JsonUtils.Deserialize<RoutingTemplate>(templateContent);
|
var template = JsonUtils.Deserialize<RoutingTemplate>(templateContent);
|
||||||
if (template == null)
|
if (template == null)
|
||||||
|
@ -1656,35 +1643,35 @@ namespace ServiceLib.Handler
|
||||||
|
|
||||||
var items = AppHandler.Instance.RoutingItems();
|
var items = AppHandler.Instance.RoutingItems();
|
||||||
var maxSort = items.Count;
|
var maxSort = items.Count;
|
||||||
|
if (!blImportAdvancedRules && items.Where(t => t.remarks.StartsWith(template.version)).ToList().Count > 0)
|
||||||
if (blImportAdvancedRules || items.Where(t => t.remarks.StartsWith(template.version)).ToList().Count <= 0)
|
|
||||||
{
|
{
|
||||||
for (var i = 0; i < template.routingItems.Length; i++)
|
return 0;
|
||||||
|
}
|
||||||
|
for (var i = 0; i < template.routingItems.Length; i++)
|
||||||
|
{
|
||||||
|
var item = template.routingItems[i];
|
||||||
|
|
||||||
|
if (String.IsNullOrEmpty(item.url) && String.IsNullOrEmpty(item.ruleSet))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
var ruleSetsString = !String.IsNullOrEmpty(item.ruleSet)
|
||||||
|
? item.ruleSet
|
||||||
|
: Task.Run(() => downloadHandle.TryDownloadString(item.url, false, "")).Result;
|
||||||
|
|
||||||
|
if (String.IsNullOrEmpty(ruleSetsString))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
item.remarks = $"{template.version}-{item.remarks}";
|
||||||
|
item.enabled = true;
|
||||||
|
item.sort = ++maxSort;
|
||||||
|
item.url = string.Empty;
|
||||||
|
|
||||||
|
AddBatchRoutingRules(ref item, ruleSetsString);
|
||||||
|
|
||||||
|
//first rule as default at first startup
|
||||||
|
if (!blImportAdvancedRules && i == 0)
|
||||||
{
|
{
|
||||||
var item = template.routingItems[i];
|
SetDefaultRouting(config, item);
|
||||||
|
|
||||||
if (String.IsNullOrEmpty(item.url) && String.IsNullOrEmpty(item.ruleSet))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
var ruleSetsString = !String.IsNullOrEmpty(item.ruleSet)
|
|
||||||
? item.ruleSet
|
|
||||||
: Task.Run(() => downloadHandle.TryDownloadString(item.url, false, "")).Result;
|
|
||||||
|
|
||||||
if (String.IsNullOrEmpty(ruleSetsString))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
item.remarks = $"{template.version}-{item.remarks}";
|
|
||||||
item.enabled = true;
|
|
||||||
item.sort = ++maxSort;
|
|
||||||
item.url = string.Empty;
|
|
||||||
|
|
||||||
AddBatchRoutingRules(ref item, ruleSetsString);
|
|
||||||
|
|
||||||
//first rule as default at first startup
|
|
||||||
if (!blImportAdvancedRules && i == 0)
|
|
||||||
{
|
|
||||||
SetDefaultRouting(config, item);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1695,45 +1682,47 @@ namespace ServiceLib.Handler
|
||||||
{
|
{
|
||||||
var ver = "V3-";
|
var ver = "V3-";
|
||||||
var items = AppHandler.Instance.RoutingItems();
|
var items = AppHandler.Instance.RoutingItems();
|
||||||
if (blImportAdvancedRules || items.Where(t => t.remarks.StartsWith(ver)).ToList().Count <= 0)
|
if (!blImportAdvancedRules && items.Where(t => t.remarks.StartsWith(ver)).ToList().Count > 0)
|
||||||
{
|
{
|
||||||
var maxSort = items.Count;
|
return 0;
|
||||||
//Bypass the mainland
|
}
|
||||||
var item2 = new RoutingItem()
|
|
||||||
{
|
|
||||||
remarks = $"{ver}绕过大陆(Whitelist)",
|
|
||||||
url = string.Empty,
|
|
||||||
sort = maxSort + 1,
|
|
||||||
};
|
|
||||||
AddBatchRoutingRules(ref item2, Utils.GetEmbedText(Global.CustomRoutingFileName + "white"));
|
|
||||||
|
|
||||||
//Blacklist
|
var maxSort = items.Count;
|
||||||
var item3 = new RoutingItem()
|
//Bypass the mainland
|
||||||
{
|
var item2 = new RoutingItem()
|
||||||
remarks = $"{ver}黑名单(Blacklist)",
|
{
|
||||||
url = string.Empty,
|
remarks = $"{ver}绕过大陆(Whitelist)",
|
||||||
sort = maxSort + 2,
|
url = string.Empty,
|
||||||
};
|
sort = maxSort + 1,
|
||||||
AddBatchRoutingRules(ref item3, Utils.GetEmbedText(Global.CustomRoutingFileName + "black"));
|
};
|
||||||
|
AddBatchRoutingRules(ref item2, Utils.GetEmbedText(Global.CustomRoutingFileName + "white"));
|
||||||
|
|
||||||
//Global
|
//Blacklist
|
||||||
var item1 = new RoutingItem()
|
var item3 = new RoutingItem()
|
||||||
{
|
{
|
||||||
remarks = $"{ver}全局(Global)",
|
remarks = $"{ver}黑名单(Blacklist)",
|
||||||
url = string.Empty,
|
url = string.Empty,
|
||||||
sort = maxSort + 3,
|
sort = maxSort + 2,
|
||||||
};
|
};
|
||||||
AddBatchRoutingRules(ref item1, Utils.GetEmbedText(Global.CustomRoutingFileName + "global"));
|
AddBatchRoutingRules(ref item3, Utils.GetEmbedText(Global.CustomRoutingFileName + "black"));
|
||||||
|
|
||||||
if (!blImportAdvancedRules)
|
//Global
|
||||||
{
|
var item1 = new RoutingItem()
|
||||||
SetDefaultRouting(config, item2);
|
{
|
||||||
}
|
remarks = $"{ver}全局(Global)",
|
||||||
|
url = string.Empty,
|
||||||
|
sort = maxSort + 3,
|
||||||
|
};
|
||||||
|
AddBatchRoutingRules(ref item1, Utils.GetEmbedText(Global.CustomRoutingFileName + "global"));
|
||||||
|
|
||||||
|
if (!blImportAdvancedRules)
|
||||||
|
{
|
||||||
|
SetDefaultRouting(config, item2);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static RoutingItem GetLockedRoutingItem(Config config)
|
public static RoutingItem? GetLockedRoutingItem(Config config)
|
||||||
{
|
{
|
||||||
return SQLiteHelper.Instance.Table<RoutingItem>().FirstOrDefault(it => it.locked == true);
|
return SQLiteHelper.Instance.Table<RoutingItem>().FirstOrDefault(it => it.locked == true);
|
||||||
}
|
}
|
||||||
|
@ -1789,9 +1778,9 @@ namespace ServiceLib.Handler
|
||||||
|
|
||||||
#endregion DNS
|
#endregion DNS
|
||||||
|
|
||||||
#region Presets
|
#region Regional Presets
|
||||||
|
|
||||||
public static bool ApplyPreset(Config config, EPresetType type)
|
public static bool ApplyRegionalPreset(Config config, EPresetType type)
|
||||||
{
|
{
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
|
@ -1813,6 +1802,6 @@ namespace ServiceLib.Handler
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion Regional Presets
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1116,27 +1116,27 @@ namespace ServiceLib.Resx {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Regional presets 的本地化字符串。
|
/// 查找类似 Regional presets 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string menuPresets {
|
public static string menuRegionalPresets {
|
||||||
get {
|
get {
|
||||||
return ResourceManager.GetString("menuPresets", resourceCulture);
|
return ResourceManager.GetString("menuRegionalPresets", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Default 的本地化字符串。
|
/// 查找类似 Default 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string menuPresetsDefault {
|
public static string menuRegionalPresetsDefault {
|
||||||
get {
|
get {
|
||||||
return ResourceManager.GetString("menuPresetsDefault", resourceCulture);
|
return ResourceManager.GetString("menuRegionalPresetsDefault", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Russia 的本地化字符串。
|
/// 查找类似 Russia 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string menuPresetsRussia {
|
public static string menuRegionalPresetsRussia {
|
||||||
get {
|
get {
|
||||||
return ResourceManager.GetString("menuPresetsRussia", resourceCulture);
|
return ResourceManager.GetString("menuRegionalPresetsRussia", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2752,6 +2752,15 @@ namespace ServiceLib.Resx {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Users in China region can ignore this item 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string TbSettingsChinaUserTip {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("TbSettingsChinaUserTip", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Color 的本地化字符串。
|
/// 查找类似 Color 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -3040,17 +3049,6 @@ namespace ServiceLib.Resx {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找类似 Routing rules source (optional) 的本地化字符串。
|
|
||||||
/// </summary>
|
|
||||||
public static string TbSettingsRoutingRulesSource
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return ResourceManager.GetString("TbSettingsRoutingRulesSource", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 HTTP Port 的本地化字符串。
|
/// 查找类似 HTTP Port 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -3204,6 +3202,15 @@ namespace ServiceLib.Resx {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 Routing rules source (optional) 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string TbSettingsRoutingRulesSource {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("TbSettingsRoutingRulesSource", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Set Win10 UWP Loopback 的本地化字符串。
|
/// 查找类似 Set Win10 UWP Loopback 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -1339,13 +1339,16 @@
|
||||||
<data name="TbSettingsRoutingRulesSource" xml:space="preserve">
|
<data name="TbSettingsRoutingRulesSource" xml:space="preserve">
|
||||||
<value>Routing rules source (optional)</value>
|
<value>Routing rules source (optional)</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="menuPresets" xml:space="preserve">
|
<data name="menuRegionalPresets" xml:space="preserve">
|
||||||
<value>Regional presets</value>
|
<value>Regional presets setting</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="menuPresetsDefault" xml:space="preserve">
|
<data name="menuRegionalPresetsDefault" xml:space="preserve">
|
||||||
<value>Default</value>
|
<value>Default</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="menuPresetsRussia" xml:space="preserve">
|
<data name="menuRegionalPresetsRussia" xml:space="preserve">
|
||||||
<value>Russia</value>
|
<value>Russia</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="TbSettingsChinaUserTip" xml:space="preserve">
|
||||||
|
<value>Users in China region can ignore this item</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
|
@ -1333,4 +1333,19 @@
|
||||||
<data name="TbSettingsSrsFilesSource" xml:space="preserve">
|
<data name="TbSettingsSrsFilesSource" xml:space="preserve">
|
||||||
<value>sing-box ruleset文件来源(可选)</value>
|
<value>sing-box ruleset文件来源(可选)</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="TbSettingsRoutingRulesSource" xml:space="preserve">
|
||||||
|
<value>路由规则集来源(可选)</value>
|
||||||
|
</data>
|
||||||
|
<data name="TbSettingsChinaUserTip" xml:space="preserve">
|
||||||
|
<value>中国区域用户可忽略此项</value>
|
||||||
|
</data>
|
||||||
|
<data name="menuRegionalPresets" xml:space="preserve">
|
||||||
|
<value>区域预置设置</value>
|
||||||
|
</data>
|
||||||
|
<data name="menuRegionalPresetsDefault" xml:space="preserve">
|
||||||
|
<value>默认区域</value>
|
||||||
|
</data>
|
||||||
|
<data name="menuRegionalPresetsRussia" xml:space="preserve">
|
||||||
|
<value>俄罗斯</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
|
@ -1213,4 +1213,19 @@
|
||||||
<data name="TbSettingsSrsFilesSource" xml:space="preserve">
|
<data name="TbSettingsSrsFilesSource" xml:space="preserve">
|
||||||
<value>sing-box ruleset文件來源(可選)</value>
|
<value>sing-box ruleset文件來源(可選)</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="TbSettingsRoutingRulesSource" xml:space="preserve">
|
||||||
|
<value>路由规则集来源(可选)</value>
|
||||||
|
</data>
|
||||||
|
<data name="TbSettingsChinaUserTip" xml:space="preserve">
|
||||||
|
<value>中国区域用户可忽略此项</value>
|
||||||
|
</data>
|
||||||
|
<data name="menuRegionalPresets" xml:space="preserve">
|
||||||
|
<value>区域预置设置</value>
|
||||||
|
</data>
|
||||||
|
<data name="menuRegionalPresetsDefault" xml:space="preserve">
|
||||||
|
<value>默认区域</value>
|
||||||
|
</data>
|
||||||
|
<data name="menuRegionalPresetsRussia" xml:space="preserve">
|
||||||
|
<value>俄羅斯</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
|
@ -45,8 +45,8 @@ namespace ServiceLib.ViewModels
|
||||||
public ReactiveCommand<Unit, Unit> OpenTheFileLocationCmd { get; }
|
public ReactiveCommand<Unit, Unit> OpenTheFileLocationCmd { get; }
|
||||||
|
|
||||||
//Presets
|
//Presets
|
||||||
public ReactiveCommand<Unit, Unit> PresetDefaultCmd { get; }
|
public ReactiveCommand<Unit, Unit> RegionalPresetDefaultCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> PresetRussiaCmd { get; }
|
public ReactiveCommand<Unit, Unit> RegionalPresetRussiaCmd { get; }
|
||||||
|
|
||||||
public ReactiveCommand<Unit, Unit> ReloadCmd { get; }
|
public ReactiveCommand<Unit, Unit> ReloadCmd { get; }
|
||||||
|
|
||||||
|
@ -185,14 +185,14 @@ namespace ServiceLib.ViewModels
|
||||||
await Reload();
|
await Reload();
|
||||||
});
|
});
|
||||||
|
|
||||||
PresetDefaultCmd = ReactiveCommand.CreateFromTask(async () =>
|
RegionalPresetDefaultCmd = ReactiveCommand.CreateFromTask(async () =>
|
||||||
{
|
{
|
||||||
await ApplyPreset(EPresetType.Default);
|
await ApplyRegionalPreset(EPresetType.Default);
|
||||||
});
|
});
|
||||||
|
|
||||||
PresetRussiaCmd = ReactiveCommand.CreateFromTask(async () =>
|
RegionalPresetRussiaCmd = ReactiveCommand.CreateFromTask(async () =>
|
||||||
{
|
{
|
||||||
await ApplyPreset(EPresetType.Russia);
|
await ApplyRegionalPreset(EPresetType.Russia);
|
||||||
});
|
});
|
||||||
|
|
||||||
#endregion WhenAnyValue && ReactiveCommand
|
#endregion WhenAnyValue && ReactiveCommand
|
||||||
|
@ -202,7 +202,7 @@ namespace ServiceLib.ViewModels
|
||||||
|
|
||||||
private void Init()
|
private void Init()
|
||||||
{
|
{
|
||||||
ConfigHandler.InitRouting(_config);
|
ConfigHandler.InitBuiltinRouting(_config);
|
||||||
ConfigHandler.InitBuiltinDNS(_config);
|
ConfigHandler.InitBuiltinDNS(_config);
|
||||||
CoreHandler.Instance.Init(_config, UpdateHandler);
|
CoreHandler.Instance.Init(_config, UpdateHandler);
|
||||||
TaskHandler.Instance.RegUpdateTask(_config, UpdateTaskHandler);
|
TaskHandler.Instance.RegUpdateTask(_config, UpdateTaskHandler);
|
||||||
|
@ -445,7 +445,7 @@ namespace ServiceLib.ViewModels
|
||||||
var ret = await _updateView?.Invoke(EViewAction.RoutingSettingWindow, null);
|
var ret = await _updateView?.Invoke(EViewAction.RoutingSettingWindow, null);
|
||||||
if (ret == true)
|
if (ret == true)
|
||||||
{
|
{
|
||||||
ConfigHandler.InitRouting(_config);
|
ConfigHandler.InitBuiltinRouting(_config);
|
||||||
Locator.Current.GetService<StatusBarViewModel>()?.RefreshRoutingsMenu();
|
Locator.Current.GetService<StatusBarViewModel>()?.RefreshRoutingsMenu();
|
||||||
Reload();
|
Reload();
|
||||||
}
|
}
|
||||||
|
@ -560,16 +560,14 @@ namespace ServiceLib.ViewModels
|
||||||
|
|
||||||
#region Presets
|
#region Presets
|
||||||
|
|
||||||
public async Task ApplyPreset(EPresetType type)
|
public async Task ApplyRegionalPreset(EPresetType type)
|
||||||
{
|
{
|
||||||
ConfigHandler.ApplyPreset(_config, type);
|
ConfigHandler.ApplyRegionalPreset(_config, type);
|
||||||
|
|
||||||
await new UpdateService().UpdateGeoFileAll(_config, UpdateHandler);
|
|
||||||
|
|
||||||
ConfigHandler.InitRouting(_config);
|
ConfigHandler.InitRouting(_config);
|
||||||
Locator.Current.GetService<StatusBarViewModel>()?.RefreshRoutingsMenu();
|
Locator.Current.GetService<StatusBarViewModel>()?.RefreshRoutingsMenu();
|
||||||
|
|
||||||
ConfigHandler.SaveConfig(_config, false);
|
ConfigHandler.SaveConfig(_config, false);
|
||||||
|
await new UpdateService().UpdateGeoFileAll(_config, UpdateHandler);
|
||||||
Reload();
|
Reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ namespace ServiceLib.ViewModels
|
||||||
_updateView = updateView;
|
_updateView = updateView;
|
||||||
SelectedSource = new();
|
SelectedSource = new();
|
||||||
|
|
||||||
ConfigHandler.InitRouting(_config);
|
ConfigHandler.InitBuiltinRouting(_config);
|
||||||
|
|
||||||
enableRoutingAdvanced = _config.routingBasicItem.enableRoutingAdvanced;
|
enableRoutingAdvanced = _config.routingBasicItem.enableRoutingAdvanced;
|
||||||
domainStrategy = _config.routingBasicItem.domainStrategy;
|
domainStrategy = _config.routingBasicItem.domainStrategy;
|
||||||
|
@ -123,6 +123,17 @@ namespace ServiceLib.ViewModels
|
||||||
private void BindingLockedData()
|
private void BindingLockedData()
|
||||||
{
|
{
|
||||||
_lockedItem = ConfigHandler.GetLockedRoutingItem(_config);
|
_lockedItem = ConfigHandler.GetLockedRoutingItem(_config);
|
||||||
|
if (_lockedItem == null)
|
||||||
|
{
|
||||||
|
_lockedItem = new RoutingItem()
|
||||||
|
{
|
||||||
|
remarks = "locked",
|
||||||
|
url = string.Empty,
|
||||||
|
locked = true,
|
||||||
|
};
|
||||||
|
ConfigHandler.AddBatchRoutingRules(ref _lockedItem, Utils.GetEmbedText(Global.CustomRoutingFileName + "locked"));
|
||||||
|
}
|
||||||
|
|
||||||
if (_lockedItem != null)
|
if (_lockedItem != null)
|
||||||
{
|
{
|
||||||
_lockedRules = JsonUtils.Deserialize<List<RulesItem>>(_lockedItem.ruleSet);
|
_lockedRules = JsonUtils.Deserialize<List<RulesItem>>(_lockedItem.ruleSet);
|
||||||
|
|
|
@ -33,7 +33,6 @@ namespace ServiceLib.ViewModels
|
||||||
public ReactiveCommand<Unit, Unit> SubUpdateCmd { get; }
|
public ReactiveCommand<Unit, Unit> SubUpdateCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> SubUpdateViaProxyCmd { get; }
|
public ReactiveCommand<Unit, Unit> SubUpdateViaProxyCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> NotifyLeftClickCmd { get; }
|
public ReactiveCommand<Unit, Unit> NotifyLeftClickCmd { get; }
|
||||||
public ReactiveCommand<Unit, Unit> ExitCmd { get; }
|
|
||||||
|
|
||||||
#region System Proxy
|
#region System Proxy
|
||||||
|
|
||||||
|
|
|
@ -74,15 +74,15 @@
|
||||||
<MenuItem x:Name="menuRoutingSetting" Header="{x:Static resx:ResUI.menuRoutingSetting}" />
|
<MenuItem x:Name="menuRoutingSetting" Header="{x:Static resx:ResUI.menuRoutingSetting}" />
|
||||||
<MenuItem x:Name="menuDNSSetting" Header="{x:Static resx:ResUI.menuDNSSetting}" />
|
<MenuItem x:Name="menuDNSSetting" Header="{x:Static resx:ResUI.menuDNSSetting}" />
|
||||||
<MenuItem x:Name="menuGlobalHotkeySetting" Header="{x:Static resx:ResUI.menuGlobalHotkeySetting}" />
|
<MenuItem x:Name="menuGlobalHotkeySetting" Header="{x:Static resx:ResUI.menuGlobalHotkeySetting}" />
|
||||||
<MenuItem Header="{x:Static resx:ResUI.menuPresets}">
|
|
||||||
<MenuItem x:Name="menuPresetsDefault" Header="{x:Static resx:ResUI.menuPresetsDefault}" />
|
|
||||||
<MenuItem x:Name="menuPresetsRussia" Header="{x:Static resx:ResUI.menuPresetsRussia}" />
|
|
||||||
</MenuItem>
|
|
||||||
<Separator />
|
<Separator />
|
||||||
<MenuItem x:Name="menuRebootAsAdmin" Header="{x:Static resx:ResUI.menuRebootAsAdmin}" />
|
<MenuItem x:Name="menuRebootAsAdmin" Header="{x:Static resx:ResUI.menuRebootAsAdmin}" />
|
||||||
<MenuItem x:Name="menuSettingsSetUWP" Header="{x:Static resx:ResUI.TbSettingsSetUWP}" />
|
<MenuItem x:Name="menuSettingsSetUWP" Header="{x:Static resx:ResUI.TbSettingsSetUWP}" />
|
||||||
<MenuItem x:Name="menuClearServerStatistics" Header="{x:Static resx:ResUI.menuClearServerStatistics}" />
|
<MenuItem x:Name="menuClearServerStatistics" Header="{x:Static resx:ResUI.menuClearServerStatistics}" />
|
||||||
<Separator />
|
<Separator />
|
||||||
|
<MenuItem Header="{x:Static resx:ResUI.menuRegionalPresets}">
|
||||||
|
<MenuItem x:Name="menuRegionalPresetsDefault" Header="{x:Static resx:ResUI.menuRegionalPresetsDefault}" />
|
||||||
|
<MenuItem x:Name="menuRegionalPresetsRussia" Header="{x:Static resx:ResUI.menuRegionalPresetsRussia}" />
|
||||||
|
</MenuItem>
|
||||||
<MenuItem x:Name="menuBackupAndRestore" Header="{x:Static resx:ResUI.menuBackupAndRestore}" />
|
<MenuItem x:Name="menuBackupAndRestore" Header="{x:Static resx:ResUI.menuBackupAndRestore}" />
|
||||||
<MenuItem x:Name="menuOpenTheFileLocation" Header="{x:Static resx:ResUI.menuOpenTheFileLocation}" />
|
<MenuItem x:Name="menuOpenTheFileLocation" Header="{x:Static resx:ResUI.menuOpenTheFileLocation}" />
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
|
|
|
@ -76,8 +76,8 @@ namespace v2rayN.Desktop.Views
|
||||||
this.BindCommand(ViewModel, vm => vm.RebootAsAdminCmd, v => v.menuRebootAsAdmin).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.RebootAsAdminCmd, v => v.menuRebootAsAdmin).DisposeWith(disposables);
|
||||||
this.BindCommand(ViewModel, vm => vm.ClearServerStatisticsCmd, v => v.menuClearServerStatistics).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.ClearServerStatisticsCmd, v => v.menuClearServerStatistics).DisposeWith(disposables);
|
||||||
this.BindCommand(ViewModel, vm => vm.OpenTheFileLocationCmd, v => v.menuOpenTheFileLocation).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.OpenTheFileLocationCmd, v => v.menuOpenTheFileLocation).DisposeWith(disposables);
|
||||||
this.BindCommand(ViewModel, vm => vm.PresetDefaultCmd, v => v.menuPresetsDefault).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.RegionalPresetDefaultCmd, v => v.menuRegionalPresetsDefault).DisposeWith(disposables);
|
||||||
this.BindCommand(ViewModel, vm => vm.PresetRussiaCmd, v => v.menuPresetsRussia).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.RegionalPresetRussiaCmd, v => v.menuRegionalPresetsRussia).DisposeWith(disposables);
|
||||||
|
|
||||||
this.BindCommand(ViewModel, vm => vm.ReloadCmd, v => v.menuReload).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.ReloadCmd, v => v.menuReload).DisposeWith(disposables);
|
||||||
this.OneWayBind(ViewModel, vm => vm.BlReloadEnabled, v => v.menuReload.IsEnabled).DisposeWith(disposables);
|
this.OneWayBind(ViewModel, vm => vm.BlReloadEnabled, v => v.menuReload.IsEnabled).DisposeWith(disposables);
|
||||||
|
|
|
@ -80,7 +80,8 @@
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Classes="Margin8"
|
Classes="Margin8"
|
||||||
Text="{x:Static resx:ResUI.TbSettingsSocksPortTip}" />
|
Text="{x:Static resx:ResUI.TbSettingsSocksPortTip}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
|
@ -331,9 +332,10 @@
|
||||||
Classes="Margin8" />
|
Classes="Margin8" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="17"
|
Grid.Row="17"
|
||||||
Grid.Column="3"
|
Grid.Column="2"
|
||||||
Classes="Margin8"
|
Classes="Margin8"
|
||||||
Text="{x:Static resx:ResUI.TbSettingsEnableFragmentTips}" />
|
Text="{x:Static resx:ResUI.TbSettingsEnableFragmentTips}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
@ -626,6 +628,13 @@
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="300"
|
Width="300"
|
||||||
Classes="Margin8" />
|
Classes="Margin8" />
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="22"
|
||||||
|
Grid.Column="2"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Classes="Margin8"
|
||||||
|
Text="{x:Static resx:ResUI.TbSettingsChinaUserTip}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="23"
|
Grid.Row="23"
|
||||||
|
@ -639,6 +648,13 @@
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="300"
|
Width="300"
|
||||||
Classes="Margin8" />
|
Classes="Margin8" />
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="23"
|
||||||
|
Grid.Column="2"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Classes="Margin8"
|
||||||
|
Text="{x:Static resx:ResUI.TbSettingsChinaUserTip}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="24"
|
Grid.Row="24"
|
||||||
|
@ -652,6 +668,14 @@
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Width="300"
|
Width="300"
|
||||||
Classes="Margin8" />
|
Classes="Margin8" />
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="24"
|
||||||
|
Grid.Column="2"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Classes="Margin8"
|
||||||
|
Text="{x:Static resx:ResUI.TbSettingsChinaUserTip}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|
|
@ -38,52 +38,10 @@ namespace v2rayN.Desktop.Views
|
||||||
this.Bind(ViewModel, vm => vm.EnableTun, v => v.togEnableTun.IsChecked).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.EnableTun, v => v.togEnableTun.IsChecked).DisposeWith(disposables);
|
||||||
|
|
||||||
this.Bind(ViewModel, vm => vm.SystemProxySelected, v => v.cmbSystemProxy.SelectedIndex).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SystemProxySelected, v => v.cmbSystemProxy.SelectedIndex).DisposeWith(disposables);
|
||||||
//this.OneWayBind(ViewModel, vm => vm.RoutingItems, v => v.cmbRoutings2.ItemsSource).DisposeWith(disposables);
|
|
||||||
this.Bind(ViewModel, vm => vm.SelectedRouting, v => v.cmbRoutings2.SelectedItem).DisposeWith(disposables);
|
this.Bind(ViewModel, vm => vm.SelectedRouting, v => v.cmbRoutings2.SelectedItem).DisposeWith(disposables);
|
||||||
|
|
||||||
////system proxy
|
|
||||||
//this.OneWayBind(ViewModel, vm => vm.BlSystemProxyClear, v => v.menuSystemProxyClear2.Visibility, conversionHint: BooleanToVisibilityHint.UseHidden, vmToViewConverterOverride: new BooleanToVisibilityTypeConverter()).DisposeWith(disposables);
|
|
||||||
//this.OneWayBind(ViewModel, vm => vm.BlSystemProxySet, v => v.menuSystemProxySet2.Visibility, conversionHint: BooleanToVisibilityHint.UseHidden, vmToViewConverterOverride: new BooleanToVisibilityTypeConverter()).DisposeWith(disposables);
|
|
||||||
//this.OneWayBind(ViewModel, vm => vm.BlSystemProxyNothing, v => v.menuSystemProxyNothing2.Visibility, conversionHint: BooleanToVisibilityHint.UseHidden, vmToViewConverterOverride: new BooleanToVisibilityTypeConverter()).DisposeWith(disposables);
|
|
||||||
//this.OneWayBind(ViewModel, vm => vm.BlSystemProxyPac, v => v.menuSystemProxyPac2.Visibility, conversionHint: BooleanToVisibilityHint.UseHidden, vmToViewConverterOverride: new BooleanToVisibilityTypeConverter()).DisposeWith(disposables);
|
|
||||||
//this.BindCommand(ViewModel, vm => vm.SystemProxyClearCmd, v => v.menuSystemProxyClear).DisposeWith(disposables);
|
|
||||||
//this.BindCommand(ViewModel, vm => vm.SystemProxySetCmd, v => v.menuSystemProxySet).DisposeWith(disposables);
|
|
||||||
//this.BindCommand(ViewModel, vm => vm.SystemProxyPacCmd, v => v.menuSystemProxyPac).DisposeWith(disposables);
|
|
||||||
//this.BindCommand(ViewModel, vm => vm.SystemProxyNothingCmd, v => v.menuSystemProxyNothing).DisposeWith(disposables);
|
|
||||||
|
|
||||||
////routings and servers
|
|
||||||
//this.OneWayBind(ViewModel, vm => vm.RoutingItems, v => v.cmbRoutings.ItemsSource).DisposeWith(disposables);
|
|
||||||
//this.Bind(ViewModel, vm => vm.SelectedRouting, v => v.cmbRoutings.SelectedItem).DisposeWith(disposables);
|
|
||||||
//this.OneWayBind(ViewModel, vm => vm.BlRouting, v => v.menuRoutings.Visibility).DisposeWith(disposables);
|
|
||||||
//this.OneWayBind(ViewModel, vm => vm.BlRouting, v => v.sepRoutings.Visibility).DisposeWith(disposables);
|
|
||||||
|
|
||||||
//this.OneWayBind(ViewModel, vm => vm.Servers, v => v.cmbServers.ItemsSource).DisposeWith(disposables);
|
|
||||||
//this.Bind(ViewModel, vm => vm.SelectedServer, v => v.cmbServers.SelectedItem).DisposeWith(disposables);
|
|
||||||
//this.OneWayBind(ViewModel, vm => vm.BlServers, v => v.cmbServers.Visibility).DisposeWith(disposables);
|
|
||||||
|
|
||||||
////tray menu
|
|
||||||
//this.BindCommand(ViewModel, vm => vm.AddServerViaClipboardCmd, v => v.menuAddServerViaClipboard2).DisposeWith(disposables);
|
|
||||||
//this.BindCommand(ViewModel, vm => vm.AddServerViaScanCmd, v => v.menuAddServerViaScan2).DisposeWith(disposables);
|
|
||||||
//this.BindCommand(ViewModel, vm => vm.SubUpdateCmd, v => v.menuSubUpdate2).DisposeWith(disposables);
|
|
||||||
//this.BindCommand(ViewModel, vm => vm.SubUpdateViaProxyCmd, v => v.menuSubUpdateViaProxy2).DisposeWith(disposables);
|
|
||||||
|
|
||||||
//this.OneWayBind(ViewModel, vm => vm.RunningServerToolTipText, v => v.tbNotify.ToolTipText).DisposeWith(disposables);
|
|
||||||
//this.OneWayBind(ViewModel, vm => vm.NotifyLeftClickCmd, v => v.tbNotify.LeftClickCommand).DisposeWith(disposables);
|
|
||||||
|
|
||||||
////status bar
|
|
||||||
//this.OneWayBind(ViewModel, vm => vm.InboundDisplay, v => v.txtInboundDisplay.Text).DisposeWith(disposables);
|
|
||||||
//this.OneWayBind(ViewModel, vm => vm.InboundLanDisplay, v => v.txtInboundLanDisplay.Text).DisposeWith(disposables);
|
|
||||||
//this.OneWayBind(ViewModel, vm => vm.RunningServerDisplay, v => v.txtRunningServerDisplay.Text).DisposeWith(disposables);
|
|
||||||
//this.OneWayBind(ViewModel, vm => vm.RunningInfoDisplay, v => v.txtRunningInfoDisplay.Text).DisposeWith(disposables);
|
|
||||||
//this.OneWayBind(ViewModel, vm => vm.SpeedProxyDisplay, v => v.txtSpeedProxyDisplay.Text).DisposeWith(disposables);
|
|
||||||
//this.OneWayBind(ViewModel, vm => vm.SpeedDirectDisplay, v => v.txtSpeedDirectDisplay.Text).DisposeWith(disposables);
|
|
||||||
//this.Bind(ViewModel, vm => vm.EnableTun, v => v.togEnableTun.IsChecked).DisposeWith(disposables);
|
|
||||||
|
|
||||||
//this.Bind(ViewModel, vm => vm.SystemProxySelected, v => v.cmbSystemProxy.SelectedIndex).DisposeWith(disposables);
|
|
||||||
//this.OneWayBind(ViewModel, vm => vm.RoutingItems, v => v.cmbRoutings2.ItemsSource).DisposeWith(disposables);
|
|
||||||
//this.Bind(ViewModel, vm => vm.SelectedRouting, v => v.cmbRoutings2.SelectedItem).DisposeWith(disposables);
|
|
||||||
//this.OneWayBind(ViewModel, vm => vm.BlRouting, v => v.cmbRoutings2.Visibility).DisposeWith(disposables);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
togEnableTun.IsVisible = (Utils.IsWindows() || AppHandler.Instance.IsAdministrator);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<bool> UpdateViewHandler(EViewAction action, object? obj)
|
private async Task<bool> UpdateViewHandler(EViewAction action, object? obj)
|
||||||
|
|
|
@ -171,16 +171,6 @@
|
||||||
x:Name="menuGlobalHotkeySetting"
|
x:Name="menuGlobalHotkeySetting"
|
||||||
Height="{StaticResource MenuItemHeight}"
|
Height="{StaticResource MenuItemHeight}"
|
||||||
Header="{x:Static resx:ResUI.menuGlobalHotkeySetting}" />
|
Header="{x:Static resx:ResUI.menuGlobalHotkeySetting}" />
|
||||||
<MenuItem Height="{StaticResource MenuItemHeight}" Header="{x:Static resx:ResUI.menuPresets}">
|
|
||||||
<MenuItem
|
|
||||||
x:Name="menuPresetsDefault"
|
|
||||||
Height="{StaticResource MenuItemHeight}"
|
|
||||||
Header="{x:Static resx:ResUI.menuPresetsDefault}" />
|
|
||||||
<MenuItem
|
|
||||||
x:Name="menuPresetsRussia"
|
|
||||||
Height="{StaticResource MenuItemHeight}"
|
|
||||||
Header="{x:Static resx:ResUI.menuPresetsRussia}" />
|
|
||||||
</MenuItem>
|
|
||||||
<Separator Margin="-40,5" />
|
<Separator Margin="-40,5" />
|
||||||
<MenuItem
|
<MenuItem
|
||||||
x:Name="menuRebootAsAdmin"
|
x:Name="menuRebootAsAdmin"
|
||||||
|
@ -195,6 +185,16 @@
|
||||||
Height="{StaticResource MenuItemHeight}"
|
Height="{StaticResource MenuItemHeight}"
|
||||||
Header="{x:Static resx:ResUI.menuClearServerStatistics}" />
|
Header="{x:Static resx:ResUI.menuClearServerStatistics}" />
|
||||||
<Separator Margin="-40,5" />
|
<Separator Margin="-40,5" />
|
||||||
|
<MenuItem Height="{StaticResource MenuItemHeight}" Header="{x:Static resx:ResUI.menuRegionalPresets}">
|
||||||
|
<MenuItem
|
||||||
|
x:Name="menuRegionalPresetsDefault"
|
||||||
|
Height="{StaticResource MenuItemHeight}"
|
||||||
|
Header="{x:Static resx:ResUI.menuRegionalPresetsDefault}" />
|
||||||
|
<MenuItem
|
||||||
|
x:Name="menuRegionalPresetsRussia"
|
||||||
|
Height="{StaticResource MenuItemHeight}"
|
||||||
|
Header="{x:Static resx:ResUI.menuRegionalPresetsRussia}" />
|
||||||
|
</MenuItem>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
x:Name="menuBackupAndRestore"
|
x:Name="menuBackupAndRestore"
|
||||||
Height="{StaticResource MenuItemHeight}"
|
Height="{StaticResource MenuItemHeight}"
|
||||||
|
|
|
@ -98,8 +98,8 @@ namespace v2rayN.Views
|
||||||
this.BindCommand(ViewModel, vm => vm.RebootAsAdminCmd, v => v.menuRebootAsAdmin).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.RebootAsAdminCmd, v => v.menuRebootAsAdmin).DisposeWith(disposables);
|
||||||
this.BindCommand(ViewModel, vm => vm.ClearServerStatisticsCmd, v => v.menuClearServerStatistics).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.ClearServerStatisticsCmd, v => v.menuClearServerStatistics).DisposeWith(disposables);
|
||||||
this.BindCommand(ViewModel, vm => vm.OpenTheFileLocationCmd, v => v.menuOpenTheFileLocation).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.OpenTheFileLocationCmd, v => v.menuOpenTheFileLocation).DisposeWith(disposables);
|
||||||
this.BindCommand(ViewModel, vm => vm.PresetDefaultCmd, v => v.menuPresetsDefault).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.RegionalPresetDefaultCmd, v => v.menuRegionalPresetsDefault).DisposeWith(disposables);
|
||||||
this.BindCommand(ViewModel, vm => vm.PresetRussiaCmd, v => v.menuPresetsRussia).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.RegionalPresetRussiaCmd, v => v.menuRegionalPresetsRussia).DisposeWith(disposables);
|
||||||
|
|
||||||
this.BindCommand(ViewModel, vm => vm.ReloadCmd, v => v.menuReload).DisposeWith(disposables);
|
this.BindCommand(ViewModel, vm => vm.ReloadCmd, v => v.menuReload).DisposeWith(disposables);
|
||||||
this.OneWayBind(ViewModel, vm => vm.BlReloadEnabled, v => v.menuReload.IsEnabled).DisposeWith(disposables);
|
this.OneWayBind(ViewModel, vm => vm.BlReloadEnabled, v => v.menuReload.IsEnabled).DisposeWith(disposables);
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
|
@ -95,7 +95,8 @@
|
||||||
Margin="{StaticResource Margin4}"
|
Margin="{StaticResource Margin4}"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
Style="{StaticResource ToolbarTextBlock}"
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
Text="{x:Static resx:ResUI.TbSettingsSocksPortTip}" />
|
Text="{x:Static resx:ResUI.TbSettingsSocksPortTip}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
|
@ -374,10 +375,11 @@
|
||||||
HorizontalAlignment="Left" />
|
HorizontalAlignment="Left" />
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="17"
|
Grid.Row="17"
|
||||||
Grid.Column="3"
|
Grid.Column="2"
|
||||||
Margin="{StaticResource Margin8}"
|
Margin="{StaticResource Margin8}"
|
||||||
Style="{StaticResource ToolbarTextBlock}"
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
Text="{x:Static resx:ResUI.TbSettingsEnableFragmentTips}" />
|
Text="{x:Static resx:ResUI.TbSettingsEnableFragmentTips}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
@ -864,6 +866,14 @@
|
||||||
Margin="{StaticResource Margin8}"
|
Margin="{StaticResource Margin8}"
|
||||||
IsEditable="True"
|
IsEditable="True"
|
||||||
Style="{StaticResource DefComboBox}" />
|
Style="{StaticResource DefComboBox}" />
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="22"
|
||||||
|
Grid.Column="2"
|
||||||
|
Margin="{StaticResource Margin4}"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
|
Text="{x:Static resx:ResUI.TbSettingsChinaUserTip}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="23"
|
Grid.Row="23"
|
||||||
|
@ -880,6 +890,14 @@
|
||||||
Margin="{StaticResource Margin8}"
|
Margin="{StaticResource Margin8}"
|
||||||
IsEditable="True"
|
IsEditable="True"
|
||||||
Style="{StaticResource DefComboBox}" />
|
Style="{StaticResource DefComboBox}" />
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="23"
|
||||||
|
Grid.Column="2"
|
||||||
|
Margin="{StaticResource Margin4}"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
|
Text="{x:Static resx:ResUI.TbSettingsChinaUserTip}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Grid.Row="24"
|
Grid.Row="24"
|
||||||
|
@ -896,6 +914,15 @@
|
||||||
Margin="{StaticResource Margin8}"
|
Margin="{StaticResource Margin8}"
|
||||||
IsEditable="True"
|
IsEditable="True"
|
||||||
Style="{StaticResource DefComboBox}" />
|
Style="{StaticResource DefComboBox}" />
|
||||||
|
<TextBlock
|
||||||
|
Grid.Row="24"
|
||||||
|
Grid.Column="2"
|
||||||
|
Margin="{StaticResource Margin4}"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Style="{StaticResource ToolbarTextBlock}"
|
||||||
|
Text="{x:Static resx:ResUI.TbSettingsChinaUserTip}"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|
Loading…
Reference in New Issue