From 305110f239c2970ca03f2ff1e7822bba016fefa5 Mon Sep 17 00:00:00 2001 From: dbuechel Date: Wed, 8 May 2019 10:12:22 +0200 Subject: [PATCH] SEBWIN-104: Made about notification configurable and removed it and log notification from taskbar by default. --- .../Operations/ShellOperationTests.cs | 2 ++ .../Operations/ShellOperation.cs | 18 ++++++++++++------ .../ConfigurationData/DataValues.cs | 4 +++- .../Settings/ActionCenterSettings.cs | 5 +++++ .../Configuration/Settings/TaskbarSettings.cs | 5 +++++ 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/SafeExamBrowser.Client.UnitTests/Operations/ShellOperationTests.cs b/SafeExamBrowser.Client.UnitTests/Operations/ShellOperationTests.cs index 25fdc454..b0f31e56 100644 --- a/SafeExamBrowser.Client.UnitTests/Operations/ShellOperationTests.cs +++ b/SafeExamBrowser.Client.UnitTests/Operations/ShellOperationTests.cs @@ -146,8 +146,10 @@ namespace SafeExamBrowser.Client.UnitTests.Operations public void Perform_MustInitializeNotifications() { actionCenterSettings.EnableActionCenter = true; + actionCenterSettings.ShowApplicationInfo = true; actionCenterSettings.ShowApplicationLog = true; taskbarSettings.EnableTaskbar = true; + taskbarSettings.ShowApplicationInfo = true; taskbarSettings.ShowApplicationLog = true; sut.Perform(); diff --git a/SafeExamBrowser.Client/Operations/ShellOperation.cs b/SafeExamBrowser.Client/Operations/ShellOperation.cs index d6bb506a..b9e929ab 100644 --- a/SafeExamBrowser.Client/Operations/ShellOperation.cs +++ b/SafeExamBrowser.Client/Operations/ShellOperation.cs @@ -169,18 +169,24 @@ namespace SafeExamBrowser.Client.Operations private void InitializeAboutNotificationForActionCenter() { - var notification = uiFactory.CreateNotificationControl(aboutInfo, Location.ActionCenter); + if (actionCenterSettings.ShowApplicationInfo) + { + var notification = uiFactory.CreateNotificationControl(aboutInfo, Location.ActionCenter); - aboutController.RegisterNotification(notification); - actionCenter.AddNotificationControl(notification); + aboutController.RegisterNotification(notification); + actionCenter.AddNotificationControl(notification); + } } private void InitializeAboutNotificationForTaskbar() { - var notification = uiFactory.CreateNotificationControl(aboutInfo, Location.Taskbar); + if (taskbarSettings.ShowApplicationInfo) + { + var notification = uiFactory.CreateNotificationControl(aboutInfo, Location.Taskbar); - aboutController.RegisterNotification(notification); - taskbar.AddNotificationControl(notification); + aboutController.RegisterNotification(notification); + taskbar.AddNotificationControl(notification); + } } private void InitializeClockForActionCenter() diff --git a/SafeExamBrowser.Configuration/ConfigurationData/DataValues.cs b/SafeExamBrowser.Configuration/ConfigurationData/DataValues.cs index e0b2d398..f8e4e5c4 100644 --- a/SafeExamBrowser.Configuration/ConfigurationData/DataValues.cs +++ b/SafeExamBrowser.Configuration/ConfigurationData/DataValues.cs @@ -89,6 +89,7 @@ namespace SafeExamBrowser.Configuration.ConfigurationData var settings = new Settings(); settings.ActionCenter.EnableActionCenter = true; + settings.ActionCenter.ShowApplicationInfo = true; settings.ActionCenter.ShowApplicationLog = false; settings.ActionCenter.ShowKeyboardLayout = true; settings.ActionCenter.ShowWirelessNetwork = false; @@ -142,10 +143,11 @@ namespace SafeExamBrowser.Configuration.ConfigurationData settings.ServicePolicy = ServicePolicy.Optional; + settings.Taskbar.EnableTaskbar = true; + settings.Taskbar.ShowApplicationInfo = false; settings.Taskbar.ShowApplicationLog = false; settings.Taskbar.ShowKeyboardLayout = true; settings.Taskbar.ShowWirelessNetwork = false; - settings.Taskbar.EnableTaskbar = true; settings.Taskbar.ShowClock = true; settings.UserInterfaceMode = UserInterfaceMode.Desktop; diff --git a/SafeExamBrowser.Contracts/Configuration/Settings/ActionCenterSettings.cs b/SafeExamBrowser.Contracts/Configuration/Settings/ActionCenterSettings.cs index fc760d21..dc27e50f 100644 --- a/SafeExamBrowser.Contracts/Configuration/Settings/ActionCenterSettings.cs +++ b/SafeExamBrowser.Contracts/Configuration/Settings/ActionCenterSettings.cs @@ -21,6 +21,11 @@ namespace SafeExamBrowser.Contracts.Configuration.Settings /// public bool EnableActionCenter { get; set; } + /// + /// Determines whether the about window is accessible via the action center. + /// + public bool ShowApplicationInfo { get; set; } + /// /// Determines whether the application log is accessible via the action center. /// diff --git a/SafeExamBrowser.Contracts/Configuration/Settings/TaskbarSettings.cs b/SafeExamBrowser.Contracts/Configuration/Settings/TaskbarSettings.cs index e2524fbb..a9939cc1 100644 --- a/SafeExamBrowser.Contracts/Configuration/Settings/TaskbarSettings.cs +++ b/SafeExamBrowser.Contracts/Configuration/Settings/TaskbarSettings.cs @@ -21,6 +21,11 @@ namespace SafeExamBrowser.Contracts.Configuration.Settings /// public bool EnableTaskbar { get; set; } + /// + /// Determines whether the about window is accessible via the taskbar. + /// + public bool ShowApplicationInfo { get; set; } + /// /// Determines whether the application log is accessible via the taskbar. ///