Bug 1134166 - Restart toolbox if selected app re-opens. r=ochameau

This commit is contained in:
J. Ryan Stinnett 2015-04-08 04:09:42 -05:00
Родитель eff6c05870
Коммит bd15455765
1 изменённых файлов: 29 добавлений и 12 удалений

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

@ -179,13 +179,18 @@ let UI = {
UI.updateCommands();
UI.updateProjectButton();
UI.openProject();
UI.autoStartProject();
yield UI.autoStartProject();
UI.autoOpenToolbox();
UI.saveLastSelectedProject();
projectList.update();
});
return;
case "project-stopped":
case "project-started":
this.updateCommands();
projectList.update();
UI.autoOpenToolbox();
break;
case "project-stopped":
case "runtime-global-actors":
this.updateCommands();
projectList.update();
@ -657,7 +662,7 @@ let UI = {
}, console.error);
},
autoStartProject: function() {
autoStartProject: Task.async(function*() {
let project = AppManager.selectedProject;
if (!project) {
@ -669,15 +674,27 @@ let UI = {
return; // For something that is not an editable app, we're done.
}
Task.spawn(function() {
// Do not force opening apps that are already running, as they may have
// some activity being opened and don't want to dismiss them.
if (project.type == "runtimeApp" && !AppManager.isProjectRunning()) {
yield UI.busyUntil(AppManager.launchRuntimeApp(), "running app");
}
yield UI.createToolbox();
});
},
// Do not force opening apps that are already running, as they may have
// some activity being opened and don't want to dismiss them.
if (project.type == "runtimeApp" && !AppManager.isProjectRunning()) {
yield UI.busyUntil(AppManager.launchRuntimeApp(), "running app");
}
}),
autoOpenToolbox: Task.async(function*() {
let project = AppManager.selectedProject;
if (!project) {
return;
}
if (!(project.type == "runtimeApp" ||
project.type == "mainProcess" ||
project.type == "tab")) {
return; // For something that is not an editable app, we're done.
}
yield UI.createToolbox();
}),
importAndSelectApp: Task.async(function* (source) {
let isPackaged = !!source.path;