Bug 671555 - Set the correct extensions.checkCompatibility pref in mobile tester tools [r=mfinkle]

This commit is contained in:
Matt Brubeck 2011-08-09 13:03:27 -07:00
Родитель 030553401a
Коммит 050abfbfc4
2 изменённых файлов: 23 добавлений и 3 удалений

Просмотреть файл

@ -42,11 +42,17 @@ var Feedback = {
init: function(aEvent) {
// Delay the widget initialization during startup.
window.addEventListener("UIReadyDelayed", function(aEvent) {
let panel = document.getElementById("feedback-container");
panel.addEventListener("ToolPanelShown", function delayedInit(aEvent) {
panel.removeEventListener("ToolPanelShown", delayedInit, false);
// A simple frame script to fill in the referrer page and device info
messageManager.loadFrameScript("chrome://feedback/content/content.js", true);
window.removeEventListener(aEvent.type, arguments.callee, false);
let setting = document.getElementById("feedback-checkCompatibility");
setting.setAttribute("pref", Feedback.compatibilityPref);
setting.preferenceChanged();
document.getElementById("feedback-container").hidden = false;
let feedbackPrefs = document.getElementById("feedback-tools").childNodes;
@ -65,6 +71,20 @@ var Feedback = {
}, false);
},
get compatibilityPref() {
let result = "extensions.checkCompatibility.";
let channel = Services.prefs.getCharPref("app.update.channel");
if (channel == "nightly") {
result += "nightly";
} else {
// Copied from toolkit/mozapps/extensions/XPIProvider.jsm
const BRANCH_REGEXP = /^([^\.]+\.[0-9]+[a-z]*).*/gi;
result += Services.appinfo.version.replace(BRANCH_REGEXP, "$1");
}
delete this.compatibilityPref;
return this.compatibilityPref = result;
},
openFeedback: function(aName) {
let pref = "extensions.feedback.url." + aName;
let url = Services.prefs.getPrefType(pref) == Ci.nsIPrefBranch.PREF_INVALID ? "" : Services.prefs.getCharPref(pref);

Просмотреть файл

@ -64,7 +64,7 @@
</settings>
<settings id="feedback-tools" label="&feedback.tools.title;">
<setting pref="toolkit.telemetry.enabled" title="&feedback.allowTelemetry.title;" type="bool"/>
<setting pref="extensions.checkCompatibility.4.0b" title="&feedback.forceCompat.title;" type="bool" inverted="true" oninputchanged="Feedback.updateRestart();"/>
<setting title="&feedback.forceCompat.title;" type="bool" inverted="true" oninputchanged="Feedback.updateRestart();"/>
<setting pref="devtools.errorconsole.enabled" title="&feedback.errorConsole.title;" type="bool"/>
</settings>
</richlistbox>