Bug 620523 - Use Firefox error console pref and dont require restart [r=mfinkle]

This commit is contained in:
Wes Johnston 2011-01-03 17:06:27 -08:00
Родитель 326ea88da6
Коммит 9bea18fbc0
4 изменённых файлов: 32 добавлений и 10 удалений

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

@ -365,7 +365,7 @@ pref("dom.max_chrome_script_run_time", 0); // disable slow script dialog for chr
pref("dom.max_script_run_time", 20);
// JS error console
pref("browser.console.showInPanel", false);
pref("devtools.errorconsole.enabled", false);
// kinetic tweakables
pref("browser.ui.kinetic.updateInterval", 30);
@ -511,3 +511,4 @@ pref("ui.dragThreshold", 24);
pref("layers.accelerate-all", false);
pref("notification.feature.enabled", true);

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

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

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

@ -385,12 +385,6 @@ var Browser = {
this.addTab(commandURL || this.getHomePage(), true);
}
// JavaScript Error Console
if (Services.prefs.getBoolPref("browser.console.showInPanel")){
let button = document.getElementById("tool-console");
button.hidden = false;
}
// If some add-ons were disabled during during an application update, alert user
if (Services.prefs.prefHasUserValue("extensions.disabledAddons")) {
let addons = Services.prefs.getCharPref("extensions.disabledAddons").split(",");

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

@ -43,6 +43,7 @@ let ConsoleView = {
_evalCode: "",
_bundle: null,
_showChromeErrors: -1,
_enabledPref: "devtools.errorconsole.enabled",
init: function cv_init() {
if (this._list)
@ -64,6 +65,18 @@ let ConsoleView = {
self._delayedInit();
},
false);
try {
// update users using the legacy pref
if (Services.prefs.getBoolPref("browser.console.showInPanel")) {
Services.prefs.setBoolPref(this._enabledPref, true);
Services.prefs.clearUserPref("browser.console.showInPanel");
}
} catch(ex) {
// likely don't have an old pref
}
this.updateVisibility();
Services.prefs.addObserver(this._enabledPref, this, false);
},
_delayedInit: function cv__delayedInit() {
@ -88,10 +101,24 @@ let ConsoleView = {
uninit: function cv_uninit() {
if (this._inited)
Services.console.unregisterListener(this);
Services.prefs.removeObserver(this._enabledPref, this, false);
},
observe: function(aObject) {
this.appendItem(aObject);
get enabled() {
return Services.prefs.getBoolPref(this._enabledPref);
},
updateVisibility: function ec_updateVisibility(aVal, aPref) {
let button = document.getElementById("tool-console");
button.hidden = !this.enabled;
},
observe: function(aSubject, aTopic, aData) {
if (aTopic == "nsPref:changed")
this.updateVisibility();
else
this.appendItem(aSubject);
},
showChromeErrors: function() {