mirror of https://github.com/buggins/dlangide.git
loading of projects and workspaces completed
This commit is contained in:
parent
ce91b7c797
commit
a32aac9561
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue