From 1b800ff6fa15dc462f31bf9177a90f565804d5e5 Mon Sep 17 00:00:00 2001 From: ca333 Date: Tue, 14 Feb 2017 22:32:32 +0100 Subject: [PATCH] revert prevent bad exit --- gui/loading.js | 6 +++--- main.js | 39 ++++----------------------------------- 2 files changed, 7 insertions(+), 38 deletions(-) diff --git a/gui/loading.js b/gui/loading.js index b38a3af..ab5fefc 100644 --- a/gui/loading.js +++ b/gui/loading.js @@ -36,7 +36,7 @@ function Iguana_activehandle(callback) { function StartIguana() { var ajax_data = { 'herd': 'iguana'}; - + console.log(ajax_data); $.ajax({ type: 'POST', @@ -62,7 +62,7 @@ function StartIguana() { function GetAppConf() { // get iguana app conf var ajax_data = { 'herd': 'iguana' }; data = false; - + console.log(ajax_data); $.ajax({ async: false, @@ -130,7 +130,7 @@ function EDEX_DEXgetinfoAll() { $('#loading_sub_status_output_text').text('Output: Connected') } if ( tmp_index == 10 ) { - window.hide(); + window.close(); } }).fail(function(xhr, textStatus, error) { // handle request failures diff --git a/main.js b/main.js index f912a1e..e46f844 100644 --- a/main.js +++ b/main.js @@ -16,7 +16,7 @@ var fs = require('fs'), mkdirp = require('mkdirp') pm2 = require('pm2'); -var iguanaAppPort = 17777; +var iguanaAppPort = 17777; Promise = require('bluebird'); @@ -35,7 +35,7 @@ const _setImmediate = setImmediate, process.once('loaded', () => { global.setImmediate = _setImmediate global.clearImmediate = _clearImmediate - + if (os.platform() === 'darwin') { process.setFdLimit(90000); } @@ -144,7 +144,7 @@ function createLoadingWindow() { //loadingWindow.webContents.openDevTools() // if window closed we kill iguana proc - loadingWindow.on('hide', function () { + loadingWindow.on('closed', function () { // our app does not have multiwindow - so we dereference the window object instead of // putting them into an window_arr loadingWindow = null; @@ -203,7 +203,7 @@ function createWindow (status) { pm2.connect(true,function(err) { console.log('connecting to pm2...'); - + if (err) { console.log(err); } @@ -280,37 +280,6 @@ app.on('window-all-closed', function () { }*/ }) - -//Emitted before the application starts closing its windows. -//Calling event.preventDefault() will prevent the default behaviour, which is terminating the application. -app.on('before-quit', function (event) { - if (mainWindow === null && loadingWindow != null) { //mainWindow not intitialised and loadingWindow not dereferenced - //loading window is still open - console.log("before-quit prevented"); - event.preventDefault(); - } -}) - -//Emitted when all windows have been closed and the application will quit. -//Calling event.preventDefault() will prevent the default behaviour, which is terminating the application. -app.on('will-quit', function (event) { - if (mainWindow === null && loadingWindow != null) { - //loading window is still open - console.log("will-quit while loading window active"); - event.preventDefault(); - } -}) - -//Emitted when the application is quitting. -//Calling event.preventDefault() will prevent the default behaviour, which is terminating the application. -app.on('quit', function (event) { - if (mainWindow === null && loadingWindow != null) { - console.log("quit while loading window active"); - event.preventDefault(); - } -}) - - app.on('activate', function () { if (mainWindow === null) { //createWindow('open');