Require dialog and shell early in browser process

Prevents issues when the asar bundle changes before these
files are required.
This commit is contained in:
Kevin Sawicki
2015-07-06 15:07:02 -07:00
parent eeccf8d82a
commit 30dccf987d
2 changed files with 10 additions and 10 deletions

View File

@@ -6,6 +6,8 @@ BrowserWindow = require 'browser-window'
StorageFolder = require '../storage-folder'
Menu = require 'menu'
app = require 'app'
dialog = require 'dialog'
shell = require 'shell'
fs = require 'fs-plus'
ipc = require 'ipc'
path = require 'path'
@@ -175,13 +177,13 @@ class AtomApplication
atomWindow ?= @focusedWindow()
atomWindow?.browserWindow.inspectElement(x, y)
@on 'application:open-documentation', -> require('shell').openExternal('https://atom.io/docs/latest/?app')
@on 'application:open-discussions', -> require('shell').openExternal('https://discuss.atom.io')
@on 'application:open-roadmap', -> require('shell').openExternal('https://atom.io/roadmap?app')
@on 'application:open-faq', -> require('shell').openExternal('https://atom.io/faq')
@on 'application:open-terms-of-use', -> require('shell').openExternal('https://atom.io/terms')
@on 'application:report-issue', -> require('shell').openExternal('https://github.com/atom/atom/blob/master/CONTRIBUTING.md#submitting-issues')
@on 'application:search-issues', -> require('shell').openExternal('https://github.com/issues?q=+is%3Aissue+user%3Aatom')
@on 'application:open-documentation', -> shell.openExternal('https://atom.io/docs/latest/?app')
@on 'application:open-discussions', -> shell.openExternal('https://discuss.atom.io')
@on 'application:open-roadmap', -> shell.openExternal('https://atom.io/roadmap?app')
@on 'application:open-faq', -> shell.openExternal('https://atom.io/faq')
@on 'application:open-terms-of-use', -> shell.openExternal('https://atom.io/terms')
@on 'application:report-issue', -> shell.openExternal('https://github.com/atom/atom/blob/master/CONTRIBUTING.md#submitting-issues')
@on 'application:search-issues', -> shell.openExternal('https://github.com/issues?q=+is%3Aissue+user%3Aatom')
@on 'application:install-update', =>
@quitting = true
@@ -582,5 +584,4 @@ class AtomApplication
if projectPath = @lastFocusedWindow?.projectPath
openOptions.defaultPath = projectPath
dialog = require 'dialog'
dialog.showOpenDialog(parentWindow, openOptions, callback)

View File

@@ -1,5 +1,6 @@
BrowserWindow = require 'browser-window'
app = require 'app'
dialog = require 'dialog'
path = require 'path'
fs = require 'fs'
url = require 'url'
@@ -125,7 +126,6 @@ class AtomWindow
@browserWindow.on 'unresponsive', =>
return if @isSpec
dialog = require 'dialog'
chosen = dialog.showMessageBox @browserWindow,
type: 'warning'
buttons: ['Close', 'Keep Waiting']
@@ -136,7 +136,6 @@ class AtomWindow
@browserWindow.webContents.on 'crashed', =>
global.atomApplication.exit(100) if @exitWhenDone
dialog = require 'dialog'
chosen = dialog.showMessageBox @browserWindow,
type: 'warning'
buttons: ['Close Window', 'Reload', 'Keep It Open']