reload workspace

This commit is contained in:
zhandouxiaojiji committed 2020-12-04 10:46:55 +08:00
1 parent 74dc1c207d
commit 8c5e43b9e7
4 files changed
+14 -9

No files matched your search

-2
View File
@@ -2,8 +2,6 @@ import * as fs from 'fs';
import * as path from 'path'; import * as path from 'path';
import { BehaviorNodeModel, BehaviorTreeModel } from './BehaviorTreeModel'; import { BehaviorNodeModel, BehaviorTreeModel } from './BehaviorTreeModel';
export default (scriptPath: string, dirPath: string) => { export default (scriptPath: string, dirPath: string) => {
console.log("run script", scriptPath); console.log("run script", scriptPath);
const str = fs.readFileSync(scriptPath, "utf8"); const str = fs.readFileSync(scriptPath, "utf8");
+3 -4
View File
@@ -1,16 +1,15 @@
export default { export default {
OPEN_FILE: "OPEN_FILE", OPEN_FILE: "OPEN_FILE",
OPEN_DIR: "OPEN_DIR", OPEN_DIR: "OPEN_DIR",
OPEN_WORKSPACE: "OPEN_WORKSPACE", RELOAD_SERVER: "RELOAD_SERVER",
BATCH_EXEC: "BATCH_EXEC",
CREATE_TREE: "CREATE_TREE", CREATE_TREE: "CREATE_TREE",
CREATE_NODE: "CREATE_NODE", CREATE_NODE: "CREATE_NODE",
DELETE_NODE: "DELETE_NODE", DELETE_NODE: "DELETE_NODE",
COPY_NODE: "COPY_NODE", COPY_NODE: "COPY_NODE",
PASTE_NODE: "PASTE_NODE", PASTE_NODE: "PASTE_NODE",
SAVE: "SAVE",
SAVE_ALL: "SAVE_ALL", SAVE_ALL: "SAVE_ALL",
RELOAD_SERVER: "RELOAD_SERVER", SAVE: "SAVE",
UNDO: "UNDO", UNDO: "UNDO",
REDO: "REDO", REDO: "REDO",
BATCH_EXEC: "BATCH_EXEC",
}; };
+8
View File
@@ -262,6 +262,14 @@ export default class AppMenu {
saveToNewPath(); saveToNewPath();
}, },
}, },
{
label: "刷新",
accelerator: "F5",
click: () => {
console.log("reload workspace");
openWorkspace(this.settings.curWorkspace.getFilepath());
},
},
{ {
label: "最近打开", label: "最近打开",
submenu: recentItems, submenu: recentItems,
+3 -3
View File
@@ -422,9 +422,9 @@ export default class Explorer extends Component<ExplorerProps> {
onClick={(node: FileDataNode) => { onClick={(node: FileDataNode) => {
if (!node.isFolder) { if (!node.isFolder) {
onOpenTree(node.path); onOpenTree(node.path);
this.setState({ // this.setState({
selectedKey:node.id // selectedKey:node.id
}) // })
} }
}} }}
></DirectoryTree> ></DirectoryTree>