SEBWIN-397: Implemented mechanism to automatically show the browser window toolbar if reloading is enabled.

This commit is contained in:
Damian Büchel 2020-05-04 12:56:08 +02:00
parent b5876eb61a
commit 63d34825f7
2 changed files with 17 additions and 0 deletions

View file

@ -20,6 +20,7 @@ namespace SafeExamBrowser.Configuration.ConfigurationData
internal void Process(IDictionary<string, object> rawData, AppSettings settings)
{
AllowReconfiguration(settings);
AllowBrowserToolbarForReloading(rawData, settings);
CalculateConfigurationKey(rawData, settings);
RemoveLegacyBrowsers(settings);
}
@ -29,6 +30,21 @@ namespace SafeExamBrowser.Configuration.ConfigurationData
settings.Security.AllowReconfiguration = settings.ConfigurationMode == ConfigurationMode.ConfigureClient;
}
private void AllowBrowserToolbarForReloading(IDictionary<string, object> rawData, AppSettings settings)
{
var showReloadButton = rawData.TryGetValue(Keys.Browser.ShowReloadButton, out var v) && v is bool show && show;
if (settings.Browser.AdditionalWindow.AllowReloading && showReloadButton)
{
settings.Browser.AdditionalWindow.ShowToolbar = true;
}
if (settings.Browser.MainWindow.AllowReloading && showReloadButton)
{
settings.Browser.MainWindow.ShowToolbar = true;
}
}
private void CalculateConfigurationKey(IDictionary<string, object> rawData, AppSettings settings)
{
using (var algorithm = new SHA256Managed())

View file

@ -61,6 +61,7 @@ namespace SafeExamBrowser.Configuration.ConfigurationData
internal const string PopupBlockForeignHost = "newBrowserWindowByLinkBlockForeign";
internal const string QuitUrl = "quitURL";
internal const string QuitUrlConfirmation = "quitURLConfirm";
internal const string ShowReloadButton = "showReloadButton";
internal const string ShowToolbar = "enableBrowserWindowToolbar";
internal const string SendCustomHeaders = "sendBrowserExamKey";
internal const string StartUrl = "startURL";