mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1188413 - Introduce key shortcut to reload tools r=past
This commit is contained in:
parent
d49309d75c
commit
60a6a230de
@ -513,6 +513,11 @@ Toolbox.prototype = {
|
||||
let toggleKey = this.doc.getElementById("toolbox-toggle-host-key");
|
||||
toggleKey.addEventListener("command", this.switchToPreviousHost.bind(this), true);
|
||||
|
||||
if (Services.prefs.prefHasUserValue("devtools.loader.srcdir")) {
|
||||
let reloadKey = this.doc.getElementById("tools-reload-key");
|
||||
reloadKey.addEventListener("command", this.reload.bind(this), true);
|
||||
}
|
||||
|
||||
// Split console uses keypress instead of command so the event can be
|
||||
// cancelled with stopPropagation on the keypress, and not preventDefault.
|
||||
this.doc.addEventListener("keypress", this._splitConsoleOnKeypress, false);
|
||||
@ -1613,6 +1618,11 @@ Toolbox.prototype = {
|
||||
return newHost;
|
||||
},
|
||||
|
||||
reload: function () {
|
||||
const {devtools} = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
|
||||
devtools.reload(true);
|
||||
},
|
||||
|
||||
/**
|
||||
* Switch to the last used host for the toolbox UI.
|
||||
* This is determined by the devtools.toolbox.previousHost pref.
|
||||
|
@ -95,6 +95,10 @@
|
||||
key="&toolboxToggle.key;"
|
||||
oncommand="void(0);"
|
||||
modifiers="accel shift"/>
|
||||
<key id="tools-reload-key"
|
||||
key="&toolboxReload.key;"
|
||||
oncommand="void(0);"
|
||||
modifiers="accel alt"/>
|
||||
</keyset>
|
||||
|
||||
<popupset>
|
||||
|
@ -70,6 +70,9 @@ var CommandUtils = {
|
||||
* Utility to ensure that things are loaded in the correct order
|
||||
*/
|
||||
createRequisition: function(target, options) {
|
||||
if (!gcliInit) {
|
||||
return promise.reject("Unable to load gcli");
|
||||
}
|
||||
return gcliInit.getSystem(target).then(system => {
|
||||
var Requisition = require("gcli/cli").Requisition;
|
||||
return new Requisition(system, options);
|
||||
|
@ -423,7 +423,7 @@ DevToolsLoader.prototype = {
|
||||
/**
|
||||
* Reload the current provider.
|
||||
*/
|
||||
reload: function() {
|
||||
reload: function(showToolbox) {
|
||||
var events = this.require("sdk/system/events");
|
||||
events.emit("startupcache-invalidate", {});
|
||||
events.emit("devtools-unloaded", {});
|
||||
@ -433,6 +433,14 @@ DevToolsLoader.prototype = {
|
||||
delete this._mainid;
|
||||
this._chooseProvider();
|
||||
this.main("devtools/client/main");
|
||||
|
||||
// Reopen the toolbox automatically if requested
|
||||
if (showToolbox) {
|
||||
let { gBrowser } = Services.wm.getMostRecentWindow("navigator:browser");
|
||||
let target = this.TargetFactory.forTab(gBrowser.selectedTab);
|
||||
const { gDevTools } = this.require("resource:///modules/devtools/client/framework/gDevTools.jsm");
|
||||
gDevTools.showToolbox(target);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user