Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Source/NETworkManager.Settings/ConfigurationInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,27 @@ public bool IsChildWindowOpen
}
}

/// <summary>
/// Private variable for <see cref="IsProfileFilterPopupOpen" />.
/// </summary>
private bool _isProfileFilterPopupOpen;

/// <summary>
/// Indicates if a profile filter popup is open.
/// </summary>
public bool IsProfileFilterPopupOpen
{
get => _isProfileFilterPopupOpen;
set
{
if (value == _isProfileFilterPopupOpen)
return;

_isProfileFilterPopupOpen = value;
OnPropertyChanged();
}
}

/// <summary>
/// Private variable for <see cref="FixAirspace" />.
/// </summary>
Expand Down
10 changes: 8 additions & 2 deletions Source/NETworkManager/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,7 @@ private async void LoadProfile(ProfileFileInfo info, bool showWrongPassword = fa
}, info.Name, showWrongPassword);

childWindow.Title = Strings.UnlockProfileFile;

childWindow.DataContext = viewModel;

ConfigurationManager.OnDialogOpen();
Expand Down Expand Up @@ -2004,10 +2004,16 @@ private async void FocusEmbeddedWindow()
- Settings are opened
- Profile file DropDown is opened
- Application search TextBox is opened
- Profile filter (tags) popup is opened
- Dialog over an embedded window is opened (FixAirspace)
*/
if (SelectedApplication == null || SettingsViewIsOpen || IsProfileFileDropDownOpened ||
if (SelectedApplication == null ||
// MainWindow
SettingsViewIsOpen ||
IsProfileFileDropDownOpened ||
TextBoxApplicationSearchIsFocused ||
// Global dialogs
ConfigurationManager.Current.IsProfileFilterPopupOpen ||
ConfigurationManager.Current.FixAirspace)
return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,8 @@ public ICommand TextBoxSearchLostFocusCommand

private void OpenProfileFilterAction()
{
ConfigurationManager.Current.IsProfileFilterPopupOpen = true;

ProfileFilterIsOpen = true;
}

Expand Down Expand Up @@ -1183,6 +1185,11 @@ private void RefreshProfiles()
IsProfileFilterSet = !string.IsNullOrEmpty(filter.Search) || filter.Tags.Any();
}

public void OnProfileFilterClosed()
{
ConfigurationManager.Current.IsProfileFilterPopupOpen = false;
}

public void OnProfileManagerDialogOpen()
{
ConfigurationManager.OnDialogOpen();
Expand Down
21 changes: 14 additions & 7 deletions Source/NETworkManager/ViewModels/PowerShellHostViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,10 @@ public bool IsProfileFilterSet
OnPropertyChanged();
}
}

private readonly GroupExpanderStateStore _groupExpanderStateStore = new();
public GroupExpanderStateStore GroupExpanderStateStore => _groupExpanderStateStore;

private bool _canProfileWidthChange = true;
private double _tempProfileWidth;

Expand Down Expand Up @@ -492,6 +492,8 @@ private void ClearSearchAction()

private void OpenProfileFilterAction()
{
ConfigurationManager.Current.IsProfileFilterPopupOpen = true;

ProfileFilterIsOpen = true;
}

Expand All @@ -517,7 +519,7 @@ private void ClearProfileFilterAction()
IsProfileFilterSet = false;
ProfileFilterIsOpen = false;
}

public ICommand ExpandAllProfileGroupsCommand => new RelayCommand(_ => ExpandAllProfileGroupsAction());

private void ExpandAllProfileGroupsAction()
Expand All @@ -531,7 +533,7 @@ private void CollapseAllProfileGroupsAction()
{
SetIsExpandedForAllProfileGroups(false);
}

public ICommand OpenSettingsCommand => new RelayCommand(_ => OpenSettingsAction());

private static void OpenSettingsAction()
Expand Down Expand Up @@ -674,7 +676,7 @@ private void SetIsExpandedForAllProfileGroups(bool isExpanded)
foreach (var group in Profiles.Groups.Cast<CollectionViewGroup>())
GroupExpanderStateStore[group.Name.ToString()] = isExpanded;
}

private void ResizeProfile(bool dueToChangedSize)
{
_canProfileWidthChange = false;
Expand Down Expand Up @@ -766,7 +768,7 @@ private void CreateTags()
ProfileFilterTags.Add(new ProfileFilterTagsInfo(false, tag));
}
}

