Merge pull request #8954 from Atlante45/sandbox

Exit Sandbox instead of asking to quit
This commit is contained in:
Ryan Huffman 2016-10-28 16:09:03 -07:00 committed by GitHub
commit 214d8ebc33

View file

@ -163,17 +163,19 @@ function shutdownCallback(idx) {
if (homeServer.state == ProcessGroupStates.STOPPED) { if (homeServer.state == ProcessGroupStates.STOPPED) {
// if the home server is already down, take down the server console now // if the home server is already down, take down the server console now
log.debug("Quitting."); log.debug("Quitting.");
app.quit(); app.exit(0);
} else { } else {
// if the home server is still running, wait until we get a state change or timeout // if the home server is still running, wait until we get a state change or timeout
// before quitting the app // before quitting the app
log.debug("Server still shutting down. Waiting"); log.debug("Server still shutting down. Waiting");
var timeoutID = setTimeout(app.quit, 5000); var timeoutID = setTimeout(function() {
app.exit(0);
}, 5000);
homeServer.on('state-update', function(processGroup) { homeServer.on('state-update', function(processGroup) {
if (processGroup.state == ProcessGroupStates.STOPPED) { if (processGroup.state == ProcessGroupStates.STOPPED) {
clearTimeout(timeoutID); clearTimeout(timeoutID);
log.debug("Quitting."); log.debug("Quitting.");
app.quit(); app.exit(0);
} }
}); });
} }
@ -240,7 +242,7 @@ var shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory)
if (shouldQuit) { if (shouldQuit) {
log.warn("Another instance of the Sandbox is already running - this instance will quit."); log.warn("Another instance of the Sandbox is already running - this instance will quit.");
app.quit(); app.exit(0);
return; return;
} }
@ -288,12 +290,12 @@ function binaryMissingMessage(displayName, executableName, required) {
if (!dsPath) { if (!dsPath) {
dialog.showErrorBox("Domain Server Not Found", binaryMissingMessage("domain-server", "domain-server", true)); dialog.showErrorBox("Domain Server Not Found", binaryMissingMessage("domain-server", "domain-server", true));
app.quit(); app.exit(0);
} }
if (!acPath) { if (!acPath) {
dialog.showErrorBox("Assignment Client Not Found", binaryMissingMessage("assignment-client", "assignment-client", true)); dialog.showErrorBox("Assignment Client Not Found", binaryMissingMessage("assignment-client", "assignment-client", true));
app.quit(); app.exit(0);
} }
function openFileBrowser(path) { function openFileBrowser(path) {