diff --git a/src/dlangide.d b/src/dlangide.d index e4a17dd..078e22f 100644 --- a/src/dlangide.d +++ b/src/dlangide.d @@ -39,7 +39,7 @@ extern (C) int UIAppMain(string[] args) { // open home screen tab frame.showHomeScreen(); // for testing: load workspace at startup - frame.loadWorkspace(appendPath(exePath, "../workspaces/sample1/sample1.dlangidews")); + //frame.loadWorkspace(appendPath(exePath, "../workspaces/sample1/sample1.dlangidews")); // show window window.show(); diff --git a/src/dlangide/ui/commands.d b/src/dlangide/ui/commands.d index ad427d9..13c0ac2 100644 --- a/src/dlangide/ui/commands.d +++ b/src/dlangide/ui/commands.d @@ -65,4 +65,4 @@ const Action ACTION_EDIT_REDO = new Action(EditorActions.Redo, "MENU_EDIT_REDO"c const Action ACTION_HELP_ABOUT = new Action(IDEActions.HelpAbout, "MENU_HELP_ABOUT"c); const Action ACTION_WINDOW_CLOSE_ALL_DOCUMENTS = new Action(IDEActions.WindowCloseAllDocuments, "MENU_WINDOW_CLOSE_ALL_DOCUMENTS"c); const Action ACTION_CREATE_NEW_WORKSPACE = new Action(IDEActions.CreateNewWorkspace, "Create new workspace"d); -const Action ACTION_ADD_TO_CURRENT_WORKSPACE = new Action(IDEActions.CreateNewWorkspace, "Add to current workspace"d); +const Action ACTION_ADD_TO_CURRENT_WORKSPACE = new Action(IDEActions.AddToCurrentWorkspace, "Add to current workspace"d); diff --git a/src/dlangide/ui/frame.d b/src/dlangide/ui/frame.d index 9bf3e09..4f2cd65 100644 --- a/src/dlangide/ui/frame.d +++ b/src/dlangide/ui/frame.d @@ -415,6 +415,7 @@ class IDEFrame : AppFrame { Workspace ws = new Workspace(); ws.name = project.name; ws.description = project.description; + ws.addProject(project); ws.save(defWsFile); setWorkspace(ws); } else if (result.id == IDEActions.AddToCurrentWorkspace) { @@ -433,14 +434,14 @@ class IDEFrame : AppFrame { } } - bool loadWorkspace(string path) { - // testing workspace loader - Workspace ws = new Workspace(); - ws.load(path); - setWorkspace(ws); - ws.save(ws.filename ~ ".bak"); - return true; - } + //bool loadWorkspace(string path) { + // // testing workspace loader + // Workspace ws = new Workspace(); + // ws.load(path); + // setWorkspace(ws); + // //ws.save(ws.filename ~ ".bak"); + // return true; + //} void setWorkspace(Workspace ws) { closeAllDocuments(); diff --git a/src/dlangide/ui/wspanel.d b/src/dlangide/ui/wspanel.d index 9354405..803efaf 100644 --- a/src/dlangide/ui/wspanel.d +++ b/src/dlangide/ui/wspanel.d @@ -95,8 +95,7 @@ class WorkspacePanel : DockWindow { } void reloadItems() { - _tree.requestLayout(); - _tree.items.clear(); + _tree.clearAllItems(); if (_workspace) { TreeItem root = _tree.items.newChild(_workspace.filename, _workspace.name, "project-development"); root.intParam = ProjectItemType.Workspace; @@ -106,13 +105,13 @@ class WorkspacePanel : DockWindow { addProjectItems(p, project.items); } } else { - _tree.items.newChild("none", "New workspace"d, "project-development"); + _tree.items.newChild("none", "No workspace"d, "project-development"); } + _tree.onTreeContentChange(null); } @property void workspace(Workspace w) { _workspace = w; reloadItems(); - _tree.onTreeContentChange(null); } }