Browse Source

Add Memo attribute to subscription group

https://github.com/2dust/v2rayN/issues/5981
pull/6005/head
2dust 3 weeks ago
parent
commit
4eda3dd8fa
  1. 1
      v2rayN/ServiceLib/Handler/ConfigHandler.cs
  2. 2
      v2rayN/ServiceLib/Models/SubItem.cs
  3. 9
      v2rayN/ServiceLib/Resx/ResUI.Designer.cs
  4. 3
      v2rayN/ServiceLib/Resx/ResUI.resx
  5. 3
      v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx
  6. 3
      v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx
  7. 19
      v2rayN/v2rayN.Desktop/Views/SubEditWindow.axaml
  8. 1
      v2rayN/v2rayN.Desktop/Views/SubEditWindow.axaml.cs
  9. 29
      v2rayN/v2rayN/Views/SubEditWindow.xaml
  10. 1
      v2rayN/v2rayN/Views/SubEditWindow.xaml.cs

1
v2rayN/ServiceLib/Handler/ConfigHandler.cs

@ -1358,6 +1358,7 @@ namespace ServiceLib.Handler
item.PrevProfile = subItem.PrevProfile;
item.NextProfile = subItem.NextProfile;
item.PreSocksPort = subItem.PreSocksPort;
item.Memo = subItem.Memo;
}
if (Utils.IsNullOrEmpty(item.Id))

2
v2rayN/ServiceLib/Models/SubItem.cs

@ -33,5 +33,7 @@ namespace ServiceLib.Models
public string? NextProfile { get; set; }
public int? PreSocksPort { get; set; }
public string? Memo { get; set; }
}
}

9
v2rayN/ServiceLib/Resx/ResUI.Designer.cs generated

@ -447,6 +447,15 @@ namespace ServiceLib.Resx {
}
}
/// <summary>
/// 查找类似 Remarks Memo 的本地化字符串。
/// </summary>
public static string LvMemo {
get {
return ResourceManager.GetString("LvMemo", resourceCulture);
}
}
/// <summary>
/// 查找类似 More URLs, separated by commas; Subscription conversion will be invalid 的本地化字符串。
/// </summary>

3
v2rayN/ServiceLib/Resx/ResUI.resx

@ -1366,4 +1366,7 @@
<data name="menuExitTips" xml:space="preserve">
<value>Are you sure to exit?</value>
</data>
<data name="LvMemo" xml:space="preserve">
<value>Remarks Memo</value>
</data>
</root>

3
v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx

@ -1363,4 +1363,7 @@
<data name="menuExitTips" xml:space="preserve">
<value>是否确定退出?</value>
</data>
<data name="LvMemo" xml:space="preserve">
<value>备注备忘</value>
</data>
</root>

3
v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx

@ -1243,4 +1243,7 @@
<data name="menuExitTips" xml:space="preserve">
<value>是否確定退出?</value>
</data>
<data name="LvMemo" xml:space="preserve">
<value>備註備忘</value>
</data>
</root>

19
v2rayN/v2rayN.Desktop/Views/SubEditWindow.axaml

@ -52,6 +52,7 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
@ -114,7 +115,7 @@
<TextBox
x:Name="txtAutoUpdateInterval"
Width="200"
Width="100"
VerticalAlignment="Center"
Classes="Margin8"
DockPanel.Dock="Right"
@ -233,13 +234,27 @@
<TextBlock
Grid.Row="12"
Grid.Column="0"
VerticalAlignment="Center"
Classes="Margin8"
Text="{x:Static resx:ResUI.LvMemo}" />
<TextBox
x:Name="txtMemo"
Grid.Row="12"
Grid.Column="1"
VerticalAlignment="Center"
Classes="Margin8"
TextWrapping="Wrap" />
<TextBlock
Grid.Row="13"
Grid.Column="0"
Grid.ColumnSpan="2"
VerticalAlignment="Center"
Classes="Margin8"
Text="{x:Static resx:ResUI.LvMoreUrl}" />
<TextBox
x:Name="txtMoreUrl"
Grid.Row="13"
Grid.Row="14"
Grid.Column="1"
MinHeight="100"
HorizontalAlignment="Stretch"

1
v2rayN/v2rayN.Desktop/Views/SubEditWindow.axaml.cs

@ -41,6 +41,7 @@ namespace v2rayN.Desktop.Views
this.Bind(ViewModel, vm => vm.SelectedSource.PrevProfile, v => v.txtPrevProfile.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SelectedSource.NextProfile, v => v.txtNextProfile.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SelectedSource.PreSocksPort, v => v.txtPreSocksPort.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SelectedSource.Memo, v => v.txtMemo.Text).DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables);
});

29
v2rayN/v2rayN/Views/SubEditWindow.xaml

@ -1,14 +1,14 @@
<reactiveui:ReactiveWindow
x:Class="v2rayN.Views.SubEditWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:reactiveui="http://reactiveui.net"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:conv="clr-namespace:v2rayN.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:reactiveui="http://reactiveui.net"
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
xmlns:conv="clr-namespace:v2rayN.Converters"
Title="{x:Static resx:ResUI.menuSubSetting}"
Width="700"
Height="600"
@ -70,6 +70,7 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
@ -165,7 +166,7 @@
<TextBox
x:Name="txtAutoUpdateInterval"
Width="200"
Width="100"
Margin="{StaticResource Margin4}"
VerticalAlignment="Top"
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.SubUrlTips}"
@ -300,6 +301,24 @@
AcceptsReturn="True"
Style="{StaticResource MyOutlinedTextBox}"
ToolTip="{x:Static resx:ResUI.TipPreSocksPort}" />
<TextBlock
Grid.Row="12"
Grid.Column="0"
Margin="{StaticResource Margin4}"
VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.LvMemo}" />
<TextBox
x:Name="txtMemo"
Grid.Row="12"
Grid.Column="1"
Margin="{StaticResource Margin4}"
VerticalAlignment="Top"
AcceptsReturn="True"
Style="{StaticResource MyOutlinedTextBox}"
TextWrapping="Wrap" />
</Grid>
</ScrollViewer>
</DockPanel>

1
v2rayN/v2rayN/Views/SubEditWindow.xaml.cs

@ -34,6 +34,7 @@ namespace v2rayN.Views
this.Bind(ViewModel, vm => vm.SelectedSource.PrevProfile, v => v.txtPrevProfile.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SelectedSource.NextProfile, v => v.txtNextProfile.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SelectedSource.PreSocksPort, v => v.txtPreSocksPort.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SelectedSource.Memo, v => v.txtMemo.Text).DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables);
});

Loading…
Cancel
Save