mirror of
https://github.com/2dust/v2rayN.git
synced 2025-10-13 11:59:13 +00:00
Exclude specific profile types from selection
This commit is contained in:
parent
9202390fa1
commit
f4805a399b
6 changed files with 16 additions and 20 deletions
|
@ -2,6 +2,7 @@ using System.Reactive.Disposables;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Input;
|
using Avalonia.Input;
|
||||||
using Avalonia.Interactivity;
|
using Avalonia.Interactivity;
|
||||||
|
using DynamicData;
|
||||||
using ReactiveUI;
|
using ReactiveUI;
|
||||||
using v2rayN.Desktop.Base;
|
using v2rayN.Desktop.Base;
|
||||||
|
|
||||||
|
@ -135,15 +136,13 @@ public partial class AddGroupServerWindow : WindowBase<AddGroupServerViewModel>
|
||||||
private async void MenuAddChild_Click(object? sender, RoutedEventArgs e)
|
private async void MenuAddChild_Click(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
var selectWindow = new ProfilesSelectWindow();
|
var selectWindow = new ProfilesSelectWindow();
|
||||||
selectWindow.SetConfigTypeFilter(new[] { EConfigType.Custom }, exclude: true);
|
selectWindow.SetConfigTypeFilter(new[] { EConfigType.Custom, EConfigType.PolicyGroup, EConfigType.ProxyChain }, exclude: true);
|
||||||
|
selectWindow.AllowMultiSelect(true);
|
||||||
var result = await selectWindow.ShowDialog<bool?>(this);
|
var result = await selectWindow.ShowDialog<bool?>(this);
|
||||||
if (result == true)
|
if (result == true)
|
||||||
{
|
{
|
||||||
var profile = await selectWindow.ProfileItem;
|
var profiles = await selectWindow.ProfileItems;
|
||||||
if (profile != null && ViewModel != null)
|
ViewModel?.ChildItemsObs.AddRange(profiles);
|
||||||
{
|
|
||||||
ViewModel.ChildItemsObs.Add(profile);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,7 +98,7 @@ public partial class RoutingRuleDetailsWindow : WindowBase<RoutingRuleDetailsVie
|
||||||
private async void BtnSelectProfile_Click(object? sender, RoutedEventArgs e)
|
private async void BtnSelectProfile_Click(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
var selectWindow = new ProfilesSelectWindow();
|
var selectWindow = new ProfilesSelectWindow();
|
||||||
selectWindow.SetConfigTypeFilter(new[] { EConfigType.Custom }, exclude: true);
|
selectWindow.SetConfigTypeFilter(new[] { EConfigType.Custom, EConfigType.PolicyGroup, EConfigType.ProxyChain }, exclude: true);
|
||||||
var result = await selectWindow.ShowDialog<bool?>(this);
|
var result = await selectWindow.ShowDialog<bool?>(this);
|
||||||
if (result == true)
|
if (result == true)
|
||||||
{
|
{
|
||||||
|
|
|
@ -63,7 +63,7 @@ public partial class SubEditWindow : WindowBase<SubEditViewModel>
|
||||||
private async void BtnSelectPrevProfile_Click(object? sender, RoutedEventArgs e)
|
private async void BtnSelectPrevProfile_Click(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
var selectWindow = new ProfilesSelectWindow();
|
var selectWindow = new ProfilesSelectWindow();
|
||||||
selectWindow.SetConfigTypeFilter(new[] { EConfigType.Custom }, exclude: true);
|
selectWindow.SetConfigTypeFilter(new[] { EConfigType.Custom, EConfigType.PolicyGroup, EConfigType.ProxyChain }, exclude: true);
|
||||||
var result = await selectWindow.ShowDialog<bool?>(this);
|
var result = await selectWindow.ShowDialog<bool?>(this);
|
||||||
if (result == true)
|
if (result == true)
|
||||||
{
|
{
|
||||||
|
@ -78,7 +78,7 @@ public partial class SubEditWindow : WindowBase<SubEditViewModel>
|
||||||
private async void BtnSelectNextProfile_Click(object? sender, RoutedEventArgs e)
|
private async void BtnSelectNextProfile_Click(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
var selectWindow = new ProfilesSelectWindow();
|
var selectWindow = new ProfilesSelectWindow();
|
||||||
selectWindow.SetConfigTypeFilter(new[] { EConfigType.Custom }, exclude: true);
|
selectWindow.SetConfigTypeFilter(new[] { EConfigType.Custom, EConfigType.PolicyGroup, EConfigType.ProxyChain }, exclude: true);
|
||||||
var result = await selectWindow.ShowDialog<bool?>(this);
|
var result = await selectWindow.ShowDialog<bool?>(this);
|
||||||
if (result == true)
|
if (result == true)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,6 +2,7 @@ using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using ReactiveUI;
|
using ReactiveUI;
|
||||||
using System.Reactive.Disposables;
|
using System.Reactive.Disposables;
|
||||||
|
using DynamicData;
|
||||||
|
|
||||||
namespace v2rayN.Views;
|
namespace v2rayN.Views;
|
||||||
|
|
||||||
|
@ -111,16 +112,12 @@ public partial class AddGroupServerWindow
|
||||||
private async void MenuAddChild_Click(object sender, RoutedEventArgs e)
|
private async void MenuAddChild_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
var selectWindow = new ProfilesSelectWindow();
|
var selectWindow = new ProfilesSelectWindow();
|
||||||
|
selectWindow.SetConfigTypeFilter(new[] { EConfigType.Custom, EConfigType.PolicyGroup, EConfigType.ProxyChain }, exclude: true);
|
||||||
|
selectWindow.AllowMultiSelect(true);
|
||||||
if (selectWindow.ShowDialog() == true)
|
if (selectWindow.ShowDialog() == true)
|
||||||
{
|
{
|
||||||
var profile = await selectWindow.ProfileItem;
|
var profiles = await selectWindow.ProfileItems;
|
||||||
if (profile != null)
|
ViewModel?.ChildItemsObs.AddRange(profiles);
|
||||||
{
|
|
||||||
if (ViewModel != null)
|
|
||||||
{
|
|
||||||
ViewModel.ChildItemsObs.Add(profile);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,7 +91,7 @@ public partial class RoutingRuleDetailsWindow
|
||||||
private async void BtnSelectProfile_Click(object sender, RoutedEventArgs e)
|
private async void BtnSelectProfile_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
var selectWindow = new ProfilesSelectWindow();
|
var selectWindow = new ProfilesSelectWindow();
|
||||||
selectWindow.SetConfigTypeFilter(new[] { EConfigType.Custom }, exclude: true);
|
selectWindow.SetConfigTypeFilter(new[] { EConfigType.Custom, EConfigType.PolicyGroup, EConfigType.ProxyChain }, exclude: true);
|
||||||
if (selectWindow.ShowDialog() == true)
|
if (selectWindow.ShowDialog() == true)
|
||||||
{
|
{
|
||||||
var profile = await selectWindow.ProfileItem;
|
var profile = await selectWindow.ProfileItem;
|
||||||
|
|
|
@ -57,7 +57,7 @@ public partial class SubEditWindow
|
||||||
private async void BtnSelectPrevProfile_Click(object sender, RoutedEventArgs e)
|
private async void BtnSelectPrevProfile_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
var selectWindow = new ProfilesSelectWindow();
|
var selectWindow = new ProfilesSelectWindow();
|
||||||
selectWindow.SetConfigTypeFilter(new[] { EConfigType.Custom }, exclude: true);
|
selectWindow.SetConfigTypeFilter(new[] { EConfigType.Custom, EConfigType.PolicyGroup, EConfigType.ProxyChain }, exclude: true);
|
||||||
if (selectWindow.ShowDialog() == true)
|
if (selectWindow.ShowDialog() == true)
|
||||||
{
|
{
|
||||||
var profile = await selectWindow.ProfileItem;
|
var profile = await selectWindow.ProfileItem;
|
||||||
|
@ -71,7 +71,7 @@ public partial class SubEditWindow
|
||||||
private async void BtnSelectNextProfile_Click(object sender, RoutedEventArgs e)
|
private async void BtnSelectNextProfile_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
var selectWindow = new ProfilesSelectWindow();
|
var selectWindow = new ProfilesSelectWindow();
|
||||||
selectWindow.SetConfigTypeFilter(new[] { EConfigType.Custom }, exclude: true);
|
selectWindow.SetConfigTypeFilter(new[] { EConfigType.Custom, EConfigType.PolicyGroup, EConfigType.ProxyChain }, exclude: true);
|
||||||
if (selectWindow.ShowDialog() == true)
|
if (selectWindow.ShowDialog() == true)
|
||||||
{
|
{
|
||||||
var profile = await selectWindow.ProfileItem;
|
var profile = await selectWindow.ProfileItem;
|
||||||
|
|
Loading…
Reference in a new issue