SEBWIN-836: Implemented configuration value for lock screen background color.

This commit is contained in:
Damian Büchel 2024-06-12 17:30:19 +02:00
parent f2798581a4
commit 05f46cd6b4
22 changed files with 794 additions and 516 deletions

View file

@ -33,6 +33,7 @@ using SafeExamBrowser.Server.Contracts;
using SafeExamBrowser.Server.Contracts.Data;
using SafeExamBrowser.Settings;
using SafeExamBrowser.Settings.Monitoring;
using SafeExamBrowser.Settings.UserInterface;
using SafeExamBrowser.SystemComponents.Contracts.Network;
using SafeExamBrowser.SystemComponents.Contracts.Registry;
using SafeExamBrowser.UserInterface.Contracts;
@ -222,9 +223,9 @@ namespace SafeExamBrowser.Client.UnitTests
lockScreen.Setup(l => l.WaitForResult()).Returns(result);
runtimeProxy.Setup(p => p.RequestShutdown()).Returns(new CommunicationResult(true));
uiFactory
.Setup(f => f.CreateLockScreen(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<IEnumerable<LockScreenOption>>()))
.Setup(f => f.CreateLockScreen(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<IEnumerable<LockScreenOption>>(), It.IsAny<LockScreenSettings>()))
.Returns(lockScreen.Object)
.Callback<string, string, IEnumerable<LockScreenOption>>((m, t, o) => result.OptionId = o.First().Id);
.Callback<string, string, IEnumerable<LockScreenOption>, LockScreenSettings>((m, t, o, s) => result.OptionId = o.First().Id);
sut.TryStart();
applicationMonitor.Raise(m => m.TerminationFailed += null, new List<RunningApplication>());
@ -241,9 +242,9 @@ namespace SafeExamBrowser.Client.UnitTests
lockScreen.Setup(l => l.WaitForResult()).Returns(result);
runtimeProxy.Setup(p => p.RequestShutdown()).Returns(new CommunicationResult(true));
uiFactory
.Setup(f => f.CreateLockScreen(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<IEnumerable<LockScreenOption>>()))
.Setup(f => f.CreateLockScreen(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<IEnumerable<LockScreenOption>>(), It.IsAny<LockScreenSettings>()))
.Returns(lockScreen.Object)
.Callback<string, string, IEnumerable<LockScreenOption>>((m, t, o) => result.OptionId = o.Last().Id);
.Callback<string, string, IEnumerable<LockScreenOption>, LockScreenSettings>((m, t, o, s) => result.OptionId = o.Last().Id);
sut.TryStart();
applicationMonitor.Raise(m => m.TerminationFailed += null, new List<RunningApplication>());
@ -275,7 +276,7 @@ namespace SafeExamBrowser.Client.UnitTests
lockScreen.Setup(l => l.WaitForResult()).Callback(() => wait = ++order).Returns(result);
lockScreen.Setup(l => l.Close()).Callback(() => close = ++order);
uiFactory
.Setup(f => f.CreateLockScreen(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<IEnumerable<LockScreenOption>>()))
.Setup(f => f.CreateLockScreen(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<IEnumerable<LockScreenOption>>(), It.IsAny<LockScreenSettings>()))
.Returns(lockScreen.Object);
sut.TryStart();
@ -312,7 +313,7 @@ namespace SafeExamBrowser.Client.UnitTests
hashAlgorithm.Setup(a => a.GenerateHashFor(It.Is<string>(p => p == result.Password))).Returns(hash);
lockScreen.Setup(l => l.WaitForResult()).Returns(lockScreenResult);
uiFactory
.Setup(f => f.CreateLockScreen(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<IEnumerable<LockScreenOption>>()))
.Setup(f => f.CreateLockScreen(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<IEnumerable<LockScreenOption>>(), It.IsAny<LockScreenSettings>()))
.Returns(lockScreen.Object);
sut.TryStart();
@ -561,7 +562,9 @@ namespace SafeExamBrowser.Client.UnitTests
displayMonitor.Setup(m => m.ValidateConfiguration(It.IsAny<DisplaySettings>())).Returns(new ValidationResult { IsAllowed = false });
lockScreen.Setup(l => l.WaitForResult()).Returns(new LockScreenResult());
uiFactory.Setup(f => f.CreateLockScreen(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<IEnumerable<LockScreenOption>>())).Returns(lockScreen.Object);
uiFactory
.Setup(f => f.CreateLockScreen(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<IEnumerable<LockScreenOption>>(), It.IsAny<LockScreenSettings>()))
.Returns(lockScreen.Object);
sut.TryStart();
displayMonitor.Raise(d => d.DisplayChanged += null);
@ -1230,7 +1233,9 @@ namespace SafeExamBrowser.Client.UnitTests
settings.Service.IgnoreService = true;
lockScreen.Setup(l => l.WaitForResult()).Returns(new LockScreenResult());
uiFactory.Setup(f => f.CreateLockScreen(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<IEnumerable<LockScreenOption>>())).Returns(lockScreen.Object);
uiFactory
.Setup(f => f.CreateLockScreen(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<IEnumerable<LockScreenOption>>(), It.IsAny<LockScreenSettings>()))
.Returns(lockScreen.Object);
sut.TryStart();
systemMonitor.Raise(m => m.SessionChanged += null);
@ -1248,8 +1253,8 @@ namespace SafeExamBrowser.Client.UnitTests
lockScreen.Setup(l => l.WaitForResult()).Returns(result);
runtimeProxy.Setup(r => r.RequestShutdown()).Returns(new CommunicationResult(true));
uiFactory
.Setup(f => f.CreateLockScreen(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<IEnumerable<LockScreenOption>>()))
.Callback(new Action<string, string, IEnumerable<LockScreenOption>>((message, title, options) => result.OptionId = options.Last().Id))
.Setup(f => f.CreateLockScreen(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<IEnumerable<LockScreenOption>>(), It.IsAny<LockScreenSettings>()))
.Callback(new Action<string, string, IEnumerable<LockScreenOption>, LockScreenSettings>((message, title, options, settings) => result.OptionId = options.Last().Id))
.Returns(lockScreen.Object);
sut.TryStart();
@ -1268,7 +1273,9 @@ namespace SafeExamBrowser.Client.UnitTests
settings.Service.DisableUserLock = false;
settings.Service.DisableUserSwitch = false;
lockScreen.Setup(l => l.WaitForResult()).Returns(new LockScreenResult());
uiFactory.Setup(f => f.CreateLockScreen(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<IEnumerable<LockScreenOption>>())).Returns(lockScreen.Object);
uiFactory
.Setup(f => f.CreateLockScreen(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<IEnumerable<LockScreenOption>>(), It.IsAny<LockScreenSettings>()))
.Returns(lockScreen.Object);
sut.TryStart();
systemMonitor.Raise(m => m.SessionChanged += null);

