SEBWIN-428: Fixed bug where visibility of reload button wasn't according to the active settings.
This commit is contained in:
parent
c6853f9239
commit
66e7c50a8e
5 changed files with 21 additions and 6 deletions
|
@ -147,6 +147,9 @@ namespace SafeExamBrowser.Configuration.ConfigurationData.DataMapping
|
||||||
case Keys.Browser.ResetOnQuitUrl:
|
case Keys.Browser.ResetOnQuitUrl:
|
||||||
MapResetOnQuitUrl(settings, value);
|
MapResetOnQuitUrl(settings, value);
|
||||||
break;
|
break;
|
||||||
|
case Keys.Browser.ShowReloadButton:
|
||||||
|
MapShowReloadButton(settings, value);
|
||||||
|
break;
|
||||||
case Keys.Browser.ShowToolbar:
|
case Keys.Browser.ShowToolbar:
|
||||||
MapShowToolbar(settings, value);
|
MapShowToolbar(settings, value);
|
||||||
break;
|
break;
|
||||||
|
@ -436,6 +439,15 @@ namespace SafeExamBrowser.Configuration.ConfigurationData.DataMapping
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void MapShowReloadButton(AppSettings settings, object value)
|
||||||
|
{
|
||||||
|
if (value is bool show)
|
||||||
|
{
|
||||||
|
settings.Browser.AdditionalWindow.ShowReloadButton = show;
|
||||||
|
settings.Browser.MainWindow.ShowReloadButton = show;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void MapRequestFilter(IDictionary<string, object> rawData, AppSettings settings)
|
private void MapRequestFilter(IDictionary<string, object> rawData, AppSettings settings)
|
||||||
{
|
{
|
||||||
var processMainRequests = rawData.TryGetValue(Keys.Browser.Filter.EnableMainRequestFilter, out var value) && value as bool? == true;
|
var processMainRequests = rawData.TryGetValue(Keys.Browser.Filter.EnableMainRequestFilter, out var value) && value as bool? == true;
|
||||||
|
|
|
@ -29,14 +29,12 @@ namespace SafeExamBrowser.Configuration.ConfigurationData
|
||||||
|
|
||||||
private void AllowBrowserToolbarForReloading(IDictionary<string, object> rawData, AppSettings settings)
|
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 && settings.Browser.AdditionalWindow.ShowReloadButton)
|
||||||
|
|
||||||
if (settings.Browser.AdditionalWindow.AllowReloading && showReloadButton)
|
|
||||||
{
|
{
|
||||||
settings.Browser.AdditionalWindow.ShowToolbar = true;
|
settings.Browser.AdditionalWindow.ShowToolbar = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (settings.Browser.MainWindow.AllowReloading && showReloadButton)
|
if (settings.Browser.MainWindow.AllowReloading && settings.Browser.MainWindow.ShowReloadButton)
|
||||||
{
|
{
|
||||||
settings.Browser.MainWindow.ShowToolbar = true;
|
settings.Browser.MainWindow.ShowToolbar = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,6 +76,11 @@ namespace SafeExamBrowser.Settings.Browser
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool ShowHomeButton { get; set; }
|
public bool ShowHomeButton { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Determines whether the reload button is visible.
|
||||||
|
/// </summary>
|
||||||
|
public bool ShowReloadButton { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines whether the user will need to confirm every reload attempt.
|
/// Determines whether the user will need to confirm every reload attempt.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -343,7 +343,7 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows
|
||||||
HomeButton.Visibility = WindowSettings.ShowHomeButton ? Visibility.Visible : Visibility.Collapsed;
|
HomeButton.Visibility = WindowSettings.ShowHomeButton ? Visibility.Visible : Visibility.Collapsed;
|
||||||
MenuButton.IsEnabled = settings.AllowPageZoom || WindowSettings.AllowDeveloperConsole;
|
MenuButton.IsEnabled = settings.AllowPageZoom || WindowSettings.AllowDeveloperConsole;
|
||||||
ReloadButton.IsEnabled = WindowSettings.AllowReloading;
|
ReloadButton.IsEnabled = WindowSettings.AllowReloading;
|
||||||
ReloadButton.Visibility = WindowSettings.AllowReloading ? Visibility.Visible : Visibility.Collapsed;
|
ReloadButton.Visibility = WindowSettings.ShowReloadButton ? Visibility.Visible : Visibility.Collapsed;
|
||||||
Toolbar.Visibility = WindowSettings.ShowToolbar ? Visibility.Visible : Visibility.Collapsed;
|
Toolbar.Visibility = WindowSettings.ShowToolbar ? Visibility.Visible : Visibility.Collapsed;
|
||||||
UrlTextBox.Visibility = WindowSettings.AllowAddressBar ? Visibility.Visible : Visibility.Hidden;
|
UrlTextBox.Visibility = WindowSettings.AllowAddressBar ? Visibility.Visible : Visibility.Hidden;
|
||||||
ZoomMenuItem.Visibility = settings.AllowPageZoom ? Visibility.Visible : Visibility.Collapsed;
|
ZoomMenuItem.Visibility = settings.AllowPageZoom ? Visibility.Visible : Visibility.Collapsed;
|
||||||
|
|
|
@ -343,7 +343,7 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows
|
||||||
HomeButton.Visibility = WindowSettings.ShowHomeButton ? Visibility.Visible : Visibility.Collapsed;
|
HomeButton.Visibility = WindowSettings.ShowHomeButton ? Visibility.Visible : Visibility.Collapsed;
|
||||||
MenuButton.IsEnabled = settings.AllowPageZoom || WindowSettings.AllowDeveloperConsole;
|
MenuButton.IsEnabled = settings.AllowPageZoom || WindowSettings.AllowDeveloperConsole;
|
||||||
ReloadButton.IsEnabled = WindowSettings.AllowReloading;
|
ReloadButton.IsEnabled = WindowSettings.AllowReloading;
|
||||||
ReloadButton.Visibility = WindowSettings.AllowReloading ? Visibility.Visible : Visibility.Collapsed;
|
ReloadButton.Visibility = WindowSettings.ShowReloadButton ? Visibility.Visible : Visibility.Collapsed;
|
||||||
Toolbar.Visibility = WindowSettings.ShowToolbar ? Visibility.Visible : Visibility.Collapsed;
|
Toolbar.Visibility = WindowSettings.ShowToolbar ? Visibility.Visible : Visibility.Collapsed;
|
||||||
UrlTextBox.Visibility = WindowSettings.AllowAddressBar ? Visibility.Visible : Visibility.Hidden;
|
UrlTextBox.Visibility = WindowSettings.AllowAddressBar ? Visibility.Visible : Visibility.Hidden;
|
||||||
ZoomMenuItem.Visibility = settings.AllowPageZoom ? Visibility.Visible : Visibility.Collapsed;
|
ZoomMenuItem.Visibility = settings.AllowPageZoom ? Visibility.Visible : Visibility.Collapsed;
|
||||||
|
|
Loading…
Reference in a new issue