From 23f5906451cff01d2a6ff93978d04cd6a8cd728d Mon Sep 17 00:00:00 2001 From: Wes Johnston Date: Mon, 3 Oct 2011 15:13:23 -0700 Subject: [PATCH] Bug 688824 - Only show restart notification when locale changes. r=mfinkle --- mobile/chrome/content/preferences.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mobile/chrome/content/preferences.js b/mobile/chrome/content/preferences.js index f89b5b06284..e817b94c430 100644 --- a/mobile/chrome/content/preferences.js +++ b/mobile/chrome/content/preferences.js @@ -104,11 +104,17 @@ var PreferencesView = { WeaveGlue.init(); Services.prefs.addObserver("general.useragent.locale", this, false); + let chrome = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIXULChromeRegistry); + chrome.QueryInterface(Ci.nsIToolkitChromeRegistry); + this._currentLocale = chrome.getSelectedLocale("browser"); }, observe: function(aSubject, aTopic, aData) { if (aData == "general.useragent.locale") { - this.showRestart(); + if (Services.prefs.getCharPref("general.useragent.locale") != this._currentLocale) + this.showRestart(); + else + this.hideRestart(); this._loadLocales(); } }, @@ -140,7 +146,6 @@ var PreferencesView = { } if (locale == selectedLocale) { selectedLabel = label; - this._currentLocale = locale; break; } }