зеркало из https://github.com/mozilla/gecko-dev.git
Bug 728813 - Switch Help menu item to allow leaving Safe Mode when it's enabled. r=MattN
This commit is contained in:
Родитель
5bbc9a303f
Коммит
e4cfa4d611
|
@ -81,6 +81,8 @@
|
|||
<menuitem id="helpSafeMode"
|
||||
accesskey="&helpSafeMode.accesskey;"
|
||||
label="&helpSafeMode.label;"
|
||||
stopaccesskey="&helpSafeMode.stop.accesskey;"
|
||||
stoplabel="&helpSafeMode.stop.label;"
|
||||
oncommand="safeModeRestart();"/>
|
||||
<menuseparator id="aboutSeparator"/>
|
||||
<menuitem id="aboutName"
|
||||
|
|
|
@ -1280,6 +1280,12 @@ var gBrowserInit = {
|
|||
gHomeButton.updateTooltip(homeButton);
|
||||
gHomeButton.updatePersonalToolbarStyle(homeButton);
|
||||
|
||||
let safeMode = document.getElementById("helpSafeMode");
|
||||
if (Services.appinfo.inSafeMode) {
|
||||
safeMode.label = safeMode.getAttribute("stoplabel");
|
||||
safeMode.accesskey = safeMode.getAttribute("stopaccesskey");
|
||||
}
|
||||
|
||||
// BiDi UI
|
||||
gBidiUI = isBidiEnabled();
|
||||
if (gBidiUI) {
|
||||
|
@ -7531,6 +7537,18 @@ Object.defineProperty(this, "HUDService", {
|
|||
|
||||
// Prompt user to restart the browser in safe mode
|
||||
function safeModeRestart() {
|
||||
if (Services.appinfo.inSafeMode) {
|
||||
let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].
|
||||
createInstance(Ci.nsISupportsPRBool);
|
||||
Services.obs.notifyObservers(cancelQuit, "quit-application-requested", "restart");
|
||||
|
||||
if (cancelQuit.data)
|
||||
return;
|
||||
|
||||
Services.startup.quit(Ci.nsIAppStartup.eRestart | Ci.nsIAppStartup.eAttemptQuit);
|
||||
return;
|
||||
}
|
||||
|
||||
Services.obs.notifyObservers(null, "restart-in-safe-mode", "");
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
|
||||
<!ENTITY helpSafeMode.label "Restart with Add-ons Disabled…">
|
||||
<!ENTITY helpSafeMode.accesskey "R">
|
||||
<!ENTITY helpSafeMode.stop.label "Restart with Add-ons Enabled">
|
||||
<!ENTITY helpSafeMode.stop.accesskey "R">
|
||||
|
||||
<!ENTITY healthReport2.label "&brandShorterName; Health Report">
|
||||
<!ENTITY healthReport2.accesskey "e">
|
||||
|
|
Загрузка…
Ссылка в новой задаче