From 8c5e43b9e743491829b6c70eb279e3f88f3a4290 Mon Sep 17 00:00:00 2001 From: zhandouxiaojiji Date: Fri, 4 Dec 2020 10:46:55 +0800 Subject: [PATCH] reload workspace --- common/BatchExec.ts | 2 -- common/MainEventType.ts | 7 +++---- main-process/AppMenu.ts | 8 ++++++++ render-process/Explorer.tsx | 6 +++--- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/common/BatchExec.ts b/common/BatchExec.ts index 79fd329..7eedd92 100644 --- a/common/BatchExec.ts +++ b/common/BatchExec.ts @@ -2,8 +2,6 @@ import * as fs from 'fs'; import * as path from 'path'; import { BehaviorNodeModel, BehaviorTreeModel } from './BehaviorTreeModel'; - - export default (scriptPath: string, dirPath: string) => { console.log("run script", scriptPath); const str = fs.readFileSync(scriptPath, "utf8"); diff --git a/common/MainEventType.ts b/common/MainEventType.ts index e8b7481..99616fc 100644 --- a/common/MainEventType.ts +++ b/common/MainEventType.ts @@ -1,16 +1,15 @@ export default { OPEN_FILE: "OPEN_FILE", OPEN_DIR: "OPEN_DIR", - OPEN_WORKSPACE: "OPEN_WORKSPACE", + RELOAD_SERVER: "RELOAD_SERVER", + BATCH_EXEC: "BATCH_EXEC", CREATE_TREE: "CREATE_TREE", CREATE_NODE: "CREATE_NODE", DELETE_NODE: "DELETE_NODE", COPY_NODE: "COPY_NODE", PASTE_NODE: "PASTE_NODE", - SAVE: "SAVE", SAVE_ALL: "SAVE_ALL", - RELOAD_SERVER: "RELOAD_SERVER", + SAVE: "SAVE", UNDO: "UNDO", REDO: "REDO", - BATCH_EXEC: "BATCH_EXEC", }; diff --git a/main-process/AppMenu.ts b/main-process/AppMenu.ts index 0736959..cc50b70 100644 --- a/main-process/AppMenu.ts +++ b/main-process/AppMenu.ts @@ -262,6 +262,14 @@ export default class AppMenu { saveToNewPath(); }, }, + { + label: "刷新", + accelerator: "F5", + click: () => { + console.log("reload workspace"); + openWorkspace(this.settings.curWorkspace.getFilepath()); + }, + }, { label: "最近打开", submenu: recentItems, diff --git a/render-process/Explorer.tsx b/render-process/Explorer.tsx index fb4417c..42d9734 100644 --- a/render-process/Explorer.tsx +++ b/render-process/Explorer.tsx @@ -422,9 +422,9 @@ export default class Explorer extends Component { onClick={(node: FileDataNode) => { if (!node.isFolder) { onOpenTree(node.path); - this.setState({ - selectedKey:node.id - }) + // this.setState({ + // selectedKey:node.id + // }) } }} >