Bug 1143028 - Make AppMan reinitable; update tab list when sidebars disabled. r=past

This commit is contained in:
J. Ryan Stinnett 2015-03-16 13:32:00 -04:00
Родитель 9a5557faa4
Коммит 7da7b1c11b
3 изменённых файлов: 19 добавлений и 4 удалений

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

@ -49,7 +49,7 @@ window.addEventListener("load", function onLoad() {
window.addEventListener("unload", function onUnload() {
window.removeEventListener("unload", onUnload);
UI.uninit();
UI.destroy();
});
let projectList;
@ -118,10 +118,10 @@ let UI = {
gDevToolsBrowser.isWebIDEInitialized.resolve();
},
uninit: function() {
destroy: function() {
window.removeEventListener("focus", this.onfocus, true);
AppManager.off("app-manager-update", this.appManagerUpdate);
AppManager.uninit();
AppManager.destroy();
projectList = null;
window.removeEventListener("message", this.onMessage);
this.updateConnectionTelemetry();
@ -186,6 +186,7 @@ let UI = {
case "project-is-running":
case "list-tabs-response":
this.updateCommands();
projectList.update();
break;
case "runtime-details":
this.updateRuntimeButton();

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

@ -34,7 +34,14 @@ let AppManager = exports.AppManager = {
DEFAULT_PROJECT_ICON: "chrome://browser/skin/devtools/app-manager/default-app-icon.png",
DEFAULT_PROJECT_NAME: "--",
_initialized: false,
init: function() {
if (this._initialized) {
return;
}
this._initialized = true;
let port = Services.prefs.getIntPref("devtools.debugger.remote-port");
this.connection = ConnectionManager.createConnection("localhost", port);
this.onConnectionChanged = this.onConnectionChanged.bind(this);
@ -57,7 +64,12 @@ let AppManager = exports.AppManager = {
this._telemetry = new Telemetry();
},
uninit: function() {
destroy: function() {
if (!this._initialized) {
return;
}
this._initialized = false;
this.selectedProject = null;
this.selectedRuntime = null;
RuntimeScanners.off("runtime-list-updated", this._rebuildRuntimeList);

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

@ -28,6 +28,8 @@ module.exports = ProjectList = function(window, parentWindow) {
this._panelNodeEl = "div";
}
AppManager.init();
return this;
};