mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-20 22:27:31 +09:00
"about:support" - added support for "Restart normally"
https://github.com/MoonchildProductions/Pale-Moon/pull/1093 (partially)
This commit is contained in:
parent
1e44cdc9b6
commit
c2d6003d64
4 changed files with 30 additions and 5 deletions
|
|
@ -879,16 +879,25 @@ function populateActionBox() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prompt user to restart the browser in safe mode
|
// Prompt user to restart the browser
|
||||||
function safeModeRestart() {
|
function restart(safeMode) {
|
||||||
let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"]
|
let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"]
|
||||||
.createInstance(Ci.nsISupportsPRBool);
|
.createInstance(Ci.nsISupportsPRBool);
|
||||||
Services.obs.notifyObservers(cancelQuit, "quit-application-requested", "restart");
|
Services.obs.notifyObservers(cancelQuit, "quit-application-requested", "restart");
|
||||||
|
|
||||||
if (!cancelQuit.data) {
|
if (cancelQuit.data) {
|
||||||
Services.startup.restartInSafeMode(Ci.nsIAppStartup.eAttemptQuit);
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let flags = Ci.nsIAppStartup.eAttemptQuit;
|
||||||
|
|
||||||
|
if (safeMode) {
|
||||||
|
Services.startup.restartInSafeMode(flags);
|
||||||
|
} else {
|
||||||
|
Services.startup.quit(flags | Ci.nsIAppStartup.eRestart);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set up event listeners for buttons.
|
* Set up event listeners for buttons.
|
||||||
*/
|
*/
|
||||||
|
|
@ -915,9 +924,12 @@ function setupEventListeners() {
|
||||||
if (Services.obs.enumerateObservers("restart-in-safe-mode").hasMoreElements()) {
|
if (Services.obs.enumerateObservers("restart-in-safe-mode").hasMoreElements()) {
|
||||||
Services.obs.notifyObservers(null, "restart-in-safe-mode", "");
|
Services.obs.notifyObservers(null, "restart-in-safe-mode", "");
|
||||||
} else {
|
} else {
|
||||||
safeModeRestart();
|
restart(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
$("restart-button").addEventListener("click", function(event) {
|
||||||
|
restart(false);
|
||||||
|
});
|
||||||
$("verify-place-integrity-button").addEventListener("click", function(event) {
|
$("verify-place-integrity-button").addEventListener("click", function(event) {
|
||||||
PlacesDBUtils.checkAndFixDatabase(function(aLog) {
|
PlacesDBUtils.checkAndFixDatabase(function(aLog) {
|
||||||
let msg = aLog.join("\n");
|
let msg = aLog.join("\n");
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,12 @@
|
||||||
&aboutSupport.restartInSafeMode.label;
|
&aboutSupport.restartInSafeMode.label;
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="restart-box">
|
||||||
|
<h3>&aboutSupport.restartTitle;</h3>
|
||||||
|
<button id="restart-button">
|
||||||
|
&aboutSupport.restartNormal.label;
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<h1>
|
<h1>
|
||||||
|
|
|
||||||
|
|
@ -112,6 +112,9 @@ variant of aboutSupport.showDir.label. -->
|
||||||
<!ENTITY aboutSupport.safeModeTitle "Try Safe Mode">
|
<!ENTITY aboutSupport.safeModeTitle "Try Safe Mode">
|
||||||
<!ENTITY aboutSupport.restartInSafeMode.label "Restart in Safe Mode…">
|
<!ENTITY aboutSupport.restartInSafeMode.label "Restart in Safe Mode…">
|
||||||
|
|
||||||
|
<!ENTITY aboutSupport.restartTitle "Try Restart">
|
||||||
|
<!ENTITY aboutSupport.restartNormal.label "Restart normally…">
|
||||||
|
|
||||||
<!ENTITY aboutSupport.graphicsFeaturesTitle "Features">
|
<!ENTITY aboutSupport.graphicsFeaturesTitle "Features">
|
||||||
<!ENTITY aboutSupport.graphicsDiagnosticsTitle "Diagnostics">
|
<!ENTITY aboutSupport.graphicsDiagnosticsTitle "Diagnostics">
|
||||||
<!ENTITY aboutSupport.graphicsFailureLogTitle "Failure Log">
|
<!ENTITY aboutSupport.graphicsFailureLogTitle "Failure Log">
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,10 @@ td {
|
||||||
width: 30%;
|
width: 30%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#contents {
|
||||||
|
clear: right;
|
||||||
|
}
|
||||||
|
|
||||||
#action-box,
|
#action-box,
|
||||||
#reset-box,
|
#reset-box,
|
||||||
#safe-mode-box {
|
#safe-mode-box {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue