mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 12:07:57 +01:00
Fix stupid :restart confirmation.
This commit is contained in:
@@ -1089,6 +1089,12 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
node.collapsed = !visible;
|
||||
},
|
||||
|
||||
confirmQuit: function confirmQuit()
|
||||
prefs.withContext(function () {
|
||||
prefs.set("browser.warnOnQuit", false);
|
||||
return !window.canQuitApplication();
|
||||
}),
|
||||
|
||||
/**
|
||||
* Quit the host application, no matter how many tabs/windows are open.
|
||||
*
|
||||
@@ -1098,11 +1104,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
* windows could be closed individually.
|
||||
*/
|
||||
quit: function (saveSession, force) {
|
||||
if (!force &&
|
||||
prefs.withContext(function () {
|
||||
prefs.set("browser.warnOnQuit", false);
|
||||
return !canQuitApplication();
|
||||
}))
|
||||
if (!force && !this.confirmQuit())
|
||||
return;
|
||||
|
||||
let pref = "browser.startup.page";
|
||||
@@ -1115,6 +1117,16 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
services.appStartup.quit(Ci.nsIAppStartup[force ? "eForceQuit" : "eAttemptQuit"]);
|
||||
},
|
||||
|
||||
/**
|
||||
* Restart the host application.
|
||||
*/
|
||||
restart: function () {
|
||||
if (!this.confirmQuit())
|
||||
return;
|
||||
|
||||
services.appStartup.quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart);
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns an array of URLs parsed from *str*.
|
||||
*
|
||||
@@ -1214,16 +1226,6 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
util.reportError(error);
|
||||
},
|
||||
|
||||
/**
|
||||
* Restart the host application.
|
||||
*/
|
||||
restart: function () {
|
||||
if (!canQuitApplication())
|
||||
return;
|
||||
|
||||
services.appStartup.quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart);
|
||||
},
|
||||
|
||||
/**
|
||||
* Parses a Dactyl command-line string i.e. the value of the
|
||||
* -dactyl command-line option.
|
||||
|
||||
Reference in New Issue
Block a user