From 4e0da56296999c457df6925264b539a61282cdcc Mon Sep 17 00:00:00 2001 From: yuanwhy <710136012@qq.com> Date: Mon, 29 Aug 2016 22:52:26 +0800 Subject: [PATCH 1/3] send event to save state after 'Add Project Folder' or 'Remove Project Folder --- src/application-delegate.coffee | 2 ++ src/main-process/atom-application.coffee | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/application-delegate.coffee b/src/application-delegate.coffee index 853ac54f5..20e4a54cb 100644 --- a/src/application-delegate.coffee +++ b/src/application-delegate.coffee @@ -126,6 +126,8 @@ class ApplicationDelegate loadSettings = getWindowLoadSettings() loadSettings['initialPaths'] = paths setWindowLoadSettings(loadSettings) + ipcRenderer.send("did-save-state") + setAutoHideWindowMenuBar: (autoHide) -> ipcRenderer.send("call-window-method", "setAutoHideMenuBar", autoHide) diff --git a/src/main-process/atom-application.coffee b/src/main-process/atom-application.coffee index 0fd7f5630..d4be3ea27 100644 --- a/src/main-process/atom-application.coffee +++ b/src/main-process/atom-application.coffee @@ -351,6 +351,9 @@ class AtomApplication @fileRecoveryService.didSavePath(@windowForEvent(event), path) event.returnValue = true + @disposable.add ipcHelpers.on ipcMain, 'did-save-state', => + @saveState(false) + setupDockMenu: -> if process.platform is 'darwin' dockMenu = Menu.buildFromTemplate [ From 1c1640c1d8539f46eade7bf645b84b901b92c356 Mon Sep 17 00:00:00 2001 From: yuanwhy <710136012@qq.com> Date: Tue, 30 Aug 2016 20:29:05 +0800 Subject: [PATCH 2/3] rename to did-change-paths --- src/application-delegate.coffee | 2 +- src/main-process/atom-application.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/application-delegate.coffee b/src/application-delegate.coffee index 20e4a54cb..4e04df7cd 100644 --- a/src/application-delegate.coffee +++ b/src/application-delegate.coffee @@ -126,7 +126,7 @@ class ApplicationDelegate loadSettings = getWindowLoadSettings() loadSettings['initialPaths'] = paths setWindowLoadSettings(loadSettings) - ipcRenderer.send("did-save-state") + ipcRenderer.send("did-change-paths") setAutoHideWindowMenuBar: (autoHide) -> diff --git a/src/main-process/atom-application.coffee b/src/main-process/atom-application.coffee index d4be3ea27..51ea70af9 100644 --- a/src/main-process/atom-application.coffee +++ b/src/main-process/atom-application.coffee @@ -351,7 +351,7 @@ class AtomApplication @fileRecoveryService.didSavePath(@windowForEvent(event), path) event.returnValue = true - @disposable.add ipcHelpers.on ipcMain, 'did-save-state', => + @disposable.add ipcHelpers.on ipcMain, 'did-change-paths', => @saveState(false) setupDockMenu: -> From 1320ff28c39afd563820b30b43389ea38552e74c Mon Sep 17 00:00:00 2001 From: yuanwhy <710136012@qq.com> Date: Tue, 30 Aug 2016 23:00:20 +0800 Subject: [PATCH 3/3] delete empty line --- src/application-delegate.coffee | 1 - 1 file changed, 1 deletion(-) diff --git a/src/application-delegate.coffee b/src/application-delegate.coffee index 4e04df7cd..b55ab6964 100644 --- a/src/application-delegate.coffee +++ b/src/application-delegate.coffee @@ -128,7 +128,6 @@ class ApplicationDelegate setWindowLoadSettings(loadSettings) ipcRenderer.send("did-change-paths") - setAutoHideWindowMenuBar: (autoHide) -> ipcRenderer.send("call-window-method", "setAutoHideMenuBar", autoHide)