Skip to content

Commit

Permalink
Added default registry values for language of german Firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
Gh0stWalk3r committed May 20, 2016
1 parent 48ce64d commit d3fb045
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 6 deletions.
21 changes: 18 additions & 3 deletions Product/Gui/FullscreenBrowser/GeckoBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ public void Setup(Window setting)
Logger.Warn(exception);
}
}

/// <summary>Starts or resets the browser.</summary>
/// <param name="ignoreAutoStart">if set to <c>true</c> ignores flag of automatic start.</param>
/// <param name="disableReload">if set to <c>true</c> disable reload.</param>
Expand Down Expand Up @@ -362,7 +362,7 @@ private void Initialize(bool force = false)
PromptFactory.PromptServiceCreator = () => new FilteredPromptService();
Xpcom.Initialize(Path.GetFullPath(browserConfig.Runtime));
}

if (browserConfig.ClearCookiesAtStartup)
{
// https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface
Expand Down Expand Up @@ -412,6 +412,21 @@ private void Initialize(bool force = false)
break;
}
}

if (browserConfig.BrowserRegistry != null)
{
foreach (var item in browserConfig.BrowserRegistry)
{
try
{
GeckoPreferences.User[item.Name] = item.Value;
}
catch (Exception exception)
{
Logger.Error("Could not set user preference", exception);
}
}
}
}

/// <summary>Zoom to level.</summary>
Expand Down Expand Up @@ -489,7 +504,7 @@ private void BrowserOnDomContentLoaded(object sender, DomEventArgs domEventArgs)
// }
this.DomContentLoaded = true;
}

/// <summary>The async navigate thread.</summary>
/// <param name="url">The url.</param>
private void NavigateToUrl(string url)
Expand Down
1 change: 1 addition & 0 deletions Product/Shared/Configuration/Configuration.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
<Compile Include="Google\StaticMaps\StaticMapsEngine.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="XML\BrowserConfig.cs" />
<Compile Include="XML\BrowserRegistry.cs" />
<Compile Include="XML\Cookie.cs" />
<Compile Include="XML\PrintSettings.cs" />
<Compile Include="XML\ScreenRefresher.cs" />
Expand Down
11 changes: 8 additions & 3 deletions Product/Shared/Configuration/XML/BrowserConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ namespace At.FF.Krems.Configuration.XML
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
Expand All @@ -42,10 +43,10 @@ public class BrowserConfig

/// <summary>The show closed windows in minutes lock object</summary>
private readonly object showClosedWindowsInMinutesLockObject = new object();

/// <summary>Gets or sets the cookie field.</summary>
private Cookie[] cookieField;

/// <summary>The show closed windows in minutes</summary>
private int showClosedWindowsInMinutes;

Expand All @@ -58,7 +59,7 @@ public class BrowserConfig
public Window[] Window { get; set; }

/// <summary>Gets or sets the runtime.</summary>
public string Runtime { get; set; } = "xulrunner_33.0.3";
public string Runtime { get; set; } = "Firefox";

/// <summary>Gets or sets a value indicating whether disable screensaver permanently.</summary>
public bool DisableScreensaverPermanently { get; set; }
Expand Down Expand Up @@ -135,6 +136,10 @@ public int ShowClosedWindowsInMinutes
}
}

/// <summary>Gets or sets the configuration dictionary.</summary>
/// <value>The configuration dictionary.</value>
public ObservableCollection<BrowserRegistry> BrowserRegistry { get; private set; } = new ObservableCollection<BrowserRegistry> { new BrowserRegistry { Name = "intl.accept_languages", Value = "de, en-US, en" }, new BrowserRegistry { Name = "intl.locale.matchOS", Value = false } };

#endregion
}
}
46 changes: 46 additions & 0 deletions Product/Shared/Configuration/XML/BrowserRegistry.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// --------------------------------------------------------------------------------------------------------------------
// <copyright file="BrowserRegistry.cs" company="Freiwillige Feuerwehr Krems/Donau">
// Freiwillige Feuerwehr Krems/Donau
// Austraße 33
// A-3500 Krems/Donau
// Austria
// Tel.: +43 (0)2732 85522
// Fax.: +43 (0)2732 85522 40
// E-mail: [email protected]
//
// This software is furnished under a license and may be
// used and copied only in accordance with the terms of
// such license and with the inclusion of the above
// copyright notice. This software or any other copies
// thereof may not be provided or otherwise made
// available to any other person. No title to and
// ownership of the software is hereby transferred.
//
// The information in this software is subject to change
// without notice and should not be construed as a
// commitment by Freiwillige Feuerwehr Krems/Donau.
//
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
namespace At.FF.Krems.Configuration.XML
{
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.Diagnostics;
using System.Xml.Serialization;

/// <summary>The browser registry, see about:config</summary>
[GeneratedCode("xsd", "2.0.50727.3038"), DesignerCategory("code"), DebuggerStepThrough, XmlRoot(Namespace = "", IsNullable = false), XmlType(AnonymousType = true)]
[Serializable]
public class BrowserRegistry
{
/// <summary>Gets or sets the name.</summary>
/// <value>The name.</value>
public string Name { get; set; }

/// <summary>Gets or sets the value.</summary>
/// <value>The value.</value>
public object Value { get; set; }
}
}

0 comments on commit d3fb045

Please sign in to comment.