From 016a8d58f94a01070d248e49afd09dcd323c1caf Mon Sep 17 00:00:00 2001 From: Tim Kennedy Date: Sat, 22 Jul 2023 17:02:04 -0500 Subject: [PATCH] Added option to include KB Number and Result in exclude processing --- WUView/Configuration/SettingChange.cs | 4 ++++ WUView/Configuration/UserSettings.cs | 3 +++ WUView/ReadMe.txt | 31 ++++++++++++++------------- WUView/ViewModels/MainViewModel.cs | 20 +++++++++++++++-- WUView/Views/SettingsPage.xaml | 23 ++++++++++++-------- 5 files changed, 55 insertions(+), 26 deletions(-) diff --git a/WUView/Configuration/SettingChange.cs b/WUView/Configuration/SettingChange.cs index 32b8564..5679c6a 100644 --- a/WUView/Configuration/SettingChange.cs +++ b/WUView/Configuration/SettingChange.cs @@ -45,6 +45,10 @@ public static void UserSettingChanged(object sender, PropertyChangedEventArgs e) case nameof(UserSettings.Setting.MaxUpdates): MainPage.RefreshAll(); break; + + case nameof(UserSettings.Setting.ExcludeKBandResult): + MainPage.RefreshAll(); + break; } } diff --git a/WUView/Configuration/UserSettings.cs b/WUView/Configuration/UserSettings.cs index 54c08af..7246503 100644 --- a/WUView/Configuration/UserSettings.cs +++ b/WUView/Configuration/UserSettings.cs @@ -30,6 +30,9 @@ public partial class UserSettings : ConfigManager [ObservableProperty] private double _detailsHeight = 300; + [ObservableProperty] + private bool _excludeKBandResult; + [ObservableProperty] private bool _hideExcluded = true; diff --git a/WUView/ReadMe.txt b/WUView/ReadMe.txt index bf76f9f..eb6c9ca 100644 --- a/WUView/ReadMe.txt +++ b/WUView/ReadMe.txt @@ -66,7 +66,8 @@ Other options on the navigation bar include the Settings dialog. You can select Material Dark, Darker and System themes. You can select the accent color and you can choose from seven size options for the app. You can choose from three options for row spacing in the grid. You can also control the visibility of the Details pane and to show or hide updated that match items on the exclude -list. You can choose to have updates with the current date shown in bold. There are also options to +list. You can also choose if the exclude process looks at the KB Number and Result fields as well as the +Title. You can choose to have updates with the current date shown in bold. There are also options to have WUView stay on top of other windows and you can control the detail level of the log file. @@ -81,20 +82,20 @@ Keyboard Shortcuts ================== These keyboard shortcuts are available: - F1 = Go to the About screen - F5 = Check for new updates and refresh the grid - ESC = Removes any filter (while on the viewer page) - Ctrl + D = Toggle the Details pane - Ctrl + E = Toggle display of excluded items - Ctrl + L = Open the Excludes Editor - Ctrl + R = Reset column sort - Ctrl + T = Change the date & time format - Ctrl + U = Navigate to the Updates page - Ctrl + Comma = Go to Settings - Ctrl + Numpad Plus = Increase size - Ctrl + Numpad Minus = Decrease size - Ctrl + Shift + C = Change the accent Color - Ctrl + Shift + T = Change the Theme + F1 = Go to the About screen + F5 = Check for new updates and refresh the grid + ESC = Removes any filter (while on the viewer page) + Ctrl + D = Toggle the Details pane + Ctrl + E = Toggle display of excluded items + Ctrl + L = Open the Excludes Editor + Ctrl + R = Reset column sort + Ctrl + T = Change the date & time format + Ctrl + U = Navigate to the Updates page + Ctrl + Comma = Go to Settings + Ctrl + Numpad Plus = Increase size + Ctrl + Numpad Minus = Decrease size + Ctrl + Shift + C = Change the Accent Color + Ctrl + Shift + T = Change the Theme Uninstalling diff --git a/WUView/ViewModels/MainViewModel.cs b/WUView/ViewModels/MainViewModel.cs index 6ef88cc..8cb3c70 100644 --- a/WUView/ViewModels/MainViewModel.cs +++ b/WUView/ViewModels/MainViewModel.cs @@ -185,9 +185,25 @@ public static void PopulateExcludedList() bool skip = false; foreach (ExcludedItems exc in ExcludedItems.ExcludedStrings) { - if (upd.Title.Contains(exc.ExcludedString, StringComparison.OrdinalIgnoreCase) && !skip) + if (skip) { - skip = true; + break; + } + if (UserSettings.Setting.ExcludeKBandResult) + { + if ((upd.Title.Contains(exc.ExcludedString, StringComparison.OrdinalIgnoreCase)) || + (upd.KBNum.Contains(exc.ExcludedString, StringComparison.OrdinalIgnoreCase)) || + (upd.ResultCode.Contains(exc.ExcludedString, StringComparison.OrdinalIgnoreCase))) + { + skip = true; + } + } + else + { + if (upd.Title.Contains(exc.ExcludedString, StringComparison.OrdinalIgnoreCase) && !skip) + { + skip = true; + } } } if (!skip) diff --git a/WUView/Views/SettingsPage.xaml b/WUView/Views/SettingsPage.xaml index 4f988a1..61ffa3b 100644 --- a/WUView/Views/SettingsPage.xaml +++ b/WUView/Views/SettingsPage.xaml @@ -102,6 +102,7 @@ + @@ -171,18 +172,22 @@ IsChecked="{Binding Setting.HideExcluded, Source={StaticResource config}}" /> + - - - @@ -313,13 +318,13 @@ + Content=" Start with window centered on screen" + IsChecked="{Binding StartCentered, + Source={x:Static config:UserSettings.Setting}}" /> + Content="Keep Windows Update Viewer on top of other windows" + IsChecked="{Binding KeepOnTop, + Source={x:Static config:UserSettings.Setting}}" />