private void SetProfilesView(ProfileFilterInfo filter, ProfileInfo profile = null)
{
Profiles = new CollectionViewSource
Expand Down Expand Up @@ -809,6 +811,11 @@ private void RefreshProfiles()
}, SelectedProfile);
}

public void OnProfileFilterClosed()
{
ConfigurationManager.Current.IsProfileFilterPopupOpen = false;
}

public void OnProfileManagerDialogOpen()
{
ConfigurationManager.OnDialogOpen();
Expand Down Expand Up @@ -841,7 +848,7 @@ private void WriteDefaultProfileToRegistry()
private void ProfileManager_OnProfilesUpdated(object sender, EventArgs e)
{
CreateTags();

RefreshProfiles();
}

Expand Down
7 changes: 7 additions & 0 deletions Source/NETworkManager/ViewModels/PuTTYHostViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,8 @@ public ICommand TextBoxSearchLostFocusCommand

private void OpenProfileFilterAction()
{
ConfigurationManager.Current.IsProfileFilterPopupOpen = true;

ProfileFilterIsOpen = true;
}

Expand Down Expand Up @@ -901,6 +903,11 @@ private void RefreshProfiles()
IsProfileFilterSet = !string.IsNullOrEmpty(filter.Search) || filter.Tags.Any();
}

public void OnProfileFilterClosed()
{
ConfigurationManager.Current.IsProfileFilterPopupOpen = false;
}

public void OnProfileManagerDialogOpen()
{
ConfigurationManager.OnDialogOpen();
Expand Down
1 change: 1 addition & 0 deletions Source/NETworkManager/Views/AWSSessionManagerHostView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@
</Button>
<Popup PlacementTarget="{Binding ElementName=ButtonProfileFilter}"
Placement="Bottom" StaysOpen="False"
Closed="PopupProfileFilter_Closed"
IsOpen="{Binding ProfileFilterIsOpen}"
Width="220">
<Border Background="{DynamicResource MahApps.Brushes.Window.Background}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Windows;
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using MahApps.Metro.Controls.Dialogs;
Expand Down Expand Up @@ -54,4 +55,9 @@ public void FocusEmbeddedWindow()
{
_viewModel.FocusEmbeddedWindow();
}

private void PopupProfileFilter_Closed(object sender, EventArgs e)
{
_viewModel.OnProfileFilterClosed();
}
}
1 change: 1 addition & 0 deletions Source/NETworkManager/Views/PowerShellHostView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@
</Button>
<Popup PlacementTarget="{Binding ElementName=ButtonProfileFilter}"
Placement="Bottom" StaysOpen="False"
Closed="PopupProfileFilter_Closed"
IsOpen="{Binding ProfileFilterIsOpen}"
Width="220">
<Border Background="{DynamicResource MahApps.Brushes.Window.Background}"
Expand Down
7 changes: 6 additions & 1 deletion Source/NETworkManager/Views/PowerShellHostView.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,9 @@ public void FocusEmbeddedWindow()
{
_viewModel.FocusEmbeddedWindow();
}
}

private void PopupProfileFilter_Closed(object sender, System.EventArgs e)
{
_viewModel.OnProfileFilterClosed();
}
}
1 change: 1 addition & 0 deletions Source/NETworkManager/Views/PuTTYHostView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@
</Button>
<Popup PlacementTarget="{Binding ElementName=ButtonProfileFilter}"
Placement="Bottom" StaysOpen="False"
Closed="PopupProfileFilter_Closed"
IsOpen="{Binding ProfileFilterIsOpen}"
Width="220">
<Border Background="{DynamicResource MahApps.Brushes.Window.Background}"
Expand Down
8 changes: 7 additions & 1 deletion Source/NETworkManager/Views/PuTTYHostView.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Threading.Tasks;
using System;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
Expand Down Expand Up @@ -61,4 +62,9 @@ public void FocusEmbeddedWindow()
{
_viewModel.FocusEmbeddedWindow();
}

private void PopupProfileFilter_Closed(object sender, EventArgs e)
{
_viewModel.OnProfileFilterClosed();
}
}
2 changes: 2 additions & 0 deletions Website/docs/changelog/next-release.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Release date: **xx.xx.2025**

## Bug Fixes

- The new profile filter popup indroduced in version `2025.10.18.0` was instantly closed when a `PuTTY`, `PowerShell` or `AWS Session Manager` session was opened and the respective application / view was selected. [#3219](https://github.com/BornToBeRoot/NETworkManager/pull/3219)

## Dependencies, Refactoring & Documentation

- Documentation updated
Expand Down