View file

@ -1008,7 +1008,7 @@ namespace SafeExamBrowser.Client
logger.Info("Showing lock screen...");
PauseActivators();
lockScreen = uiFactory.CreateLockScreen(message, title, options);
lockScreen = uiFactory.CreateLockScreen(message, title, options, Settings.UserInterface.LockScreen);
lockScreen.Show();
if (Settings.SessionMode == SessionMode.Server)

View file

@ -20,6 +20,9 @@ namespace SafeExamBrowser.Configuration.ConfigurationData.DataMapping
case Keys.UserInterface.ActionCenter.EnableActionCenter:
MapEnableActionCenter(settings, value);
break;
case Keys.UserInterface.LockScreen.BackgroundColor:
MapLockScreenBackgroundColor(settings, value);
break;
case Keys.UserInterface.SystemControls.Audio.Show:
MapShowAudio(settings, value);
break;
@ -58,6 +61,14 @@ namespace SafeExamBrowser.Configuration.ConfigurationData.DataMapping
}
}
private void MapLockScreenBackgroundColor(AppSettings settings, object value)
{
if (value is string color)
{
settings.UserInterface.LockScreen.BackgroundColor = color;
}
}
private void MapShowAudio(AppSettings settings, object value)
{
if (value is bool show)

View file

@ -299,6 +299,7 @@ namespace SafeExamBrowser.Configuration.ConfigurationData
settings.Taskbar.ShowKeyboardLayout = true;
settings.Taskbar.ShowNetwork = false;
settings.UserInterface.LockScreen.BackgroundColor = "#ff0000";
settings.UserInterfaceMode = UserInterfaceMode.Desktop;
return settings;

View file

@ -326,6 +326,11 @@ namespace SafeExamBrowser.Configuration.ConfigurationData
internal const string EnableActionCenter = "showSideMenu";
}
internal static class LockScreen
{
internal const string BackgroundColor = "lockScreenBackgroundColor";
}
internal static class SystemControls
{
internal static class Audio

View file

@ -28,7 +28,7 @@ namespace SafeExamBrowser.Settings
public class AppSettings
{
/// <summary>
/// All action center-related settings.
/// All settings related to the action center.
/// </summary>
public ActionCenterSettings ActionCenter { get; set; }
@ -112,6 +112,11 @@ namespace SafeExamBrowser.Settings
/// </summary>
public TaskbarSettings Taskbar { get; set; }
/// <summary>
/// All settings related to the user interface.
/// </summary>
public UserInterfaceSettings UserInterface { get; set; }
/// <summary>
/// The mode which determines the look &amp; feel of the user interface.
/// </summary>
@ -133,6 +138,7 @@ namespace SafeExamBrowser.Settings
Service = new ServiceSettings();
System = new SystemSettings();
Taskbar = new TaskbarSettings();
UserInterface = new UserInterfaceSettings();
}
}
}

