From 1e148ba121c2b91530dfe6e3bfde8e9bf976e566 Mon Sep 17 00:00:00 2001 From: Travis Nickles Date: Tue, 24 Dec 2019 17:46:25 -0600 Subject: [PATCH] Switch active profile when new profile is created --- DS4Windows/DS4Forms/MainWindow.xaml.cs | 5 +++++ DS4Windows/DS4Forms/ProfileEditor.xaml.cs | 1 + 2 files changed, 6 insertions(+) diff --git a/DS4Windows/DS4Forms/MainWindow.xaml.cs b/DS4Windows/DS4Forms/MainWindow.xaml.cs index 826985f..21bfcd4 100644 --- a/DS4Windows/DS4Forms/MainWindow.xaml.cs +++ b/DS4Windows/DS4Forms/MainWindow.xaml.cs @@ -1284,6 +1284,11 @@ Properties.Resources.DS4Update, MessageBoxButton.YesNo, MessageBoxImage.Question private void Editor_CreatedProfile(ProfileEditor sender, string profile) { profileListHolder.AddProfileSort(profile); + int devnum = sender.DeviceNum; + if (devnum >= 0 && devnum+1 <= conLvViewModel.ControllerCol.Count) + { + conLvViewModel.ControllerCol[devnum].ChangeSelectedProfile(profile); + } } private void NotifyIcon_TrayMouseDoubleClick(object sender, RoutedEventArgs e) diff --git a/DS4Windows/DS4Forms/ProfileEditor.xaml.cs b/DS4Windows/DS4Forms/ProfileEditor.xaml.cs index 8fb8448..aac3450 100644 --- a/DS4Windows/DS4Forms/ProfileEditor.xaml.cs +++ b/DS4Windows/DS4Forms/ProfileEditor.xaml.cs @@ -52,6 +52,7 @@ namespace DS4WinWPF.DS4Forms private bool keepsize; private bool controllerReadingsTabActive = false; public bool Keepsize { get => keepsize; } + public int DeviceNum { get => deviceNum; } private NonFormTimer inputTimer;