diff options
author | Moonchild <mcwerewolf@gmail.com> | 2018-06-27 10:25:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-27 10:25:15 +0200 |
commit | a3724697dc38820c4918b9e674ff56d2c15c5bba (patch) | |
tree | 920b62ff4f530363ce246069ad4f788928dc2d9c /toolkit/content | |
parent | 2d8e325fbdaeaa26b1f2a99ddbbb67804ef97864 (diff) | |
parent | a05046a4d26d9b743b7f2333e9584a147623ca2b (diff) | |
download | UXP-a3724697dc38820c4918b9e674ff56d2c15c5bba.tar UXP-a3724697dc38820c4918b9e674ff56d2c15c5bba.tar.gz UXP-a3724697dc38820c4918b9e674ff56d2c15c5bba.tar.lz UXP-a3724697dc38820c4918b9e674ff56d2c15c5bba.tar.xz UXP-a3724697dc38820c4918b9e674ff56d2c15c5bba.zip |
Merge pull request #551 from janekptacijarabaci/toolkit_restart_normally_2
"about:support" - added support for "Restart normally"
Diffstat (limited to 'toolkit/content')
-rw-r--r-- | toolkit/content/aboutSupport.js | 22 | ||||
-rw-r--r-- | toolkit/content/aboutSupport.xhtml | 6 |
2 files changed, 23 insertions, 5 deletions
diff --git a/toolkit/content/aboutSupport.js b/toolkit/content/aboutSupport.js index 016549f43..4e42a5687 100644 --- a/toolkit/content/aboutSupport.js +++ b/toolkit/content/aboutSupport.js @@ -879,16 +879,25 @@ function populateActionBox() { } } -// Prompt user to restart the browser in safe mode -function safeModeRestart() { +// Prompt user to restart the browser +function restart(safeMode) { let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"] .createInstance(Ci.nsISupportsPRBool); Services.obs.notifyObservers(cancelQuit, "quit-application-requested", "restart"); - if (!cancelQuit.data) { - Services.startup.restartInSafeMode(Ci.nsIAppStartup.eAttemptQuit); + if (cancelQuit.data) { + 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. */ @@ -915,9 +924,12 @@ function setupEventListeners() { if (Services.obs.enumerateObservers("restart-in-safe-mode").hasMoreElements()) { Services.obs.notifyObservers(null, "restart-in-safe-mode", ""); } else { - safeModeRestart(); + restart(true); } }); + $("restart-button").addEventListener("click", function(event) { + restart(false); + }); $("verify-place-integrity-button").addEventListener("click", function(event) { PlacesDBUtils.checkAndFixDatabase(function(aLog) { let msg = aLog.join("\n"); diff --git a/toolkit/content/aboutSupport.xhtml b/toolkit/content/aboutSupport.xhtml index a92dcfb4a..5eb64d437 100644 --- a/toolkit/content/aboutSupport.xhtml +++ b/toolkit/content/aboutSupport.xhtml @@ -44,6 +44,12 @@ &aboutSupport.restartInSafeMode.label; </button> </div> + <div id="restart-box"> + <h3>&aboutSupport.restartTitle;</h3> + <button id="restart-button"> + &aboutSupport.restartNormal.label; + </button> + </div> </div> <h1> |