mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1062604 - Check for actors in WebIDE before use. r=paul
This commit is contained in:
parent
80a947ffdb
commit
716fccd801
@ -80,10 +80,13 @@ WebappsStore.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_feedStore: function() {
|
_feedStore: function() {
|
||||||
|
if (!this._webAppsActor) {
|
||||||
|
return promise.resolve();
|
||||||
|
}
|
||||||
this._listenToApps();
|
this._listenToApps();
|
||||||
return this._getAllApps()
|
return this._getAllApps()
|
||||||
.then(this._getRunningApps.bind(this))
|
.then(this._getRunningApps.bind(this))
|
||||||
.then(this._getAppsIcons.bind(this))
|
.then(this._getAppsIcons.bind(this));
|
||||||
},
|
},
|
||||||
|
|
||||||
_listenToApps: function() {
|
_listenToApps: function() {
|
||||||
|
@ -84,7 +84,7 @@ function CheckLockState() {
|
|||||||
|
|
||||||
if (AppManager.connection &&
|
if (AppManager.connection &&
|
||||||
AppManager.connection.status == Connection.Status.CONNECTED &&
|
AppManager.connection.status == Connection.Status.CONNECTED &&
|
||||||
AppManager.deviceFront) {
|
AppManager.preferenceFront) {
|
||||||
|
|
||||||
// ADB check
|
// ADB check
|
||||||
if (AppManager.selectedRuntime instanceof USBRuntime) {
|
if (AppManager.selectedRuntime instanceof USBRuntime) {
|
||||||
|
@ -139,6 +139,7 @@ let UI = {
|
|||||||
break;
|
break;
|
||||||
case "project-is-not-running":
|
case "project-is-not-running":
|
||||||
case "project-is-running":
|
case "project-is-running":
|
||||||
|
case "list-tabs-response":
|
||||||
this.updateCommands();
|
this.updateCommands();
|
||||||
break;
|
break;
|
||||||
case "runtime":
|
case "runtime":
|
||||||
@ -596,16 +597,18 @@ let UI = {
|
|||||||
|
|
||||||
let runtimePanelButton = document.querySelector("#runtime-panel-button");
|
let runtimePanelButton = document.querySelector("#runtime-panel-button");
|
||||||
if (AppManager.connection.status == Connection.Status.CONNECTED) {
|
if (AppManager.connection.status == Connection.Status.CONNECTED) {
|
||||||
screenshotCmd.removeAttribute("disabled");
|
if (AppManager.deviceFront) {
|
||||||
permissionsCmd.removeAttribute("disabled");
|
detailsCmd.removeAttribute("disabled");
|
||||||
|
permissionsCmd.removeAttribute("disabled");
|
||||||
|
screenshotCmd.removeAttribute("disabled");
|
||||||
|
}
|
||||||
disconnectCmd.removeAttribute("disabled");
|
disconnectCmd.removeAttribute("disabled");
|
||||||
detailsCmd.removeAttribute("disabled");
|
|
||||||
runtimePanelButton.setAttribute("active", "true");
|
runtimePanelButton.setAttribute("active", "true");
|
||||||
} else {
|
} else {
|
||||||
screenshotCmd.setAttribute("disabled", "true");
|
|
||||||
permissionsCmd.setAttribute("disabled", "true");
|
|
||||||
disconnectCmd.setAttribute("disabled", "true");
|
|
||||||
detailsCmd.setAttribute("disabled", "true");
|
detailsCmd.setAttribute("disabled", "true");
|
||||||
|
permissionsCmd.setAttribute("disabled", "true");
|
||||||
|
screenshotCmd.setAttribute("disabled", "true");
|
||||||
|
disconnectCmd.setAttribute("disabled", "true");
|
||||||
runtimePanelButton.removeAttribute("active");
|
runtimePanelButton.removeAttribute("active");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -826,7 +829,13 @@ let Cmds = {
|
|||||||
|
|
||||||
|
|
||||||
let runtimeappsHeaderNode = document.querySelector("#panel-header-runtimeapps");
|
let runtimeappsHeaderNode = document.querySelector("#panel-header-runtimeapps");
|
||||||
if (AppManager.connection.status == Connection.Status.CONNECTED) {
|
let sortedApps = AppManager.webAppsStore.object.all;
|
||||||
|
sortedApps = sortedApps.sort((a, b) => {
|
||||||
|
return a.name > b.name;
|
||||||
|
});
|
||||||
|
let mainProcess = AppManager.isMainProcessDebuggable();
|
||||||
|
if (AppManager.connection.status == Connection.Status.CONNECTED &&
|
||||||
|
(sortedApps.length > 0 || mainProcess)) {
|
||||||
runtimeappsHeaderNode.removeAttribute("hidden");
|
runtimeappsHeaderNode.removeAttribute("hidden");
|
||||||
} else {
|
} else {
|
||||||
runtimeappsHeaderNode.setAttribute("hidden", "true");
|
runtimeappsHeaderNode.setAttribute("hidden", "true");
|
||||||
@ -837,7 +846,7 @@ let Cmds = {
|
|||||||
runtimeAppsNode.firstChild.remove();
|
runtimeAppsNode.firstChild.remove();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AppManager.isMainProcessDebuggable()) {
|
if (mainProcess) {
|
||||||
let panelItemNode = document.createElement("toolbarbutton");
|
let panelItemNode = document.createElement("toolbarbutton");
|
||||||
panelItemNode.className = "panel-item";
|
panelItemNode.className = "panel-item";
|
||||||
panelItemNode.setAttribute("label", Strings.GetStringFromName("mainProcess_label"));
|
panelItemNode.setAttribute("label", Strings.GetStringFromName("mainProcess_label"));
|
||||||
@ -853,10 +862,6 @@ let Cmds = {
|
|||||||
}, true);
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
let sortedApps = AppManager.webAppsStore.object.all;
|
|
||||||
sortedApps = sortedApps.sort((a, b) => {
|
|
||||||
return a.name > b.name;
|
|
||||||
});
|
|
||||||
for (let i = 0; i < sortedApps.length; i++) {
|
for (let i = 0; i < sortedApps.length; i++) {
|
||||||
let app = sortedApps[i];
|
let app = sortedApps[i];
|
||||||
let panelItemNode = document.createElement("toolbarbutton");
|
let panelItemNode = document.createElement("toolbarbutton");
|
||||||
|
@ -224,10 +224,15 @@ let DeviceFront = protocol.FrontClass(DeviceActor, {
|
|||||||
const _knownDeviceFronts = new WeakMap();
|
const _knownDeviceFronts = new WeakMap();
|
||||||
|
|
||||||
exports.getDeviceFront = function(client, form) {
|
exports.getDeviceFront = function(client, form) {
|
||||||
if (_knownDeviceFronts.has(client))
|
if (!form.deviceActor) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_knownDeviceFronts.has(client)) {
|
||||||
return _knownDeviceFronts.get(client);
|
return _knownDeviceFronts.get(client);
|
||||||
|
}
|
||||||
|
|
||||||
let front = new DeviceFront(client, form);
|
let front = new DeviceFront(client, form);
|
||||||
_knownDeviceFronts.set(client, front);
|
_knownDeviceFronts.set(client, front);
|
||||||
return front;
|
return front;
|
||||||
}
|
};
|
||||||
|
@ -116,8 +116,13 @@ let PreferenceFront = protocol.FrontClass(PreferenceActor, {
|
|||||||
const _knownPreferenceFronts = new WeakMap();
|
const _knownPreferenceFronts = new WeakMap();
|
||||||
|
|
||||||
exports.getPreferenceFront = function(client, form) {
|
exports.getPreferenceFront = function(client, form) {
|
||||||
if (_knownPreferenceFronts.has(client))
|
if (!form.preferenceActor) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_knownPreferenceFronts.has(client)) {
|
||||||
return _knownPreferenceFronts.get(client);
|
return _knownPreferenceFronts.get(client);
|
||||||
|
}
|
||||||
|
|
||||||
let front = new PreferenceFront(client, form);
|
let front = new PreferenceFront(client, form);
|
||||||
_knownPreferenceFronts.set(client, front);
|
_knownPreferenceFronts.set(client, front);
|
||||||
|
Loading…
Reference in New Issue
Block a user