View file

@ -96,8 +96,10 @@
<Compile Include="SystemComponents\PowerSupplySettings.cs" />
<Compile Include="System\SystemSettings.cs" />
<Compile Include="UserInterface\ActionCenterSettings.cs" />
<Compile Include="UserInterface\LockScreenSettings.cs" />
<Compile Include="UserInterface\TaskbarSettings.cs" />
<Compile Include="UserInterface\UserInterfaceMode.cs" />
<Compile Include="UserInterface\UserInterfaceSettings.cs" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

View file

@ -0,0 +1,24 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
using System;
namespace SafeExamBrowser.Settings.UserInterface
{
/// <summary>
/// Defines all settings for the lock screen.
/// </summary>
[Serializable]
public class LockScreenSettings
{
/// <summary>
/// The background color as hexadecimal color code.
/// </summary>
public string BackgroundColor { get; set; }
}
}

View file

@ -0,0 +1,29 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
using System;
namespace SafeExamBrowser.Settings.UserInterface
{
/// <summary>
/// Defines all settings for the user interface.
/// </summary>
[Serializable]
public class UserInterfaceSettings
{
/// <summary>
/// All settings related to the lock screen.
/// </summary>
public LockScreenSettings LockScreen { get; set; }
public UserInterfaceSettings()
{
LockScreen = new LockScreenSettings();
}
}
}

View file

@ -16,6 +16,7 @@ using SafeExamBrowser.Proctoring.Contracts;
using SafeExamBrowser.Server.Contracts.Data;
using SafeExamBrowser.Settings.Browser;
using SafeExamBrowser.Settings.Proctoring;
using SafeExamBrowser.Settings.UserInterface;
using SafeExamBrowser.SystemComponents.Contracts.Audio;
using SafeExamBrowser.SystemComponents.Contracts.Keyboard;
using SafeExamBrowser.SystemComponents.Contracts.Network;
@ -76,7 +77,7 @@ namespace SafeExamBrowser.UserInterface.Contracts
/// <summary>
/// Creates a lock screen with the given message, title and options.
/// </summary>
ILockScreen CreateLockScreen(string message, string title, IEnumerable<LockScreenOption> options);
ILockScreen CreateLockScreen(string message, string title, IEnumerable<LockScreenOption> options, LockScreenSettings settings);
/// <summary>
/// Creates a new log window which runs on its own thread.

View file

@ -20,6 +20,7 @@ using SafeExamBrowser.Proctoring.Contracts;
using SafeExamBrowser.Server.Contracts.Data;
using SafeExamBrowser.Settings.Browser;
using SafeExamBrowser.Settings.Proctoring;
using SafeExamBrowser.Settings.UserInterface;
using SafeExamBrowser.SystemComponents.Contracts.Audio;
using SafeExamBrowser.SystemComponents.Contracts.Keyboard;
using SafeExamBrowser.SystemComponents.Contracts.Network;
@ -107,9 +108,9 @@ namespace SafeExamBrowser.UserInterface.Desktop
}
}
public ILockScreen CreateLockScreen(string message, string title, IEnumerable<LockScreenOption> options)
public ILockScreen CreateLockScreen(string message, string title, IEnumerable<LockScreenOption> options, LockScreenSettings settings)
{
return Application.Current.Dispatcher.Invoke(() => new LockScreen(message, title, text, options));
return Application.Current.Dispatcher.Invoke(() => new LockScreen(message, title, settings, text, options));
}
public IWindow CreateLogWindow(ILogger logger)

View file

@ -4,8 +4,8 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SafeExamBrowser.UserInterface.Desktop"
mc:Ignorable="d" d:DesignWidth="1500" ResizeMode="NoResize" Topmost="True" WindowState="Maximized" WindowStyle="None">
<Grid Background="Red" FocusManager.FocusedElement="{Binding ElementName=Password}">
mc:Ignorable="d" d:DesignWidth="1500" Background="Red" ResizeMode="NoResize" Topmost="True" WindowState="Maximized" WindowStyle="None">
<Grid FocusManager.FocusedElement="{Binding ElementName=Password}">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />

View file

@ -15,6 +15,7 @@ using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using SafeExamBrowser.I18n.Contracts;
using SafeExamBrowser.Settings.UserInterface;
using SafeExamBrowser.UserInterface.Contracts.Windows;
using SafeExamBrowser.UserInterface.Contracts.Windows.Data;
using SafeExamBrowser.UserInterface.Contracts.Windows.Events;
@ -26,6 +27,7 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows
internal partial class LockScreen : Window, ILockScreen
{
private readonly AutoResetEvent autoResetEvent;
private readonly LockScreenSettings settings;
private readonly IText text;
private bool canceled;
@ -43,9 +45,10 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows
remove { throw new NotImplementedException(); }
}
internal LockScreen(string message, string title, IText text, IEnumerable<LockScreenOption> options)
internal LockScreen(string message, string title, LockScreenSettings settings, IText text, IEnumerable<LockScreenOption> options)
{
this.autoResetEvent = new AutoResetEvent(false);
this.settings = settings;
this.text = text;
InitializeComponent();
@ -129,6 +132,11 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows
Message.Text = message;
Password.KeyDown += Password_KeyDown;
if (Parser.TryParseBrush(settings.BackgroundColor, out var brush))
{
Background = brush;
}
foreach (var option in options)
{
Options.Children.Add(new RadioButton

View file

@ -20,6 +20,7 @@ using SafeExamBrowser.Proctoring.Contracts;
using SafeExamBrowser.Server.Contracts.Data;
using SafeExamBrowser.Settings.Browser;
using SafeExamBrowser.Settings.Proctoring;
using SafeExamBrowser.Settings.UserInterface;
using SafeExamBrowser.SystemComponents.Contracts.Audio;
using SafeExamBrowser.SystemComponents.Contracts.Keyboard;
using SafeExamBrowser.SystemComponents.Contracts.Network;
@ -107,9 +108,9 @@ namespace SafeExamBrowser.UserInterface.Mobile
}
}
public ILockScreen CreateLockScreen(string message, string title, IEnumerable<LockScreenOption> options)
public ILockScreen CreateLockScreen(string message, string title, IEnumerable<LockScreenOption> options, LockScreenSettings settings)
{
return Application.Current.Dispatcher.Invoke(() => new LockScreen(message, title, text, options));
return Application.Current.Dispatcher.Invoke(() => new LockScreen(message, title, settings, text, options));
}
public IWindow CreateLogWindow(ILogger logger)

View file

@ -4,8 +4,8 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SafeExamBrowser.UserInterface.Mobile"
mc:Ignorable="d" d:DesignWidth="1500" FontSize="16" ResizeMode="NoResize" Topmost="True" WindowState="Maximized" WindowStyle="None">
<Grid Background="Red" FocusManager.FocusedElement="{Binding ElementName=Password}">
mc:Ignorable="d" d:DesignWidth="1500" Background="Red" FontSize="16" ResizeMode="NoResize" Topmost="True" WindowState="Maximized" WindowStyle="None">
<Grid FocusManager.FocusedElement="{Binding ElementName=Password}">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />

View file

@ -15,6 +15,7 @@ using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using SafeExamBrowser.I18n.Contracts;
using SafeExamBrowser.Settings.UserInterface;
using SafeExamBrowser.UserInterface.Contracts.Windows;
using SafeExamBrowser.UserInterface.Contracts.Windows.Data;
using SafeExamBrowser.UserInterface.Contracts.Windows.Events;
@ -26,6 +27,7 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows
internal partial class LockScreen : Window, ILockScreen
{
private readonly AutoResetEvent autoResetEvent;
private readonly LockScreenSettings settings;
private readonly IText text;
private bool canceled;
@ -43,9 +45,10 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows
remove { throw new NotImplementedException(); }
}
internal LockScreen(string message, string title, IText text, IEnumerable<LockScreenOption> options)
internal LockScreen(string message, string title, LockScreenSettings settings, IText text, IEnumerable<LockScreenOption> options)
{
this.autoResetEvent = new AutoResetEvent(false);
this.settings = settings;
this.text = text;
InitializeComponent();
@ -129,6 +132,11 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows
Message.Text = message;
Password.KeyDown += Password_KeyDown;
if (Parser.TryParseBrush(settings.BackgroundColor, out var brush))
{
Background = brush;
}
foreach (var option in options)
{
Options.Children.Add(new RadioButton

View file

@ -76,6 +76,7 @@
</Compile>
<Compile Include="Utilities\IconLoader.cs" />
<Compile Include="Utilities\IconResourceLoader.cs" />
<Compile Include="Utilities\Parser.cs" />
<Compile Include="Utilities\Thumbnail.cs" />
<Compile Include="Utilities\VisualExtensions.cs" />
<Compile Include="Utilities\WindowExtensions.cs" />

View file

@ -0,0 +1,30 @@
/*
* Copyright (c) 2024 ETH Zürich, IT Services
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
using System.Windows.Media;
namespace SafeExamBrowser.UserInterface.Shared.Utilities
{
public static class Parser
{
public static bool TryParseBrush(string hexColorCode, out Brush brush)
{
brush = default;
try
{
brush = new BrushConverter().ConvertFromString(hexColorCode) as Brush;
}
catch
{
}
return brush != default;
}
}
}

View file

@ -384,6 +384,7 @@ namespace SebWindowsConfig
public const String KeyDisableSessionChangeLockScreen = "disableSessionChangeLockScreen";
public const String KeyEnableCursorVerification = "enableCursorVerification";
public const String KeyEnableSessionVerification = "enableSessionVerification";
public const String KeyLockScreenBackgroundColor = "lockScreenBackgroundColor";
// Group "macOS specific settings"
public const String KeyMinMacOSVersion = "minMacOSVersion";
@ -1026,6 +1027,7 @@ namespace SebWindowsConfig
SEBSettings.settingsDefault.Add(SEBSettings.KeyDisableSessionChangeLockScreen, false);
SEBSettings.settingsDefault.Add(SEBSettings.KeyEnableCursorVerification, true);
SEBSettings.settingsDefault.Add(SEBSettings.KeyEnableSessionVerification, true);
SEBSettings.settingsDefault.Add(SEBSettings.KeyLockScreenBackgroundColor, "#ff0000");
// Default selected index and string in combo box for minMacOSVersion
SEBSettings.intArrayDefault[SEBSettings.ValMinMacOSVersion] = 4;

View file

@ -30,8 +30,8 @@ namespace SebWindowsConfig
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SebWindowsConfigForm));
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
this.openFileDialogSebConfigFile = new System.Windows.Forms.OpenFileDialog();
this.saveFileDialogSebConfigFile = new System.Windows.Forms.SaveFileDialog();
this.imageListTabIcons = new System.Windows.Forms.ImageList(this.components);
@ -481,6 +481,10 @@ namespace SebWindowsConfig
this.editDuplicateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.configureClientToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.applyAndStartSEBToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.groupBox22 = new System.Windows.Forms.GroupBox();
this.lockscreenColorButton = new System.Windows.Forms.Button();
this.lockscreenColorTextbox = new System.Windows.Forms.TextBox();
this.label34 = new System.Windows.Forms.Label();
this.tabPageHookedKeys.SuspendLayout();
this.groupBoxFunctionKeys.SuspendLayout();
this.groupBoxSpecialKeys.SuspendLayout();
@ -541,6 +545,7 @@ namespace SebWindowsConfig
this.groupBoxExitSequence.SuspendLayout();
this.tabControlSebWindowsConfig.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.groupBox22.SuspendLayout();
this.SuspendLayout();
//
// openFileDialogSebConfigFile
@ -1162,7 +1167,7 @@ namespace SebWindowsConfig
// checkBoxEnableSessionVerification
//
this.checkBoxEnableSessionVerification.AutoSize = true;
this.checkBoxEnableSessionVerification.Location = new System.Drawing.Point(328, 335);
this.checkBoxEnableSessionVerification.Location = new System.Drawing.Point(230, 336);
this.checkBoxEnableSessionVerification.Name = "checkBoxEnableSessionVerification";
this.checkBoxEnableSessionVerification.Size = new System.Drawing.Size(179, 17);
this.checkBoxEnableSessionVerification.TabIndex = 112;
@ -1173,7 +1178,7 @@ namespace SebWindowsConfig
// checkBoxEnableCursorVerification
//
this.checkBoxEnableCursorVerification.AutoSize = true;
this.checkBoxEnableCursorVerification.Location = new System.Drawing.Point(328, 316);
this.checkBoxEnableCursorVerification.Location = new System.Drawing.Point(230, 317);
this.checkBoxEnableCursorVerification.Name = "checkBoxEnableCursorVerification";
this.checkBoxEnableCursorVerification.Size = new System.Drawing.Size(173, 17);
this.checkBoxEnableCursorVerification.TabIndex = 111;
@ -1318,19 +1323,19 @@ namespace SebWindowsConfig
// checkBoxAllowedDisplayIgnoreError
//
this.checkBoxAllowedDisplayIgnoreError.AutoSize = true;
this.checkBoxAllowedDisplayIgnoreError.Location = new System.Drawing.Point(617, 296);
this.checkBoxAllowedDisplayIgnoreError.Location = new System.Drawing.Point(466, 297);
this.checkBoxAllowedDisplayIgnoreError.Name = "checkBoxAllowedDisplayIgnoreError";
this.checkBoxAllowedDisplayIgnoreError.Size = new System.Drawing.Size(554, 17);
this.checkBoxAllowedDisplayIgnoreError.Size = new System.Drawing.Size(431, 17);
this.checkBoxAllowedDisplayIgnoreError.TabIndex = 108;
this.checkBoxAllowedDisplayIgnoreError.Text = "Ignore errors when validating display configuration. Needs to be active when usin" +
"g SEB inside a virtual machine.";
this.checkBoxAllowedDisplayIgnoreError.Text = "Ignore errors when validating display configuration (required for use in virtual " +
"machine).";
this.checkBoxAllowedDisplayIgnoreError.UseVisualStyleBackColor = true;
this.checkBoxAllowedDisplayIgnoreError.CheckedChanged += new System.EventHandler(this.checkBoxAllowedDisplayIgnoreError_CheckedChanged);
//
// checkBoxEnforceBuiltinDisplay
//
this.checkBoxEnforceBuiltinDisplay.AutoSize = true;
this.checkBoxEnforceBuiltinDisplay.Location = new System.Drawing.Point(617, 278);
this.checkBoxEnforceBuiltinDisplay.Location = new System.Drawing.Point(466, 279);
this.checkBoxEnforceBuiltinDisplay.Name = "checkBoxEnforceBuiltinDisplay";
this.checkBoxEnforceBuiltinDisplay.Size = new System.Drawing.Size(193, 17);
this.checkBoxEnforceBuiltinDisplay.TabIndex = 107;
@ -1435,7 +1440,7 @@ namespace SebWindowsConfig
// checkBoxShowLogButton
//
this.checkBoxShowLogButton.AutoSize = true;
this.checkBoxShowLogButton.Location = new System.Drawing.Point(617, 335);
this.checkBoxShowLogButton.Location = new System.Drawing.Point(466, 336);
this.checkBoxShowLogButton.Margin = new System.Windows.Forms.Padding(2);
this.checkBoxShowLogButton.Name = "checkBoxShowLogButton";
this.checkBoxShowLogButton.Size = new System.Drawing.Size(180, 17);
@ -1448,7 +1453,7 @@ namespace SebWindowsConfig
//
this.comboBoxAllowedDisplaysMaxNumber.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.comboBoxAllowedDisplaysMaxNumber.FormattingEnabled = true;
this.comboBoxAllowedDisplaysMaxNumber.Location = new System.Drawing.Point(831, 258);
this.comboBoxAllowedDisplaysMaxNumber.Location = new System.Drawing.Point(679, 259);
this.comboBoxAllowedDisplaysMaxNumber.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
this.comboBoxAllowedDisplaysMaxNumber.Name = "comboBoxAllowedDisplaysMaxNumber";
this.comboBoxAllowedDisplaysMaxNumber.Size = new System.Drawing.Size(57, 21);
@ -1459,7 +1464,7 @@ namespace SebWindowsConfig
// checkBoxAllowLogAccess
//
this.checkBoxAllowLogAccess.AutoSize = true;
this.checkBoxAllowLogAccess.Location = new System.Drawing.Point(598, 316);
this.checkBoxAllowLogAccess.Location = new System.Drawing.Point(447, 317);
this.checkBoxAllowLogAccess.Margin = new System.Windows.Forms.Padding(2);
this.checkBoxAllowLogAccess.Name = "checkBoxAllowLogAccess";
this.checkBoxAllowLogAccess.Size = new System.Drawing.Size(199, 17);
@ -1473,7 +1478,7 @@ namespace SebWindowsConfig
this.label13.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label13.AutoSize = true;
this.label13.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label13.Location = new System.Drawing.Point(593, 262);
this.label13.Location = new System.Drawing.Point(441, 263);
this.label13.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(234, 13);
@ -1485,7 +1490,7 @@ namespace SebWindowsConfig
//
this.checkBoxEnablePrivateClipboard.AutoSize = true;
this.checkBoxEnablePrivateClipboard.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.checkBoxEnablePrivateClipboard.Location = new System.Drawing.Point(328, 280);
this.checkBoxEnablePrivateClipboard.Location = new System.Drawing.Point(230, 281);
this.checkBoxEnablePrivateClipboard.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
this.checkBoxEnablePrivateClipboard.Name = "checkBoxEnablePrivateClipboard";
this.checkBoxEnablePrivateClipboard.Size = new System.Drawing.Size(156, 17);
@ -1753,7 +1758,7 @@ namespace SebWindowsConfig
//
this.checkBoxEnableScreenCapture.AutoSize = true;
this.checkBoxEnableScreenCapture.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.checkBoxEnableScreenCapture.Location = new System.Drawing.Point(328, 261);
this.checkBoxEnableScreenCapture.Location = new System.Drawing.Point(230, 262);
this.checkBoxEnableScreenCapture.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
this.checkBoxEnableScreenCapture.Name = "checkBoxEnableScreenCapture";
this.checkBoxEnableScreenCapture.Size = new System.Drawing.Size(191, 17);
@ -1773,7 +1778,7 @@ namespace SebWindowsConfig
this.groupBox3.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Padding = new System.Windows.Forms.Padding(2, 1, 2, 1);
this.groupBox3.Size = new System.Drawing.Size(235, 92);
this.groupBox3.Size = new System.Drawing.Size(173, 92);
this.groupBox3.TabIndex = 81;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Kiosk Mode";
@ -1828,7 +1833,7 @@ namespace SebWindowsConfig
//
this.checkBoxAllowVirtualMachine.AutoSize = true;
this.checkBoxAllowVirtualMachine.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.checkBoxAllowVirtualMachine.Location = new System.Drawing.Point(328, 299);
this.checkBoxAllowVirtualMachine.Location = new System.Drawing.Point(230, 300);
this.checkBoxAllowVirtualMachine.Margin = new System.Windows.Forms.Padding(2, 1, 2, 1);
this.checkBoxAllowVirtualMachine.Name = "checkBoxAllowVirtualMachine";
this.checkBoxAllowVirtualMachine.Size = new System.Drawing.Size(185, 17);
@ -2064,8 +2069,8 @@ namespace SebWindowsConfig
//
// Type
//
dataGridViewCellStyle1.BackColor = System.Drawing.Color.Silver;
this.Type.DefaultCellStyle = dataGridViewCellStyle1;
dataGridViewCellStyle11.BackColor = System.Drawing.Color.Silver;
this.Type.DefaultCellStyle = dataGridViewCellStyle11;
this.Type.HeaderText = "Type";
this.Type.Name = "Type";
this.Type.ReadOnly = true;
@ -4711,6 +4716,7 @@ namespace SebWindowsConfig
//
// tabPageAppearance
//
this.tabPageAppearance.Controls.Add(this.groupBox22);
this.tabPageAppearance.Controls.Add(this.spellCheckerGroupBox);
this.tabPageAppearance.Controls.Add(this.groupBox16);
this.tabPageAppearance.Controls.Add(this.groupBox6);
@ -4848,8 +4854,8 @@ namespace SebWindowsConfig
// spellCheckerDictionaryFilesColumn
//
this.spellCheckerDictionaryFilesColumn.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.spellCheckerDictionaryFilesColumn.DefaultCellStyle = dataGridViewCellStyle2;
dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.spellCheckerDictionaryFilesColumn.DefaultCellStyle = dataGridViewCellStyle12;
this.spellCheckerDictionaryFilesColumn.HeaderText = "Files";
this.spellCheckerDictionaryFilesColumn.Name = "spellCheckerDictionaryFilesColumn";
this.spellCheckerDictionaryFilesColumn.ReadOnly = true;
@ -6247,6 +6253,49 @@ namespace SebWindowsConfig
this.applyAndStartSEBToolStripMenuItem.Visible = false;
this.applyAndStartSEBToolStripMenuItem.Click += new System.EventHandler(this.applyAndStartSEBToolStripMenuItem_Click);
//
// groupBox22
//
this.groupBox22.Controls.Add(this.lockscreenColorButton);
this.groupBox22.Controls.Add(this.lockscreenColorTextbox);
this.groupBox22.Controls.Add(this.label34);
this.groupBox22.Location = new System.Drawing.Point(529, 176);
this.groupBox22.Name = "groupBox22";
this.groupBox22.Size = new System.Drawing.Size(689, 59);
this.groupBox22.TabIndex = 88;
this.groupBox22.TabStop = false;
this.groupBox22.Text = "Lock Screen";
//
// lockscreenColorButton
//
this.lockscreenColorButton.Location = new System.Drawing.Point(226, 22);
this.lockscreenColorButton.Name = "lockscreenColorButton";
this.lockscreenColorButton.Size = new System.Drawing.Size(75, 23);
this.lockscreenColorButton.TabIndex = 118;
this.lockscreenColorButton.Text = "Choose";
this.lockscreenColorButton.UseVisualStyleBackColor = true;
this.lockscreenColorButton.Click += new System.EventHandler(this.lockscreenColorButton_Click);
//
// lockscreenColorTextbox
//
this.lockscreenColorTextbox.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lockscreenColorTextbox.ForeColor = System.Drawing.Color.White;
this.lockscreenColorTextbox.Location = new System.Drawing.Point(102, 23);
this.lockscreenColorTextbox.MaxLength = 7;
this.lockscreenColorTextbox.Name = "lockscreenColorTextbox";
this.lockscreenColorTextbox.Size = new System.Drawing.Size(111, 20);
this.lockscreenColorTextbox.TabIndex = 117;
this.lockscreenColorTextbox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
this.lockscreenColorTextbox.TextChanged += new System.EventHandler(this.lockscreenColorTextbox_TextChanged);
//
// label34
//
this.label34.AutoSize = true;
this.label34.Location = new System.Drawing.Point(6, 26);
this.label34.Name = "label34";
this.label34.Size = new System.Drawing.Size(92, 13);
this.label34.TabIndex = 116;
this.label34.Text = "Background Color";
//
// SebWindowsConfigForm
//
this.AllowDrop = true;
@ -6376,6 +6425,8 @@ namespace SebWindowsConfig
this.tabControlSebWindowsConfig.ResumeLayout(false);
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.groupBox22.ResumeLayout(false);
this.groupBox22.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
@ -6833,6 +6884,10 @@ namespace SebWindowsConfig
private System.Windows.Forms.CheckBox checkBoxAllowDownloads;
private System.Windows.Forms.CheckBox checkBoxEnableCursorVerification;
private System.Windows.Forms.CheckBox checkBoxEnableSessionVerification;
private System.Windows.Forms.GroupBox groupBox22;
private System.Windows.Forms.Button lockscreenColorButton;
private System.Windows.Forms.TextBox lockscreenColorTextbox;
private System.Windows.Forms.Label label34;
}
}

View file

@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
@ -816,6 +817,7 @@ namespace SebWindowsConfig
checkBoxAllowWindowsUpdate.Checked = (Boolean) SEBSettings.settingsCurrent[SEBSettings.KeyAllowWindowsUpdate];
checkBoxEnableCursorVerification.Checked = (Boolean) SEBSettings.settingsCurrent[SEBSettings.KeyEnableCursorVerification];
checkBoxEnableSessionVerification.Checked = (Boolean) SEBSettings.settingsCurrent[SEBSettings.KeyEnableSessionVerification];
lockscreenColorTextbox.Text = (String) SEBSettings.settingsCurrent[SEBSettings.KeyLockScreenBackgroundColor];
if (String.IsNullOrEmpty(textBoxLogDirectoryWin.Text))
{
@ -4803,5 +4805,35 @@ namespace SebWindowsConfig
{
SEBSettings.settingsCurrent[SEBSettings.KeyEnableSessionVerification] = checkBoxEnableSessionVerification.Checked;
}
private void lockscreenColorButton_Click(object sender, EventArgs e)
{
var dialog = new ColorDialog();
dialog.AllowFullOpen = true;
dialog.FullOpen = true;
dialog.Color = lockscreenColorTextbox.BackColor;
if (dialog.ShowDialog() == DialogResult.OK)
{
lockscreenColorTextbox.BackColor = dialog.Color;
lockscreenColorTextbox.Text = $"#{dialog.Color.R:x2}{dialog.Color.G:x2}{dialog.Color.B:x2}";
}
}
private void lockscreenColorTextbox_TextChanged(object sender, EventArgs e)
{
var raw = lockscreenColorTextbox.Text;
if (!string.IsNullOrWhiteSpace(raw) && Regex.IsMatch(raw, "^#[0-9a-f]{6}$", RegexOptions.IgnoreCase))
{
var r = byte.Parse(raw.Substring(1, 2), NumberStyles.HexNumber);
var g = byte.Parse(raw.Substring(3, 2), NumberStyles.HexNumber);
var b = byte.Parse(raw.Substring(5, 2), NumberStyles.HexNumber);
lockscreenColorTextbox.BackColor = Color.FromArgb(r, g, b);
SEBSettings.settingsCurrent[SEBSettings.KeyLockScreenBackgroundColor] = raw;
}
}
}
}

File diff suppressed because it is too large Load diff