diff --git a/Source/NETworkManager.Settings/ConfigurationInfo.cs b/Source/NETworkManager.Settings/ConfigurationInfo.cs index b092949113..bf5686edc9 100644 --- a/Source/NETworkManager.Settings/ConfigurationInfo.cs +++ b/Source/NETworkManager.Settings/ConfigurationInfo.cs @@ -451,6 +451,27 @@ public bool IsChildWindowOpen } } + /// + /// Private variable for . + /// + private bool _isProfileFilterPopupOpen; + + /// + /// Indicates if a profile filter popup is open. + /// + public bool IsProfileFilterPopupOpen + { + get => _isProfileFilterPopupOpen; + set + { + if (value == _isProfileFilterPopupOpen) + return; + + _isProfileFilterPopupOpen = value; + OnPropertyChanged(); + } + } + /// /// Private variable for . /// diff --git a/Source/NETworkManager/MainWindow.xaml.cs b/Source/NETworkManager/MainWindow.xaml.cs index 2283b044c9..b3935b33cc 100644 --- a/Source/NETworkManager/MainWindow.xaml.cs +++ b/Source/NETworkManager/MainWindow.xaml.cs @@ -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(); @@ -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; diff --git a/Source/NETworkManager/ViewModels/AWSSessionManagerHostViewModel.cs b/Source/NETworkManager/ViewModels/AWSSessionManagerHostViewModel.cs index dbeee6c554..98433b6b12 100644 --- a/Source/NETworkManager/ViewModels/AWSSessionManagerHostViewModel.cs +++ b/Source/NETworkManager/ViewModels/AWSSessionManagerHostViewModel.cs @@ -599,6 +599,8 @@ public ICommand TextBoxSearchLostFocusCommand private void OpenProfileFilterAction() { + ConfigurationManager.Current.IsProfileFilterPopupOpen = true; + ProfileFilterIsOpen = true; } @@ -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(); diff --git a/Source/NETworkManager/ViewModels/PowerShellHostViewModel.cs b/Source/NETworkManager/ViewModels/PowerShellHostViewModel.cs index e8b95e1c10..7836fb0e0b 100644 --- a/Source/NETworkManager/ViewModels/PowerShellHostViewModel.cs +++ b/Source/NETworkManager/ViewModels/PowerShellHostViewModel.cs @@ -233,10 +233,10 @@ public bool IsProfileFilterSet OnPropertyChanged(); } } - + private readonly GroupExpanderStateStore _groupExpanderStateStore = new(); public GroupExpanderStateStore GroupExpanderStateStore => _groupExpanderStateStore; - + private bool _canProfileWidthChange = true; private double _tempProfileWidth; @@ -492,6 +492,8 @@ private void ClearSearchAction() private void OpenProfileFilterAction() { + ConfigurationManager.Current.IsProfileFilterPopupOpen = true; + ProfileFilterIsOpen = true; } @@ -517,7 +519,7 @@ private void ClearProfileFilterAction() IsProfileFilterSet = false; ProfileFilterIsOpen = false; } - + public ICommand ExpandAllProfileGroupsCommand => new RelayCommand(_ => ExpandAllProfileGroupsAction()); private void ExpandAllProfileGroupsAction() @@ -531,7 +533,7 @@ private void CollapseAllProfileGroupsAction() { SetIsExpandedForAllProfileGroups(false); } - + public ICommand OpenSettingsCommand => new RelayCommand(_ => OpenSettingsAction()); private static void OpenSettingsAction() @@ -674,7 +676,7 @@ private void SetIsExpandedForAllProfileGroups(bool isExpanded) foreach (var group in Profiles.Groups.Cast()) GroupExpanderStateStore[group.Name.ToString()] = isExpanded; } - + private void ResizeProfile(bool dueToChangedSize) { _canProfileWidthChange = false; @@ -766,7 +768,7 @@ private void CreateTags() ProfileFilterTags.Add(new ProfileFilterTagsInfo(false, tag)); } } - + private void SetProfilesView(ProfileFilterInfo filter, ProfileInfo profile = null) { Profiles = new CollectionViewSource @@ -809,6 +811,11 @@ private void RefreshProfiles() }, SelectedProfile); } + public void OnProfileFilterClosed() + { + ConfigurationManager.Current.IsProfileFilterPopupOpen = false; + } + public void OnProfileManagerDialogOpen() { ConfigurationManager.OnDialogOpen(); @@ -841,7 +848,7 @@ private void WriteDefaultProfileToRegistry() private void ProfileManager_OnProfilesUpdated(object sender, EventArgs e) { CreateTags(); - + RefreshProfiles(); } diff --git a/Source/NETworkManager/ViewModels/PuTTYHostViewModel.cs b/Source/NETworkManager/ViewModels/PuTTYHostViewModel.cs index 2c37057a90..3223efcfc3 100644 --- a/Source/NETworkManager/ViewModels/PuTTYHostViewModel.cs +++ b/Source/NETworkManager/ViewModels/PuTTYHostViewModel.cs @@ -503,6 +503,8 @@ public ICommand TextBoxSearchLostFocusCommand private void OpenProfileFilterAction() { + ConfigurationManager.Current.IsProfileFilterPopupOpen = true; + ProfileFilterIsOpen = true; } @@ -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(); diff --git a/Source/NETworkManager/Views/AWSSessionManagerHostView.xaml b/Source/NETworkManager/Views/AWSSessionManagerHostView.xaml index 8c15b314fc..3a66a61e2f 100644 --- a/Source/NETworkManager/Views/AWSSessionManagerHostView.xaml +++ b/Source/NETworkManager/Views/AWSSessionManagerHostView.xaml @@ -402,6 +402,7 @@