SEBWIN-397: Implemented mechanism to automatically show the browser window toolbar if reloading is enabled.
This commit is contained in:
parent
b5876eb61a
commit
63d34825f7
2 changed files with 17 additions and 0 deletions
|
@ -20,6 +20,7 @@ namespace SafeExamBrowser.Configuration.ConfigurationData
|
||||||
internal void Process(IDictionary<string, object> rawData, AppSettings settings)
|
internal void Process(IDictionary<string, object> rawData, AppSettings settings)
|
||||||
{
|
{
|
||||||
AllowReconfiguration(settings);
|
AllowReconfiguration(settings);
|
||||||
|
AllowBrowserToolbarForReloading(rawData, settings);
|
||||||
CalculateConfigurationKey(rawData, settings);
|
CalculateConfigurationKey(rawData, settings);
|
||||||
RemoveLegacyBrowsers(settings);
|
RemoveLegacyBrowsers(settings);
|
||||||
}
|
}
|
||||||
|
@ -29,6 +30,21 @@ namespace SafeExamBrowser.Configuration.ConfigurationData
|
||||||
settings.Security.AllowReconfiguration = settings.ConfigurationMode == ConfigurationMode.ConfigureClient;
|
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)
|
private void CalculateConfigurationKey(IDictionary<string, object> rawData, AppSettings settings)
|
||||||
{
|
{
|
||||||
using (var algorithm = new SHA256Managed())
|
using (var algorithm = new SHA256Managed())
|
||||||
|
|
|
@ -61,6 +61,7 @@ namespace SafeExamBrowser.Configuration.ConfigurationData
|
||||||
internal const string PopupBlockForeignHost = "newBrowserWindowByLinkBlockForeign";
|
internal const string PopupBlockForeignHost = "newBrowserWindowByLinkBlockForeign";
|
||||||
internal const string QuitUrl = "quitURL";
|
internal const string QuitUrl = "quitURL";
|
||||||
internal const string QuitUrlConfirmation = "quitURLConfirm";
|
internal const string QuitUrlConfirmation = "quitURLConfirm";
|
||||||
|
internal const string ShowReloadButton = "showReloadButton";
|
||||||
internal const string ShowToolbar = "enableBrowserWindowToolbar";
|
internal const string ShowToolbar = "enableBrowserWindowToolbar";
|
||||||
internal const string SendCustomHeaders = "sendBrowserExamKey";
|
internal const string SendCustomHeaders = "sendBrowserExamKey";
|
||||||
internal const string StartUrl = "startURL";
|
internal const string StartUrl = "startURL";
|
||||||
|
|
Loading…
Reference in a new issue