From 30dccf987dace93bc8bc0b429c5df396b30318bf Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Mon, 6 Jul 2015 15:07:02 -0700 Subject: [PATCH] Require dialog and shell early in browser process Prevents issues when the asar bundle changes before these files are required. --- src/browser/atom-application.coffee | 17 +++++++++-------- src/browser/atom-window.coffee | 3 +-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index f6813914e..669fbadff 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -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) diff --git a/src/browser/atom-window.coffee b/src/browser/atom-window.coffee index 7b0b2cb85..5f9219ead 100644 --- a/src/browser/atom-window.coffee +++ b/src/browser/atom-window.coffee @@ -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']