Prompt unresponsive state in spec window.
This commit is contained in:
parent
02d14ed23b
commit
adc5495d2b
1 changed files with 10 additions and 0 deletions
10
spec/main.js
10
spec/main.js
|
@ -1,5 +1,6 @@
|
|||
var app = require('app');
|
||||
var ipc = require('ipc');
|
||||
var dialog = require('dialog');
|
||||
var BrowserWindow = require('browser-window');
|
||||
var Menu = require('menu');
|
||||
|
||||
|
@ -103,4 +104,13 @@ app.on('finish-launching', function() {
|
|||
height: 600
|
||||
});
|
||||
window.loadUrl('file://' + __dirname + '/index.html');
|
||||
window.on('unresponsive', function() {
|
||||
var chosen = dialog.showMessageBox(window, {
|
||||
type: 'warning',
|
||||
buttons: ['Close', 'Keep Waiting'],
|
||||
message: 'Window is not responsing',
|
||||
detail: 'The window is not responding. Would you like to force close it or just keep waiting?'
|
||||
});
|
||||
if (chosen == 0) window.destroy();
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue