Set parent window for about/new version, escape to close (#1795)
* Set parent window for about/new version, escape to close * Exclude jquery from jshint run
This commit is contained in:
parent
158b575885
commit
1c455c83e0
6 changed files with 9241 additions and 6 deletions
|
@ -19,7 +19,7 @@ function checkForUpdates() {
|
|||
}
|
||||
|
||||
var showingDialog = false;
|
||||
function showUpdateDialog(messages) {
|
||||
function showUpdateDialog(mainWindow, messages) {
|
||||
if (showingDialog) {
|
||||
return;
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ function showUpdateDialog(messages) {
|
|||
cancelId: LATER_BUTTON
|
||||
}
|
||||
|
||||
dialog.showMessageBox(options, function(response) {
|
||||
dialog.showMessageBox(mainWindow, options, function(response) {
|
||||
if (response == RESTART_BUTTON) {
|
||||
windowState.markShouldQuit();
|
||||
autoUpdater.quitAndInstall();
|
||||
|
@ -52,7 +52,7 @@ function onError(error) {
|
|||
console.log("Got an error while updating: ", error.stack);
|
||||
}
|
||||
|
||||
function initialize(messages) {
|
||||
function initialize(getMainWindow, messages) {
|
||||
if (!messages) {
|
||||
throw new Error('auto-update initialize needs localized messages');
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ function initialize(messages) {
|
|||
}
|
||||
|
||||
autoUpdater.addListener('update-downloaded', function() {
|
||||
showUpdateDialog(messages);
|
||||
showUpdateDialog(getMainWindow(), messages);
|
||||
});
|
||||
autoUpdater.addListener('error', onError);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue