Previous and next proxy setting

pull/4567/head
2dust 2023-12-24 10:34:55 +08:00
parent 0d5a9fcf4a
commit 51576b54c3
9 changed files with 148 additions and 43 deletions

View File

@ -1,9 +1,9 @@
<Application <Application
x:Class="v2rayN.App" x:Class="v2rayN.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:conv="clr-namespace:v2rayN.Converters" xmlns:conv="clr-namespace:v2rayN.Converters"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
ShutdownMode="OnExplicitShutdown" ShutdownMode="OnExplicitShutdown"
StartupUri="Views/MainWindow.xaml"> StartupUri="Views/MainWindow.xaml">
<Application.Resources> <Application.Resources>
@ -34,6 +34,12 @@
Left="8" Left="8"
Right="8" Right="8"
Top="8" /> Top="8" />
<Thickness
x:Key="OutlinedTextBoxDefaultPadding"
Bottom="12"
Left="16"
Right="12"
Top="12" />
<Style <Style
x:Key="ModuleTitle" x:Key="ModuleTitle"
BasedOn="{StaticResource MaterialDesignTextBlock}" BasedOn="{StaticResource MaterialDesignTextBlock}"
@ -129,6 +135,7 @@
BasedOn="{StaticResource MaterialDesignOutlinedTextBox}" BasedOn="{StaticResource MaterialDesignOutlinedTextBox}"
TargetType="{x:Type TextBox}"> TargetType="{x:Type TextBox}">
<Setter Property="FontSize" Value="{DynamicResource StdFontSize}" /> <Setter Property="FontSize" Value="{DynamicResource StdFontSize}" />
<Setter Property="Padding" Value="{StaticResource OutlinedTextBoxDefaultPadding}" />
</Style> </Style>
<Style <Style
x:Key="MyGroupBox" x:Key="MyGroupBox"
@ -142,6 +149,13 @@
TargetType="{x:Type ListBoxItem}"> TargetType="{x:Type ListBoxItem}">
<Setter Property="Margin" Value="-2,0" /> <Setter Property="Margin" Value="-2,0" />
</Style> </Style>
<Style
x:Key="MyOutlinedTextComboBox"
BasedOn="{StaticResource MaterialDesignOutlinedComboBox}"
TargetType="{x:Type ComboBox}">
<Setter Property="FontSize" Value="{DynamicResource StdFontSize}" />
<Setter Property="Padding" Value="{StaticResource OutlinedTextBoxDefaultPadding}" />
</Style>
</ResourceDictionary> </ResourceDictionary>
</Application.Resources> </Application.Resources>
</Application> </Application>

View File

@ -447,6 +447,15 @@ namespace v2rayN.Resx {
} }
} }
/// <summary>
/// 查找类似 Next proxy remarks 的本地化字符串。
/// </summary>
public static string LvNextProfile {
get {
return ResourceManager.GetString("LvNextProfile", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 Port 的本地化字符串。 /// 查找类似 Port 的本地化字符串。
/// </summary> /// </summary>
@ -456,6 +465,24 @@ namespace v2rayN.Resx {
} }
} }
/// <summary>
/// 查找类似 Previous proxy remakrs 的本地化字符串。
/// </summary>
public static string LvPrevProfile {
get {
return ResourceManager.GetString("LvPrevProfile", resourceCulture);
}
}
/// <summary>
/// 查找类似 Please make sure the remarks exists and is unique 的本地化字符串。
/// </summary>
public static string LvPrevProfileTip {
get {
return ResourceManager.GetString("LvPrevProfileTip", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 Remarks 的本地化字符串。 /// 查找类似 Remarks 的本地化字符串。
/// </summary> /// </summary>

View File

@ -1153,4 +1153,13 @@
<data name="TbHeaderType8" xml:space="preserve"> <data name="TbHeaderType8" xml:space="preserve">
<value>Congestion control</value> <value>Congestion control</value>
</data> </data>
<data name="LvPrevProfile" xml:space="preserve">
<value>Previous proxy remakrs</value>
</data>
<data name="LvNextProfile" xml:space="preserve">
<value>Next proxy remarks</value>
</data>
<data name="LvPrevProfileTip" xml:space="preserve">
<value>Please make sure the remarks exists and is unique</value>
</data>
</root> </root>

View File

@ -1150,4 +1150,13 @@
<data name="TbHeaderType8" xml:space="preserve"> <data name="TbHeaderType8" xml:space="preserve">
<value>拥塞控制算法</value> <value>拥塞控制算法</value>
</data> </data>
<data name="LvPrevProfile" xml:space="preserve">
<value>前置代理别名</value>
</data>
<data name="LvNextProfile" xml:space="preserve">
<value>落地代理別名</value>
</data>
<data name="LvPrevProfileTip" xml:space="preserve">
<value>请确保别名存在并唯一</value>
</data>
</root> </root>

View File

@ -1138,4 +1138,13 @@
<data name="menuAddTuicServer" xml:space="preserve"> <data name="menuAddTuicServer" xml:space="preserve">
<value>新增[Tuic]伺服器</value> <value>新增[Tuic]伺服器</value>
</data> </data>
<data name="LvPrevProfile" xml:space="preserve">
<value>前置代理別名</value>
</data>
<data name="LvNextProfile" xml:space="preserve">
<value>落地代理別名</value>
</data>
<data name="LvPrevProfileTip" xml:space="preserve">
<value>請確保別名存在並且唯一</value>
</data>
</root> </root>

View File

@ -69,6 +69,8 @@ namespace v2rayN.ViewModels
item.sort = SelectedSource.sort; item.sort = SelectedSource.sort;
item.filter = SelectedSource.filter; item.filter = SelectedSource.filter;
item.convertTarget = SelectedSource.convertTarget; item.convertTarget = SelectedSource.convertTarget;
item.prevProfile = SelectedSource.prevProfile;
item.nextProfile = SelectedSource.nextProfile;
} }
if (ConfigHandler.AddSubItem(_config, item) == 0) if (ConfigHandler.AddSubItem(_config, item) == 0)

View File

@ -97,17 +97,17 @@
Grid.Row="2" Grid.Row="2"
Grid.Column="2" Grid.Column="2"
VerticalAlignment="Center" VerticalAlignment="Center"
Orientation="Vertical"> Orientation="Horizontal">
<Button <Button
x:Name="btnBrowse" x:Name="btnBrowse"
Width="100" Width="80"
Margin="2,0,8,0" Margin="2,0"
Content="{x:Static resx:ResUI.TbBrowse}" Content="{x:Static resx:ResUI.TbBrowse}"
Style="{StaticResource DefButton}" /> Style="{StaticResource DefButton}" />
<Button <Button
x:Name="btnEdit" x:Name="btnEdit"
Width="100" Width="80"
Margin="2,2,8,0" Margin="2,0"
Content="{x:Static resx:ResUI.TbEdit}" Content="{x:Static resx:ResUI.TbEdit}"
Style="{StaticResource DefButton}" /> Style="{StaticResource DefButton}" />
</StackPanel> </StackPanel>
@ -126,9 +126,8 @@
Width="200" Width="200"
Margin="4" Margin="4"
HorizontalAlignment="Left" HorizontalAlignment="Left"
FontSize="{DynamicResource StdFontSize}"
MaxDropDownHeight="1000" MaxDropDownHeight="1000"
Style="{StaticResource MaterialDesignOutlinedComboBox}" /> Style="{StaticResource MyOutlinedTextComboBox}" />
<TextBlock <TextBlock
Grid.Row="4" Grid.Row="4"

View File

@ -30,17 +30,38 @@
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>
</Window.Resources> </Window.Resources>
<DockPanel Margin="8">
<Grid
Margin="8"
HorizontalAlignment="Center"
DockPanel.Dock="Bottom">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200" />
<ColumnDefinition Width="200" />
</Grid.ColumnDefinitions>
<Button
x:Name="btnSave"
Grid.Column="0"
Margin="4"
Content="{x:Static resx:ResUI.TbConfirm}"
Cursor="Hand"
Style="{StaticResource DefButton}" />
<Button
x:Name="btnCancel"
Grid.Column="1"
Margin="4"
Click="btnCancel_Click"
Content="{x:Static resx:ResUI.TbCancel}"
Cursor="Hand"
IsCancel="true"
Style="{StaticResource DefButton}" />
</Grid>
<ScrollViewer
materialDesign:ScrollViewerAssist.IsAutoHideEnabled="True"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto">
<ScrollViewer <Grid>
materialDesign:ScrollViewerAssist.IsAutoHideEnabled="True"
HorizontalScrollBarVisibility="Auto"
VerticalScrollBarVisibility="Auto">
<Grid Margin="8">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
@ -51,6 +72,8 @@
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
@ -209,9 +232,8 @@
Grid.Column="1" Grid.Column="1"
Margin="4" Margin="4"
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.LvConvertTargetTip}" materialDesign:HintAssist.Hint="{x:Static resx:ResUI.LvConvertTargetTip}"
FontSize="{DynamicResource StdFontSize}"
MaxDropDownHeight="1000" MaxDropDownHeight="1000"
Style="{StaticResource MaterialDesignOutlinedComboBox}" /> Style="{StaticResource MyOutlinedTextComboBox}" />
<TextBlock <TextBlock
Grid.Row="8" Grid.Row="8"
@ -229,32 +251,44 @@
VerticalAlignment="Top" VerticalAlignment="Top"
AcceptsReturn="True" AcceptsReturn="True"
Style="{StaticResource MyOutlinedTextBox}" /> Style="{StaticResource MyOutlinedTextBox}" />
</Grid>
<Grid <TextBlock
Grid.Row="1" Grid.Row="9"
Margin="8"
HorizontalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200" />
<ColumnDefinition Width="200" />
</Grid.ColumnDefinitions>
<Button
x:Name="btnSave"
Grid.Column="0" Grid.Column="0"
Margin="4" Margin="4"
Content="{x:Static resx:ResUI.TbConfirm}" VerticalAlignment="Center"
Cursor="Hand" Style="{StaticResource ToolbarTextBlock}"
Style="{StaticResource DefButton}" /> Text="{x:Static resx:ResUI.LvPrevProfile}" />
<Button <TextBox
x:Name="btnCancel" x:Name="txtPrevProfile"
Grid.Row="9"
Grid.Column="1" Grid.Column="1"
Width="400"
Margin="4" Margin="4"
Click="btnCancel_Click" VerticalAlignment="Top"
Content="{x:Static resx:ResUI.TbCancel}" materialDesign:HintAssist.Hint="{x:Static resx:ResUI.LvPrevProfileTip}"
Cursor="Hand" AcceptsReturn="True"
IsCancel="true" Style="{StaticResource MyOutlinedTextBox}" />
Style="{StaticResource DefButton}" />
<TextBlock
Grid.Row="10"
Grid.Column="0"
Margin="4"
VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.LvNextProfile}" />
<TextBox
x:Name="txtNextProfile"
Grid.Row="10"
Grid.Column="1"
Width="400"
Margin="4"
VerticalAlignment="Top"
materialDesign:HintAssist.Hint="{x:Static resx:ResUI.LvPrevProfileTip}"
AcceptsReturn="True"
Style="{StaticResource MyOutlinedTextBox}" />
</Grid> </Grid>
</Grid>
</ScrollViewer> </ScrollViewer>
</DockPanel>
</reactiveui:ReactiveWindow> </reactiveui:ReactiveWindow>

View File

@ -43,6 +43,8 @@ namespace v2rayN.Views
this.Bind(ViewModel, vm => vm.SelectedSource.sort, v => v.txtSort.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.SelectedSource.sort, v => v.txtSort.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SelectedSource.filter, v => v.txtFilter.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.SelectedSource.filter, v => v.txtFilter.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SelectedSource.convertTarget, v => v.cmbConvertTarget.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.SelectedSource.convertTarget, v => v.cmbConvertTarget.Text).DisposeWith(disposables);
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.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.SaveCmd, v => v.btnSave).DisposeWith(disposables);
}); });