Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Oct 14, 2024
1 parent 9540669 commit 24afe8b
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 17 deletions.
3 changes: 1 addition & 2 deletions v2rayN/ServiceLib/Models/ConfigItems.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ public class GUIItem
public int trayMenuServersLimit { get; set; } = 20;

public bool enableHWA { get; set; } = false;

public string geoSourceUrl { get; set; }
}

[Serializable]
Expand Down Expand Up @@ -142,6 +140,7 @@ public class ConstItem
{
public string defIEProxyExceptions { get; set; }
public string subConvertUrl { get; set; } = string.Empty;
public string? geoSourceUrl { get; set; }
}

[Serializable]
Expand Down
12 changes: 5 additions & 7 deletions v2rayN/ServiceLib/Resx/ResUI.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion v2rayN/ServiceLib/Resx/ResUI.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1328,6 +1328,6 @@
<value>Save Interface Layout</value>
</data>
<data name="TbSettingsGeoFilesSource" xml:space="preserve">
<value>Geo files source</value>
<value>Geo files source (optional)</value>
</data>
</root>
3 changes: 3 additions & 0 deletions v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1324,4 +1324,7 @@
<data name="menuStorageUI" xml:space="preserve">
<value>保存界面布局</value>
</data>
<data name="TbSettingsGeoFilesSource" xml:space="preserve">
<value>Geo文件来源(可选)</value>
</data>
</root>
3 changes: 3 additions & 0 deletions v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1204,4 +1204,7 @@
<data name="menuStorageUI" xml:space="preserve">
<value>儲存介面佈局</value>
</data>
<data name="TbSettingsGeoFilesSource" xml:space="preserve">
<value>Geo文件來源(可選)</value>
</data>
</root>
4 changes: 3 additions & 1 deletion v2rayN/ServiceLib/Services/UpdateService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,9 @@ private async Task UpdateGeoFile(string geoName, Config config, Action<bool, str
_config = config;
_updateFunc = updateFunc;

var geoUrl = !String.IsNullOrEmpty(config?.guiItem.geoSourceUrl) ? config.guiItem.geoSourceUrl : Global.GeoUrl;
var geoUrl = string.IsNullOrEmpty(config?.constItem.geoSourceUrl)
? Global.GeoUrl
: config.constItem.geoSourceUrl;
var url = string.Format(Global.GeoUrl, geoName);
var fileName = Utils.GetTempPath(Utils.GetGuid());

Expand Down
4 changes: 2 additions & 2 deletions v2rayN/ServiceLib/ViewModels/OptionSettingViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public OptionSettingViewModel(Func<EViewAction, object?, Task<bool>>? updateView
EnableHWA = _config.guiItem.enableHWA;
SubConvertUrl = _config.constItem.subConvertUrl;
MainGirdOrientation = (int)_config.uiItem.mainGirdOrientation;
GeoFileSourceUrl = _config.guiItem.geoSourceUrl;
GeoFileSourceUrl = _config.constItem.geoSourceUrl;

#endregion UI

Expand Down Expand Up @@ -318,7 +318,7 @@ private async Task SaveSettingAsync()
_config.guiItem.enableHWA = EnableHWA;
_config.constItem.subConvertUrl = SubConvertUrl;
_config.uiItem.mainGirdOrientation = (EGirdOrientation)MainGirdOrientation;
_config.guiItem.geoSourceUrl = GeoFileSourceUrl;
_config.constItem.geoSourceUrl = GeoFileSourceUrl;

//systemProxy
_config.systemProxyItem.systemProxyExceptions = systemProxyExceptions;
Expand Down
2 changes: 1 addition & 1 deletion v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
Cursor="Hand" />
</StackPanel>

<TabControl HorizontalContentAlignment="Left">
<TabControl HorizontalContentAlignment="Stretch">
<TabItem Header="{x:Static resx:ResUI.TbSettingsCore}">
<ScrollViewer VerticalScrollBarVisibility="Visible">
<Grid Classes="Margin8">
Expand Down
5 changes: 2 additions & 3 deletions v2rayN/v2rayN/Views/OptionSettingWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -847,11 +847,10 @@
Margin="{StaticResource Margin8}"
Style="{StaticResource DefComboBox}" />


<TextBlock
Grid.Row="22"
Grid.Column="0"
Margin="{StaticResource SettingItemMargin}"
Margin="{StaticResource Margin8}"
VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSettingsGeoFilesSource}" />
Expand All @@ -860,7 +859,7 @@
Grid.Row="22"
Grid.Column="1"
Width="300"
Margin="{StaticResource SettingItemMargin}"
Margin="{StaticResource Margin8}"
IsEditable="True"
Style="{StaticResource DefComboBox}" />
</Grid>
Expand Down

0 comments on commit 24afe8b

Please sign in to comment.