From 2168a59828b5d4e274c237c6163cd9de60c41dff Mon Sep 17 00:00:00 2001 From: Brendan Nee Date: Wed, 18 Feb 2015 13:45:17 -0800 Subject: [PATCH] Add "Checking for Update" to menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When state is “checking”, menu should say “Checking for Update” --- menus/darwin.cson | 1 + menus/win32.cson | 1 + src/browser/application-menu.coffee | 8 ++++++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/menus/darwin.cson b/menus/darwin.cson index 4c221c62c..7283ba16f 100644 --- a/menus/darwin.cson +++ b/menus/darwin.cson @@ -7,6 +7,7 @@ { label: 'VERSION', enabled: false } { label: 'Restart and Install Update', command: 'application:install-update', visible: false} { label: 'Check for Update', command: 'application:check-for-update', visible: false} + { label: 'Checking for Update', enabled: false, visible: false} { label: 'Downloading Update', enabled: false, visible: false} { type: 'separator' } { label: 'Preferences...', command: 'application:show-settings' } diff --git a/menus/win32.cson b/menus/win32.cson index 0067b9128..a3e5c8b8d 100644 --- a/menus/win32.cson +++ b/menus/win32.cson @@ -166,6 +166,7 @@ { label: 'VERSION', enabled: false } { label: 'Restart and Install Update', command: 'application:install-update', visible: false} { label: 'Check for Update', command: 'application:check-for-update', visible: false} + { label: 'Checking for Update', enabled: false, visible: false} { label: 'Downloading Update', enabled: false, visible: false} { type: 'separator' } { label: '&Documentation', command: 'application:open-documentation' } diff --git a/src/browser/application-menu.coffee b/src/browser/application-menu.coffee index 56f7c3d8a..5218ff304 100644 --- a/src/browser/application-menu.coffee +++ b/src/browser/application-menu.coffee @@ -92,19 +92,23 @@ class ApplicationMenu # Sets the proper visible state the update menu items showUpdateMenuItem: (state) -> checkForUpdateItem = _.find(@flattenMenuItems(@menu), ({label}) -> label == 'Check for Update') + checkingForUpdateItem = _.find(@flattenMenuItems(@menu), ({label}) -> label == 'Checking for Update') downloadingUpdateItem = _.find(@flattenMenuItems(@menu), ({label}) -> label == 'Downloading Update') installUpdateItem = _.find(@flattenMenuItems(@menu), ({label}) -> label == 'Restart and Install Update') - return unless checkForUpdateItem? and downloadingUpdateItem? and installUpdateItem? + return unless checkForUpdateItem? and checkingForUpdateItem? and downloadingUpdateItem? and installUpdateItem? checkForUpdateItem.visible = false + checkingForUpdateItem.visible = false downloadingUpdateItem.visible = false installUpdateItem.visible = false switch state when 'idle', 'error', 'no-update-available' checkForUpdateItem.visible = true - when 'checking', 'downloading' + when 'checking' + checkingForUpdateItem.visible = true + when 'downloading' downloadingUpdateItem.visible = true when 'update-available' installUpdateItem.visible = true