loading of projects and workspaces completed

This commit is contained in:
Vadim Lopatin 2015-01-27 18:34:50 +03:00
parent ce91b7c797
commit a32aac9561
4 changed files with 14 additions and 14 deletions

View File

@ -39,7 +39,7 @@ extern (C) int UIAppMain(string[] args) {
// open home screen tab // open home screen tab
frame.showHomeScreen(); frame.showHomeScreen();
// for testing: load workspace at startup // for testing: load workspace at startup
frame.loadWorkspace(appendPath(exePath, "../workspaces/sample1/sample1.dlangidews")); //frame.loadWorkspace(appendPath(exePath, "../workspaces/sample1/sample1.dlangidews"));
// show window // show window
window.show(); window.show();

View File

@ -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_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_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_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);

View File

@ -415,6 +415,7 @@ class IDEFrame : AppFrame {
Workspace ws = new Workspace(); Workspace ws = new Workspace();
ws.name = project.name; ws.name = project.name;
ws.description = project.description; ws.description = project.description;
ws.addProject(project);
ws.save(defWsFile); ws.save(defWsFile);
setWorkspace(ws); setWorkspace(ws);
} else if (result.id == IDEActions.AddToCurrentWorkspace) { } else if (result.id == IDEActions.AddToCurrentWorkspace) {
@ -433,14 +434,14 @@ class IDEFrame : AppFrame {
} }
} }
bool loadWorkspace(string path) { //bool loadWorkspace(string path) {
// testing workspace loader // // testing workspace loader
Workspace ws = new Workspace(); // Workspace ws = new Workspace();
ws.load(path); // ws.load(path);
setWorkspace(ws); // setWorkspace(ws);
ws.save(ws.filename ~ ".bak"); // //ws.save(ws.filename ~ ".bak");
return true; // return true;
} //}
void setWorkspace(Workspace ws) { void setWorkspace(Workspace ws) {
closeAllDocuments(); closeAllDocuments();

View File

@ -95,8 +95,7 @@ class WorkspacePanel : DockWindow {
} }
void reloadItems() { void reloadItems() {
_tree.requestLayout(); _tree.clearAllItems();
_tree.items.clear();
if (_workspace) { if (_workspace) {
TreeItem root = _tree.items.newChild(_workspace.filename, _workspace.name, "project-development"); TreeItem root = _tree.items.newChild(_workspace.filename, _workspace.name, "project-development");
root.intParam = ProjectItemType.Workspace; root.intParam = ProjectItemType.Workspace;
@ -106,13 +105,13 @@ class WorkspacePanel : DockWindow {
addProjectItems(p, project.items); addProjectItems(p, project.items);
} }
} else { } 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) { @property void workspace(Workspace w) {
_workspace = w; _workspace = w;
reloadItems(); reloadItems();
_tree.onTreeContentChange(null);
} }
} }