3 import "FileSystemIterator"
5 class ImportFolderFSI : NormalFileSystemIterator
7 ProjectView projectView;
8 Array<ProjectNode> stack { };
10 bool OnFolder(char * folderPath)
12 char name[MAX_LOCATION];
13 ProjectNode parentNode = stack.lastIterator.data;
15 GetLastDirectory(folderPath, name);
16 folder = parentNode.FindSpecial(name, false, true, true);
18 folder = projectView.NewFolder(parentNode, name, false);
23 void OutFolder(char * folderPath, bool isRoot)
25 stack.lastIterator.Remove(); //stack.Remove();
28 bool OnFile(char * filePath)
30 ProjectNode parentNode = stack.lastIterator.data;
31 projectView.AddFile(parentNode, filePath, parentNode.isInResources, false);
36 static FileFilter fileFilters[] =
39 "EC/C/C++ Files (*.ec, *.eh, *.c, *.cpp, *.cc, *.cxx, *.h, *.hpp, *.hh, *.hxx)",
40 "ec, eh, c, cpp, cc, cxx, h, hpp, hh, hxx"
43 "EC/C/C++ Source Files (*.ec, *.c, *.cpp, *.cc, *.cxx)",
44 "ec, eh, c, cpp, cc, cxx"
47 "Header Files for eC/C/C++ (*.eh, *.h, *.hpp, *.hh, *.hxx)",
53 static FileFilter resourceFilters[] =
56 "Image Files (*.jpg, *.jpeg, *.bmp, *.pcx, *.png,*.gif)",
57 "jpg, jpeg, bmp, pcx, png, gif"
60 "3D Studio Model Files (*.3ds)",
66 static FileType fileTypes[] =
68 { "Based on extension", null },
71 { "3D Studio Model", "3ds" }
74 static FileFilter projectFilters[] =
76 { "Project Files (*.epj)", ProjectExtension },
77 { "Workspace Files (*.ews)", WorkspaceExtension }
80 static FileType projectTypes[] =
82 { "ECERE Project", ProjectExtension },
83 { "ECERE Workspace", WorkspaceExtension }
86 static char * iconNames[] =
88 "<:ecere>mimeTypes/file.png", /*genFile*/
89 "<:ecere>mimeTypes/textEcereWorkspace.png", /*ewsFile*/
90 "<:ecere>mimeTypes/textEcereProject.png", /*epjFile*/
91 "<:ecere>places/folder.png", /*folder*/
92 "<:ecere>status/folderOpen.png", /*openFolder*/
93 "<:ecere>mimeTypes/textEcereSource.png", /*ecFile*/
94 "<:ecere>mimeTypes/textEcereHeader.png", /*ehFile*/
95 "<:ecere>mimeTypes/textCSource.png", /*cFile*/
96 "<:ecere>mimeTypes/textCHeader.png", /*hFile*/
97 "<:ecere>mimeTypes/textC++Source.png", /*cppFile*/
98 "<:ecere>mimeTypes/textC++Header.png", /*hppFile*/
99 "<:ecere>mimeTypes/text.png", /*textFile*/
100 "<:ecere>mimeTypes/textHyperTextMarkup.png", /*webFile*/
101 "<:ecere>mimeTypes/image.png", /*pictureFile*/
102 "<:ecere>status/audioVolumeHigh.png", /*soundFile*/
103 "<:ecere>mimeTypes/package.png", /*archiveFile*/
104 "<:ecere>mimeTypes/packageSoftware.png", /*packageFile*/
105 "<:ecere>mimeTypes/packageOpticalDisc.png", /*opticalMediaImageFile*/
106 "<:ecere>mimeTypes/file.png" /*mFile*/ //TODO: create icon for mfile
109 enum PrepareMakefileMethod { normal, force, forceExists };
111 enum BuildType { build, rebuild, relink, run, start, restart };
114 none, buildingMainProject, buildingSecondaryProject, compilingFile;
116 property bool { get { return this != none; } }
117 //property bool actualBuild { get { return this == buildingMainProject || this == buildingSecondaryProject; } }
120 class ProjectView : Window
123 //hasMinimize = true;
125 borderStyle = sizable;
126 hasHorzScroll = true;
127 hasVertScroll = true;
130 anchor = Anchor { left = 0, top = 0, bottom = 0 };
133 //hasMinimize = true;
134 saveDialog = projectFileDialog;
137 BuildState buildInProgress;
138 BitmapResource icons[NodeIcons];
141 property Workspace workspace
147 for(prj : workspace.projects)
149 DeleteNode(prj.topNode);
151 workspace.projects.Free();
152 ide.debugger.CleanUp();
157 fileDialog.currentDirectory = workspace.workspaceDir;
158 resourceFileDialog.currentDirectory = workspace.workspaceDir;
159 for(prj : workspace.projects)
160 AddNode(prj.topNode, null);
161 ide.statusBar.text = "Generating Makefile & Dependencies...";
163 for(prj : workspace.projects)
164 prj.ModifiedAllConfigs(true, false, false, false);
165 ide.statusBar.text = "Initializing Debugger"; app.UpdateDisplay();
166 ide.statusBar.text = null;
170 get { return workspace; }
173 /*property Project project
179 DeleteNode(project.topNode);
185 AddNode(project.topNode, null);
186 fileDialog.currentDirectory = project.topNode.path;
187 resourceFileDialog.currentDirectory = project.topNode.path;
189 // Make sure this is done already...
191 char filePath[MAX_LOCATION];
192 strcpy(filePath, project.topNode.path);
193 PathCat(filePath, project.topNode.name);
194 strcat(filePath, ".epj");
198 ide.statusBar.text = "Generating Makefile & Dependencies...";
200 // REDJ set makefile generation flag so generation occurs only when compiling instead of generating on the spot
201 project.config.makingModified = true;
202 ide.statusBar.text = "Initializing Debugger";
203 ide.statusBar.text = null;
207 get { return project; }
210 bool drawingInProjectSettingsDialog;
211 bool drawingInProjectSettingsDialogHeader;
212 ProjectSettings projectSettingsDialog;
218 multiSelect = true, fullRowSelect = false, hasVertScroll = true, hasHorzScroll = true;
219 borderStyle = deep, parent = this, collapseControl = true, treeBranches = true;
220 anchor = Anchor { left = 0, right = 0, top = 0 , bottom = 0 };
222 background = projectViewBackground;
223 foreground = projectViewText;
224 selectionColor = selectionColor, selectionText = selectionText;
225 stippleColor = skyBlue;
227 bool OnActivate(bool active, Window previous, bool * goOnWithActivation, bool direct)
229 if(!active) Update(null);
230 return ListBox::OnActivate(active, previous, goOnWithActivation, direct);
233 bool NotifyDoubleClick(ListBox listBox, int x, int y, Modifiers mods)
239 bool NotifyRightClick(ListBox listBox, int x, int y, Modifiers mods)
241 DataRow row = listBox.currentRow;
244 ProjectNode node = (ProjectNode)row.tag;
245 if(node.type == NodeTypes::project || node.type == resources || node.type == file || node.type == folder)
247 bool buildMenuUnavailable = buildInProgress;
249 Menu popupContent { };
251 if(node.type == NodeTypes::project)
253 //if(node == ((Project)workspace.projects.first).topNode)
255 MenuItem { popupContent, "Build", b, NotifySelect = ProjectBuild }.disabled = buildMenuUnavailable;
256 MenuItem { popupContent, "Relink", l, NotifySelect = ProjectLink }.disabled = buildMenuUnavailable;
257 MenuItem { popupContent, "Rebuild", r, NotifySelect = ProjectRebuild }.disabled = buildMenuUnavailable;
258 MenuItem { popupContent, "Clean", c, NotifySelect = ProjectClean }.disabled = buildMenuUnavailable;
259 MenuItem { popupContent, "Regenerate Makefile", m, NotifySelect = ProjectRegenerate }.disabled = buildMenuUnavailable;
260 MenuDivider { popupContent };
262 MenuItem { popupContent, "New File...", l, Key { l, ctrl = true }, NotifySelect = ProjectNewFile };
263 MenuItem { popupContent, "New Folder...", n, Key { f, ctrl = true }, NotifySelect = ProjectNewFolder };
264 MenuItem { popupContent, "Import Folder...", i, NotifySelect = ProjectImportFolder };
265 MenuItem { popupContent, "Add Files to Project...", f, NotifySelect = ProjectAddFiles };
266 MenuDivider { popupContent };
267 MenuItem { popupContent, "Add New Form...", o, NotifySelect = ProjectAddNewForm };
268 // MenuItem { popupContent, "Add New Behavior Graph...", g, NotifySelect = ProjectAddNewGraph };
269 MenuDivider { popupContent };
270 if(node != ((Project)workspace.projects.first).topNode)
272 MenuItem { popupContent, "Remove project from workspace", r, NotifySelect = ProjectRemove }.disabled = buildMenuUnavailable;
273 MenuDivider { popupContent };
275 MenuItem { popupContent, "Active Configuration...", s, Key { f5, alt = true } , NotifySelect = MenuConfig };
276 MenuItem { popupContent, "Settings...", s, Key { f7, alt = true } , NotifySelect = MenuSettings };
277 MenuDivider { popupContent };
278 MenuItem { popupContent, "Browse Folder", w, NotifySelect = MenuBrowseFolder };
279 MenuDivider { popupContent };
280 MenuItem { popupContent, "Save", v, Key { s, ctrl = true }, NotifySelect = ProjectSave }.disabled = !node.modified;
281 MenuDivider { popupContent };
282 MenuItem { popupContent, "Properties...", p, Key { enter, alt = true }, NotifySelect = FileProperties };
284 else if(node.type == resources)
286 MenuItem { popupContent, "New File...", l, Key { l, ctrl = true }, NotifySelect = ProjectNewFile };
287 MenuItem { popupContent, "New Folder...", n, Key { f, ctrl = true }, NotifySelect = ProjectNewFolder };
288 MenuItem { popupContent, "Add Resources to Project...", f, NotifySelect = ResourcesAddFiles };
289 MenuItem { popupContent, "Browse Folder", w, NotifySelect = MenuBrowseFolder };
290 MenuDivider { popupContent };
291 MenuItem { popupContent, "Settings...", s, Key { f7, alt = true } , NotifySelect = MenuSettings };
292 MenuItem { popupContent, "Properties...", p, Key { enter, alt = true }, NotifySelect = FileProperties };
294 else if(node.type == file)
296 MenuItem { popupContent, "Open", o, NotifySelect = FileOpenFile };
297 MenuItem { popupContent, "Compile", c, Key { f7, ctrl = true}, NotifySelect = FileCompile }.disabled = buildMenuUnavailable;
298 MenuDivider { popupContent };
299 MenuItem { popupContent, "Remove", r, NotifySelect = FileRemoveFile };
300 MenuDivider { popupContent };
301 MenuItem { popupContent, "Browse Folder", w, NotifySelect = MenuBrowseFolder };
302 MenuDivider { popupContent };
303 MenuItem { popupContent, "Settings...", s, Key { f7, alt = true } , NotifySelect = MenuSettings };
304 MenuItem { popupContent, "Properties..", p, Key { enter, alt = true }, NotifySelect = FileProperties };
306 else if(node.type == folder)
308 bool isInResources = node.isInResources;
310 MenuItem { popupContent, "New File...", l, Key { l, ctrl = true }, NotifySelect = ProjectNewFile };
311 MenuItem { popupContent, "New Folder...", n, Key { f, ctrl = true }, NotifySelect = ProjectNewFolder };
312 MenuItem { popupContent, "Import Folder...", i, NotifySelect = ProjectImportFolder };
315 MenuItem { popupContent, "Add Resources to Folder...", f, NotifySelect = ResourcesAddFiles };
319 MenuItem { popupContent, "Add Files to Folder...", f, NotifySelect = ProjectAddFiles };
323 MenuDivider { popupContent };
324 MenuItem { popupContent, "Add New Form...", o, NotifySelect = ProjectAddNewForm };
325 MenuItem { popupContent, "Add New Behavior Graph...", g, NotifySelect = ProjectAddNewGraph };
327 MenuDivider { popupContent };
328 MenuItem { popupContent, "Remove", r, NotifySelect = FileRemoveFile };
329 MenuDivider { popupContent };
330 MenuItem { popupContent, "Browse Folder", w, NotifySelect = MenuBrowseFolder };
331 MenuDivider { popupContent };
332 MenuItem { popupContent, "Settings...", s, Key { f7, alt = true } , NotifySelect = MenuSettings };
333 MenuItem { popupContent, "Properties...", p, Key { enter, alt = true }, NotifySelect = FileProperties };
338 master = this, menu = popupContent;
340 x + clientStart.x + absPosition.x - app.desktop.position.x,
341 y + clientStart.y + absPosition.y - app.desktop.position.y };
349 bool NotifyKeyDown(ListBox listBox, DataRow row, Key key, unichar ch)
353 ProjectNode node = (ProjectNode)row.tag;
356 case altEnter: case Key { keyPadEnter, alt = true }:
358 NodeProperties { parent = parent, master = this,
359 position = { position.x + 100, position.y + 100 }, node = node }.Create();
362 case enter: case keyPadEnter:
365 for(resNode = node.parent; resNode; resNode = resNode.parent)
366 if(resNode.type == resources)
368 if(node.type == project || (node.type == folder && !resNode))
373 else if(node.type == resources || node.type == folder)
382 if(node.type == project || node.type == folder || node.type == resources)
391 if(node.type == project || node.type == folder || node.type == resources)
393 NewFolder(node, null, true);
400 if(node.type == file)
402 FileCompile(null, (Modifiers)key);
407 case Key { space, shift = true }:
410 if(node.type == NodeTypes::project)
413 for(p : workspace.projects)
415 if(p.topNode == node)
421 prj.RotateActiveConfig(!key.shift);
432 case enter: case keyPadEnter: OpenSelectedNodes(); break;
433 case del: RemoveSelectedNodes(); break;
436 Window activeClient = ide.activeClient;
438 activeClient.Activate();
440 ide.RepositionWindows(true);
447 bool NotifyCollapse(ListBox listBox, DataRow row, bool collapsed)
449 ProjectNode node = (ProjectNode)row.tag;
450 if(node.type == folder)
451 node.icon = collapsed ? folder : openFolder;
456 FileDialog importFileDialog { autoCreate = false, type = selectDir, text = "Import Folder" };
457 FileDialog projectFileDialog
459 autoCreate = false, filters = projectFilters, sizeFilters = sizeof(projectFilters);
460 types = projectTypes, sizeTypes = sizeof(projectTypes);
462 FileDialog fileDialog
464 autoCreate = false, mayNotExist = true, filters = fileFilters, sizeFilters = sizeof(fileFilters);
465 types = fileTypes, sizeTypes = sizeof(fileTypes);
467 FileDialog resourceFileDialog
469 autoCreate = false, mayNotExist = true, filters = resourceFilters, sizeFilters = sizeof(resourceFilters);
470 types = fileTypes, sizeTypes = sizeof(fileTypes);
473 Menu fileMenu { menu, "File", f };
474 MenuItem { fileMenu, "Save", s, Key { s, ctrl = true }, NotifySelect = MenuFileSave };
475 // MenuItem { fileMenu, "Save As...", a, NotifySelect = MenuFileSaveAs };
477 bool OnClose(bool parentClosing)
479 if(!parentClosing && visible)
491 //if(ide.findInFilesDialog && ide.findInFilesDialog.created && ide.findInFilesDialog.mode != directory)
492 // ide.findInFilesDialog.SearchStop();
494 ide.outputView.buildBox.Clear();
495 ide.outputView.debugBox.Clear();
496 //ide.outputView.findBox.Clear();
497 ide.callStackView.Clear();
498 ide.watchesView.Clear();
499 ide.threadsView.Clear();
500 ide.breakpointsView.Clear();
501 ide.outputView.ShowClearSelectTab(find); // why this?
504 bool OnSaveFile(char * fileName)
506 for(prj : ide.workspace.projects)
508 if(prj.topNode.modified && prj.Save(prj.filePath))
510 // ProjectUpdateMakefileForAllConfigs(prj, true, true);
511 prj.topNode.modified = false;
514 modifiedDocument = false;
519 bool IsModuleInProject(char * filePath)
521 char moduleName[MAX_FILENAME]; //, modulePath[MAX_LOCATION];
522 GetLastDirectory(filePath, moduleName);
523 return project.topNode.Find(moduleName, false) != null;
526 bool GetRelativePath(char * filePath, char * relativePath)
529 char moduleName[MAX_FILENAME]; //, modulePath[MAX_LOCATION];
530 GetLastDirectory(filePath, moduleName);
532 // try with workspace dir first?
533 if((node = project.topNode.Find(moduleName, false)))
535 strcpy(relativePath, node.path);
536 PathCatSlash(relativePath, node.name);
539 // WARNING: On failure, relative path is uninitialized
541 return project.GetRelativePath(filePath, relativePath);
544 ProjectNode GetNodeFromWindow(Window document, Project project)
546 if(document.fileName)
548 char winFileName[MAX_LOCATION];
549 char * documentFileName = GetSlashPathBuffer(winFileName, document.fileName);
550 for(p : ide.workspace.projects)
552 Project prj = project ? project : p;
554 char moduleName[MAX_FILENAME], modulePath[MAX_LOCATION];
555 GetLastDirectory(document.fileName, moduleName);
557 if((node = prj.topNode.Find(moduleName, false)))
559 strcpy(modulePath, prj.topNode.path);
560 PathCatSlash(modulePath, node.path);
561 PathCatSlash(modulePath, node.name);
562 if(!fstrcmp(documentFileName, modulePath))
573 void Compile(ProjectNode node)
575 char fileName[MAX_LOCATION];
576 char extension[MAX_EXTENSION];
578 Project prj = node.project;
579 CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
580 DirExpression objDir = prj.objDir;
582 strcpy(fileName, prj.topNode.path);
583 PathCatSlash(fileName, objDir.dir);
584 PathCatSlash(fileName, node.name);
585 StripExtension(fileName);
586 strcat(fileName, ".o");
587 if(FileExists(fileName))
588 DeleteFile(fileName);
590 GetExtension(node.name, extension);
591 if(!strcmp(extension, "ec"))
593 // Delete generated C file
594 strcpy(fileName, prj.topNode.path);
595 PathCat(fileName, objDir.dir);
596 PathCat(fileName, node.name);
597 StripExtension(fileName);
598 strcat(fileName, ".c");
599 if(FileExists(fileName))
600 DeleteFile(fileName);
602 // Delete symbol file
603 strcpy(fileName, prj.topNode.path);
604 PathCat(fileName, node.path);
605 PathCat(fileName, node.name);
606 StripExtension(fileName);
607 strcat(fileName, ".sym");
608 if(FileExists(fileName))
609 DeleteFile(fileName);
614 // Check if we have to save
615 strcpy(fileName, prj.topNode.path);
616 PathCatSlash(fileName, node.path);
617 PathCatSlash(fileName, node.name);
618 for(document = ide.firstChild; document; document = document.next)
620 if(document.modifiedDocument)
622 char documentFileName[MAX_LOCATION];
623 if(!fstrcmp(GetSlashPathBuffer(documentFileName, document.fileName), fileName))
624 if(!document.MenuFileSave(null, 0))
629 if(ProjectPrepareForToolchain(prj, normal, true, true))
633 buildInProgress = compilingFile;
634 ide.AdjustBuildMenus();
636 //ide.outputView.ShowClearSelectTab(build);
637 // this stuff doesn't even appear
638 //ide.outputView.buildBox.Logf("%s Compiler\n", compiler.name);
640 ide.outputView.buildBox.Logf("Compiling single file %s in project %s using the %s configuration...\n", node.name, prj.name, prj.config.name);
642 ide.outputView.buildBox.Logf("Compiling single file %s in project %s...\n", node.name, prj.name);
645 buildInProgress = none;
646 ide.AdjustBuildMenus();
649 ide.outputView.buildBox.Logf("File %s is excluded from current build configuration.\n", node.name);
655 void GoToError(const char * line)
659 while(isspace(*line)) line++;
660 colon = strstr(line, ":");
665 bool lookForLineNumber = true;
667 // deal with linking error
668 if(colon && colon[1] == ' ')
670 colon = strstr(colon + 1, ":");
671 if(colon && !colon[1])
673 colon = strstr(line, ":");
674 lookForLineNumber = false;
676 else if(colon && !isdigit(colon[1]))
679 colon = strstr(line, ":");
682 // Don't be mistaken by the drive letter colon
683 if(colon && (colon[1] == '/' || colon[1] == '\\'))
684 colon = strstr(colon + 1, ":");
685 if(colon && lookForLineNumber)
689 char * par = RSearchString(line, "(", colon - line, true, false);
690 if(par && strstr(par, ")"))
692 else if((colon+1)[0] == ' ')
694 // NOTE: This is the same thing as saying 'colon = line'
695 for( ; colon != line; colon--)
699 lineNumber = atoi(colon + 1);
701 comma = strchr(colon, ',');
705 comma = strchr(colon+1, ':');
711 char moduleName[MAX_LOCATION], filePath[MAX_LOCATION];
716 strncpy(moduleName, line, colon - line);
717 moduleName[colon - line] = '\0';
720 strcpy(moduleName, line);
722 // Remove stuff in brackets
724 bracket = strstr(moduleName, "(");
725 if(bracket) *bracket = '\0';
727 MakeSlashPath(moduleName);
731 // Check if it's one of our modules
732 ProjectNode node = project.topNode.Find(moduleName, false);
735 strcpy(moduleName, node.path);
736 PathCatSlash(moduleName, node.name);
739 moduleName[0] = '\0';
743 CodeEditor codeEditor;
744 strcpy(filePath, project.topNode.path);
745 PathCatSlash(filePath, moduleName);
747 codeEditor = (CodeEditor)ide.OpenFile(filePath, normal, true, null, no, normal);
750 char name[MAX_LOCATION];
751 // TOFIX: Improve on this, don't use only filename, make a function
752 if(ide && ide.workspace)
754 for(prj : ide.workspace.projects)
756 if(prj.topNode.FindWithPath(moduleName, false))
758 strcpy(filePath, prj.topNode.path);
759 PathCatSlash(filePath, moduleName);
760 codeEditor = (CodeEditor)ide.OpenFile(filePath, normal, true, null, no, normal);
767 if(codeEditor && lineNumber)
769 EditBox editBox = codeEditor.editBox;
770 editBox.GoToLineNum(lineNumber - 1);
771 editBox.GoToPosition(editBox.line, lineNumber - 1, col ? (col - 1) : 0);
778 bool OpenNode(ProjectNode node)
780 char filePath[MAX_LOCATION];
781 node.GetFullFilePath(filePath);
782 return ide.OpenFile(filePath, normal, true/*false Why was it opening hidden?*/, null, something, normal) ? true : false;
785 void AddNode(ProjectNode node, DataRow addTo)
787 DataRow row = addTo ? addTo.AddRow() : fileList.AddRow();
792 if(node.type == resources)
795 row.SetData(null, node);
797 if(node.files && node.files.first && node.parent &&
798 !(!node.parent.parent &&
799 (!strcmpi(node.name, "notes") || !strcmpi(node.name, "sources") ||
800 !strcmpi(node.name, "src") || !strcmpi(node.name, "tools"))))
801 row.collapsed = true;
802 else if(node.type == folder)
803 node.icon = openFolder;
807 for(child : node.files)
812 void DeleteNode(ProjectNode projectNode)
814 if(projectNode.files)
817 while(child = projectNode.files.first)
820 fileList.DeleteRow(projectNode.row);
821 projectNode.Delete();
827 for(c = 0; c < NodeIcons::enumSize; c++)
829 icons[c] = BitmapResource { iconNames[c], alphaBlend = true };
830 AddResource(icons[c]);
832 fileList.AddField(DataField { dataType = class(ProjectNode), freeData = false, userData = this });
838 ide.DestroyTemporaryProjectDir();
846 bool ProjectSave(MenuItem selection, Modifiers mods)
848 DataRow row = fileList.currentRow;
849 ProjectNode node = row ? (ProjectNode)row.tag : null;
850 Project prj = node ? node.project : null;
853 if(prj.Save(prj.filePath))
855 // ProjectUpdateMakefileForAllConfigs(prj, true, true);
856 prj.topNode.modified = false;
858 for(p : ide.workspace.projects)
860 if(p.topNode.modified)
867 modifiedDocument = false;
874 bool ShowOutputBuildLog(bool cleanLog)
876 OutputView output = ide.outputView;
878 output.ShowClearSelectTab(build);
881 output.SelectTab(build);
886 bool DisplayCompiler(bool cleanLog)
888 CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
889 LogBox logBox = ide.outputView.buildBox;
890 ShowOutputBuildLog(cleanLog);
891 logBox.Logf("%s Compiler\n", compiler ? compiler.name : "{problem with compiler selection}");
895 bool ProjectUpdateMakefileForAllConfigs(Project project, bool cleanLog, bool displayCompiler)
897 ProjectConfig currentConfig = project.config;
898 ShowOutputBuildLog(cleanLog);
901 DisplayCompiler(false);
903 for(config : project.configurations)
905 project.config = config;
906 ProjectPrepareMakefile(project, forceExists, false, false);
909 project.config = currentConfig;
914 bool ProjectPrepareForToolchain(Project project, PrepareMakefileMethod method, bool cleanLog, bool displayCompiler)
917 char message[MAX_F_STRING];
918 LogBox logBox = ide.outputView.buildBox;
920 ShowOutputBuildLog(cleanLog);
923 DisplayCompiler(false);
925 ProjectPrepareMakefile(project, method, false, false);
929 bool ProjectPrepareMakefile(Project project, PrepareMakefileMethod method, bool cleanLog, bool displayCompiler)
931 char makefilePath[MAX_LOCATION];
932 char makefileName[MAX_LOCATION];
934 LogBox logBox = ide.outputView.buildBox;
936 ShowOutputBuildLog(cleanLog);
939 DisplayCompiler(false);
941 strcpy(makefilePath, project.topNode.path);
942 project.CatMakeFileName(makefileName);
943 PathCatSlash(makefilePath, makefileName);
945 exists = FileExists(makefilePath);
946 if((method == normal && (!exists || project.config.makingModified/*|| project.topNode.modified*/)) ||
947 (method == forceExists && exists) ||
948 method == force) // || project.config.makingModified || makefileDirty
952 ide.statusBar.text = "Generating Makefile & Dependencies..."; // Dependencies?
955 if((method == normal && !exists) || (method == force && !exists))
956 action = "Generating ";
957 else if(method == force)
958 action = "Regenerating ";
959 else if(method == normal || method == forceExists)
960 action = "Updating ";
964 reason = "Makefile doesn't exist. ";
965 else if(project.topNode.modified)
966 reason = "Project has been modified. ";
970 //logBox.Logf("%s\n", makefileName);
971 logBox.Logf("%s - %s%smakefile for %s config...\n", makefileName, reason, action, project.configName);
972 project.GenerateMakefile(null, false, null);
974 ide.statusBar.text = null;
981 bool ProjectBuild(MenuItem selection, Modifiers mods)
983 Project prj = project;
984 if(selection || !ide.activeClient || activeClient == this)
986 DataRow row = fileList.currentRow;
987 ProjectNode node = row ? (ProjectNode)row.tag : null;
988 if(node) prj = node.project;
990 // Added this code here until dependencies work:
991 else //if(ide.activeClient)
993 ProjectNode node = GetNodeFromWindow(ide.activeClient, null);
997 if(/*prj != project || */!prj.configIsInDebugSession || !ide.DontTerminateDebugSession("Project Build"))
998 BuildInterrim(prj, build);
1002 bool BuildInterrim(Project prj, BuildType buildType)
1004 if(ProjectPrepareForToolchain(prj, normal, true, true))
1006 ide.outputView.buildBox.Logf("Building project %s using the %s configuration...\n", prj.name, prj.configName);
1007 return Build(prj, buildType);
1012 bool ProjectLink(MenuItem selection, Modifiers mods)
1014 Project prj = project;
1015 if(selection || !ide.activeClient || activeClient == this)
1017 DataRow row = fileList.currentRow;
1018 ProjectNode node = row ? (ProjectNode)row.tag : null;
1019 if(node) prj = node.project;
1021 // Added this code here until dependencies work:
1022 else //if(ide.activeClient)
1024 ProjectNode node = GetNodeFromWindow(ide.activeClient, null);
1028 if(ProjectPrepareForToolchain(prj, normal, true, true))
1030 ide.outputView.buildBox.Logf("Relinking project %s using the %s configuration...\n", prj.name, prj.configName);
1032 prj.config.linkingModified = true;
1038 bool ProjectRebuild(MenuItem selection, Modifiers mods)
1040 Project prj = GetSelectedProject((bool)selection);
1041 if(ProjectPrepareForToolchain(prj, normal, true, true))
1043 ide.outputView.buildBox.Logf("Rebuilding project %s using the %s configuration...\n", prj.name, prj.configName);
1046 prj.config.compilingModified = true;
1047 prj.config.makingModified = true;
1048 }*/ // -- should this still be used depite the new solution of BuildType?
1049 Build(prj, rebuild);
1054 bool ProjectClean(MenuItem selection, Modifiers mods)
1056 Project prj = GetSelectedProject((bool)selection);
1057 if(ProjectPrepareForToolchain(prj, normal, true, true))
1059 ide.outputView.buildBox.Logf("Cleaning project %s using the %s configuration...\n", prj.name, prj.configName);
1061 buildInProgress = prj == project ? buildingMainProject : buildingSecondaryProject;
1062 ide.AdjustBuildMenus();
1065 buildInProgress = none;
1066 ide.AdjustBuildMenus();
1071 bool ProjectRegenerate(MenuItem selection, Modifiers mods)
1073 Project prj = project;
1074 if(selection || !ide.activeClient || activeClient == this)
1076 DataRow row = fileList.currentRow;
1077 ProjectNode node = row ? (ProjectNode)row.tag : null;
1081 // Added this code here until dependencies work:
1082 else //if(ide.activeClient)
1084 ProjectNode node = GetNodeFromWindow(ide.activeClient, null);
1089 ProjectPrepareMakefile(prj, force, true, true);
1093 bool ProjectNewFile(MenuItem selection, Modifiers mods)
1095 DataRow row = fileList.currentRow;
1098 char fileName[1024];
1099 char filePath[MAX_LOCATION];
1100 ProjectNode parentNode = (ProjectNode)row.tag;
1101 ProjectNode n, fileNode;
1102 parentNode.GetFileSysMatchingPath(filePath);
1103 MakePathRelative(filePath, parentNode.project.topNode.path, filePath);
1104 for(n = parentNode; n && n != parentNode.project.resNode; n = n.parent);
1105 sprintf(fileName, "Untitled %d", documentID);
1106 fileNode = AddFile(parentNode, fileName, (bool)n, true);
1107 fileNode.path = CopyUnixPath(filePath);
1110 NodeProperties nodeProperties
1113 position = { position.x + 100, position.y + 100 };
1117 nodeProperties.Create(); // not modal?
1123 bool ProjectNewFolder(MenuItem selection, Modifiers mods)
1125 DataRow row = fileList.currentRow;
1128 ProjectNode parentNode = (ProjectNode)row.tag;
1129 NewFolder(parentNode, null, true);
1134 bool ResourcesAddFiles(MenuItem selection, Modifiers mods)
1140 bool ProjectAddFiles(MenuItem selection, Modifiers mods)
1146 bool ProjectImportFolder(MenuItem selection, Modifiers mods)
1148 DataRow row = fileList.currentRow;
1151 ProjectNode toNode = (ProjectNode)row.tag;
1152 ImportFolder(toNode);
1157 bool ProjectAddNewForm(MenuItem selection, Modifiers mods)
1159 CodeEditor codeEditor = CreateNew("Form", "form", "Window", null);
1160 codeEditor.EnsureUpToDate();
1164 bool ProjectAddNewGraph(MenuItem selection, Modifiers mods)
1166 CodeEditor codeEditor = CreateNew("Graph", "graph", "Block", null);
1168 codeEditor.EnsureUpToDate();
1172 bool ProjectRemove(MenuItem selection, Modifiers mods)
1174 DataRow row = fileList.currentRow;
1177 ProjectNode node = (ProjectNode)row.tag;
1178 if(node.type == project)
1179 RemoveSelectedNodes();
1184 bool MenuConfig(MenuItem selection, Modifiers mods)
1186 if(ProjectActiveConfig { parent = parent.parent, master = parent, project = project }.Modal() == ok)
1191 bool MenuCompiler(MenuItem selection, Modifiers mods)
1193 ActiveCompilerDialog compilerDialog
1195 parent = parent.parent, master = parent;
1196 ideSettings = ideSettings, workspaceActiveCompiler = ide.workspace.compiler;
1198 incref compilerDialog;
1199 if(compilerDialog.Modal() == ok && strcmp(compilerDialog.workspaceActiveCompiler, ide.workspace.compiler))
1201 ide.workspace.compiler = compilerDialog.workspaceActiveCompiler;
1202 for(prj : ide.workspace.projects)
1203 ide.projectView.ProjectUpdateMakefileForAllConfigs(prj, true, true);
1205 delete compilerDialog;
1209 bool MenuSettings(MenuItem selection, Modifiers mods)
1211 ProjectNode node = GetSelectedNode(true);
1212 Project prj = node ? node.project : project;
1213 projectSettingsDialog = ProjectSettings { parent = parent.parent, master = parent, project = prj, projectNode = node };
1214 projectSettingsDialog.Modal();
1221 bool FileProperties(MenuItem selection, Modifiers mods)
1223 DataRow row = fileList.currentRow;
1226 ProjectNode node = (ProjectNode)row.tag;
1227 NodeProperties { parent = parent, master = this, node = node,
1228 position = { position.x + 100, position.y + 100 } }.Create();
1233 bool FileOpenFile(MenuItem selection, Modifiers mods)
1235 OpenSelectedNodes();
1239 bool FileRemoveFile(MenuItem selection, Modifiers mods)
1241 RemoveSelectedNodes();
1245 bool FileCompile(MenuItem selection, Modifiers mods)
1247 DataRow row = fileList.currentRow;
1250 ProjectNode node = (ProjectNode)row.tag;
1256 /*bool IsProjectModified()
1260 for(document = master.firstChild; document; document = document.next)
1262 if(document.modifiedDocument)
1263 if(GetNodeFromWindow(document), project)
1270 bool Build(Project prj, BuildType buildType)
1276 for(document = master.firstChild; document; document = document.next)
1278 if(document.modifiedDocument)
1280 ProjectNode node = GetNodeFromWindow(document, prj);
1281 if(node && !document.MenuFileSave(null, 0))
1290 DirExpression targetDir = prj.targetDir;
1292 // TOFIX: DebugStop is being abused and backfiring on us.
1293 // It's supposed to be the 'Debug/Stop' item, not unloading executable or anything else
1295 // configIsInDebugSession seems to be used for two OPPOSITE things:
1296 // If we're debugging another config, we need to unload the executable!
1297 // In building, we want to stop if we're debugging the 'same' executable
1298 if(buildType != run) ///* && prj == project*/ && prj.configIsInDebugSession)
1300 if(buildType == start || buildType == restart)
1302 if(ide.debugger && ide.debugger.isPrepared)
1309 if(ide.project == prj && ide.debugger && ide.debugger.prjConfig == prj.config && ide.debugger.isPrepared)
1316 // TODO: Disabled until problems fixed... is it fixed?
1317 if(buildType == rebuild || (prj.config && prj.config.compilingModified))
1321 if(buildType == relink || (prj.config && prj.config.linkingModified))
1323 char target[MAX_LOCATION];
1325 strcpy(target, prj.topNode.path);
1326 PathCat(target, targetDir.dir);
1327 prj.CatTargetFileName(target);
1328 if(FileExists(target))
1331 if(prj.config && prj.config.symbolGenModified)
1333 DirExpression objDir = prj.objDir;
1334 char fileName[MAX_LOCATION];
1335 char moduleName[MAX_FILENAME];
1336 strcpy(fileName, prj.topNode.path);
1337 PathCatSlash(fileName, objDir.dir);
1338 strcpy(moduleName, prj.moduleName);
1339 strcat(moduleName, ".main.ec");
1340 PathCatSlash(fileName, moduleName);
1341 if(FileExists(fileName))
1342 DeleteFile(fileName);
1343 ChangeExtension(fileName, "c", fileName);
1344 if(FileExists(fileName))
1345 DeleteFile(fileName);
1346 ChangeExtension(fileName, "o", fileName);
1347 if(FileExists(fileName))
1348 DeleteFile(fileName);
1353 buildInProgress = prj == project ? buildingMainProject : buildingSecondaryProject;
1354 ide.AdjustBuildMenus();
1355 ide.AdjustDebugMenus();
1357 result = prj.Build(buildType == run, null);
1361 prj.config.compilingModified = false;
1362 if(!ide.ShouldStopBuild())
1363 prj.config.linkingModified = false;
1365 prj.config.symbolGenModified = false;
1367 buildInProgress = none;
1368 ide.AdjustBuildMenus();
1369 ide.AdjustDebugMenus();
1371 ide.workspace.modified = true;
1378 Project GetSelectedProject(bool useSelection)
1380 Project prj = project;
1383 DataRow row = fileList.currentRow;
1384 ProjectNode node = row ? (ProjectNode)row.tag : null;
1391 ProjectNode GetSelectedNode(bool useSelection)
1393 ProjectNode node = null;
1396 DataRow row = fileList.currentRow;
1398 node = (ProjectNode)row.tag;
1403 bool MenuBrowseFolder(MenuItem selection, Modifiers mods)
1405 char folder[MAX_LOCATION];
1407 ProjectNode node = GetSelectedNode(true);
1409 node = project.topNode;
1412 strcpy(folder, prj.topNode.path);
1413 if(node != prj.topNode)
1414 PathCatSlash(folder, node.path);
1418 bool Run(MenuItem selection, Modifiers mods)
1420 char args[MAX_LOCATION * 64];
1422 if(ide.workspace.commandLineArgs)
1423 //ide.debugger.GetCommandLineArgs(args);
1424 strcpy(args, ide.workspace.commandLineArgs);
1425 if(ide.debugger.isActive)
1427 /*else if(project.config.targetType == sharedLibrary || project.config.targetType == staticLibrary)
1428 MessageBox { master = ide, type = ok, text = "Run", contents = "Shared and static libraries cannot be run like executables." }.Modal();*/
1429 else if(BuildInterrim(project, run))
1436 bool result = false;
1437 if(project.targetType == sharedLibrary || project.targetType == staticLibrary)
1438 MessageBox { master = ide, type = ok, text = "Run", contents = "Shared and static libraries cannot be run like executables." }.Modal();
1439 else if(project.compress)
1440 MessageBox { master = ide, text = "Starting Debug", contents = "Debugging compressed applications is not supported\n" }.Modal();
1441 else if(project.debug ||
1442 MessageBox { master = ide, type = okCancel, text = "Starting Debug", contents = "Attempting to debug non-debug configuration\nProceed anyways?" }.Modal() == ok)
1444 if(/*!IsProjectModified() ||*/ BuildInterrim(project, start))
1446 CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
1447 if(compiler.type.isVC)
1449 //bool result = false;
1450 char oldwd[MAX_LOCATION];
1451 char oldPath[MAX_LOCATION * 65];
1452 char command[MAX_LOCATION];
1454 GetEnvironment("PATH", oldPath, sizeof(oldPath));
1455 ide.SetPath(false); //true
1457 GetWorkingDir(oldwd, sizeof(oldwd));
1458 ChangeWorkingDir(project.topNode.path);
1460 sprintf(command, "%s /useenv %s.sln /projectconfig \"%s|Win32\" /command \"%s\"" , "devenv", project.name, project.config.name, "Debug.Start");
1461 //ide.outputView.buildBox.Logf("command: %s\n", command);
1463 ChangeWorkingDir(oldwd);
1464 SetEnvironment("PATH", oldPath);
1468 ide.debugger.Start();
1480 if(/*!IsProjectModified() ||*/ BuildInterrim(project, restart))
1482 ide.debugger.Restart();
1490 ide.debugger.Resume();
1496 ide.debugger.Break();
1502 ide.debugger.Stop();
1506 bool DebugStepInto()
1508 if((ide.debugger.isActive) || (!buildInProgress && BuildInterrim(project, start)))
1509 ide.debugger.StepInto();
1513 bool DebugStepOver(bool skip)
1515 if((ide.debugger.isActive) || (!buildInProgress && BuildInterrim(project, start)))
1516 ide.debugger.StepOver(skip);
1520 bool DebugStepOut(bool skip)
1522 ide.debugger.StepOut(skip);
1526 void ImportFolder(ProjectNode toNode)
1530 //bool isFolder = toNode.type == folder;
1531 //bool isRes = toNode.isInResources;
1533 FileDialog fileDialog = importFileDialog;
1534 fileDialog.master = parent;
1535 if(fileDialog.Modal() == ok)
1537 ImportFolderFSI fsi { projectView = this };
1538 fsi.stack.Add(toNode);
1539 fsi.Iterate(fileDialog.filePath);
1545 ProjectNode NewFolder(ProjectNode parentNode, char * name, bool showProperties)
1549 ProjectNode folderNode;
1550 Project prj = parentNode.project;
1552 ProjectNode after = null;
1553 for(node : parentNode.files)
1555 if(node.type != folder)
1561 folderNode = parentNode.Add(prj, name, after, folder, folder, true);
1564 for(c = 0; c < 100; c++)
1567 sprintf(string, c ? "New Folder (%d)" : "New Folder", c);
1568 if((folderNode = parentNode.Add(prj, string, after, folder, folder, true)))
1575 NodeProperties nodeProperties;
1578 modifiedDocument = true;
1579 prj.topNode.modified = true;
1582 folderNode.row = parentNode.row.AddRowAfter(after ? after.row : null);
1583 folderNode.row.tag = (int)folderNode;
1585 folderNode.row.SetData(null, folderNode);
1586 fileList.currentRow = folderNode.row;
1590 nodeProperties = NodeProperties
1592 parent, this, mode = newFolder, node = folderNode;
1593 position = { position.x + 100, position.y + 100 };
1595 nodeProperties.Create(); // Modal?
1603 void AddFiles(bool resources)
1605 FileDialog fileDialog = (!resources) ? this.fileDialog : resourceFileDialog;
1606 fileDialog.type = multiOpen;
1607 fileDialog.text = !resources ? "Add Files to Project" : "Add Resources to Project";
1608 fileDialog.master = parent;
1610 if(fileDialog.Modal() == ok)
1613 DataRow row = fileList.currentRow;
1614 ProjectNode parentNode = (ProjectNode)row.tag;
1615 bool addFailed = false;
1616 int numSelections = fileDialog.numSelections;
1617 char ** multiFilePaths = fileDialog.multiFilePaths;
1619 Array<String> nameConflictFiles { };
1621 for(c = 0; c < numSelections; c++)
1623 char * filePath = multiFilePaths[c];
1624 FileAttribs exists = FileExists(filePath);
1625 bool addThisFile = true;
1627 if(exists.isDirectory)
1628 addThisFile = false;
1631 if(MessageBox { master = ide, type = yesNo, text = filePath,
1632 contents = "File doesn't exist. Create?" }.Modal() == yes)
1634 File f = FileOpen(filePath, write);
1642 MessageBox { master = ide, type = ok, text = filePath,
1643 contents = "Couldn't create file."}.Modal();
1644 addThisFile = false;
1651 /*addFailed = */if(!AddFile(parentNode, filePath, resources, false))//;
1653 nameConflictFiles.Add(CopyString(filePath));
1661 char * part1 = "The following file";
1662 char * opt1 = " was ";
1663 char * opt2 = "s were ";
1664 char * part2 = "not added because of identical file name conflict within the project.\n\n";
1666 len += strlen(part1);
1667 len += strlen(part2);
1668 len += nameConflictFiles.count > 1 ? strlen(opt2) : strlen(opt1);
1669 for(s : nameConflictFiles)
1670 len += strlen(s) + 1;
1671 message = new char[len + 1];
1672 strcpy(message, part1);
1673 strcat(message, nameConflictFiles.count > 1 ? opt2 : opt1);
1674 strcat(message, part2);
1675 for(s : nameConflictFiles)
1678 strcat(message, "\n");
1680 MessageBox { master = ide, type = ok, text = "Name Conflict",
1681 contents = message }.Modal();
1684 nameConflictFiles.Free();
1685 delete nameConflictFiles;
1689 ProjectNode AddFile(ProjectNode parentNode, char * filePath, bool resources, bool isTemporary)
1691 ProjectNode result = null;
1692 ProjectNode after = null;
1693 for(node : parentNode.files)
1695 if(node.type != folder && node.type != file && node.type)
1700 result = parentNode.Add(parentNode.project, filePath, after, file, NodeIcons::SelectFileIcon(filePath), !resources);
1706 modifiedDocument = true;
1707 parentNode.project.topNode.modified = true;
1708 parentNode.project.ModifiedAllConfigs(true, false, true, true);
1711 result.row = parentNode.row.AddRowAfter(after ? after.row : null);
1712 result.row.tag = (int)result;
1713 result.row.SetData(null, result);
1718 CodeEditor CreateNew(char * upper, char * lower, char * base, char * className)
1720 CodeEditor codeEditor = null;
1721 ProjectNode projectNode;
1722 ProjectNode after = null;
1723 DataRow row = fileList.currentRow;
1724 ProjectNode parentNode;
1727 if(!row) row = project.topNode.row;
1729 parentNode = (ProjectNode)row.tag;
1731 for(node : parentNode.files)
1733 if(node.type != folder && node.type != file && node.type)
1737 for(c = 1; c < 100; c++)
1740 sprintf(string, c ? "%s%d.ec" : "%s.ec", lower, c);
1741 if((projectNode = parentNode.Add(project, string, after, file, genFile, true)))
1747 char filePath[MAX_LOCATION];
1749 modifiedDocument = true;
1750 project.topNode.modified = true;
1752 project.ModifiedAllConfigs(true, false, false, true);
1753 projectNode.row = parentNode.row.AddRowAfter(after ? after.row : null);
1754 projectNode.row.tag =(int)projectNode;
1756 projectNode.row.SetData(null, projectNode);
1757 fileList.currentRow = projectNode.row;
1759 strcpy(filePath, project.topNode.path);
1760 PathCat(filePath, projectNode.path);
1761 PathCat(filePath, projectNode.name);
1763 codeEditor = (CodeEditor)ide.FindWindow(filePath);
1766 Class baseClass = eSystem_FindClass(__thisModule, base);
1767 subclass(ClassDesignerBase) designerClass = eClass_GetDesigner(baseClass);
1770 codeEditor = (CodeEditor)ide.OpenFile(filePath, normal, false, null, whatever, normal);
1771 strcpy(name, projectNode.name);
1772 sprintf(name, "%s%d", upper, c);
1774 strcpy(className, name);
1776 designerClass.CreateNew(codeEditor.editBox, codeEditor.clientSize, name, base);
1778 //codeEditor.modifiedDocument = false;
1779 //codeEditor.designer.modifiedDocument = false;
1781 //Code_EnsureUpToDate(codeEditor);
1784 else // TODO: fix no symbols generated when ommiting {} for following else
1786 codeEditor = (CodeEditor)ide.OpenFile(filePath, normal, false, null, whatever, normal);
1790 codeEditor.ViewDesigner();
1791 codeEditor.codeModified = true;
1798 void OpenSelectedNodes()
1803 fileList.GetMultiSelection(selection);
1804 for(item = selection.first; item; item = item.next)
1806 DataRow row = item.data;
1807 ProjectNode node = (ProjectNode)row.tag;
1808 if(node.type == file)
1811 selection.Free(null);
1814 void RemoveSelectedNodes()
1819 fileList.GetMultiSelection(selection);
1821 // Remove children of parents we're deleting
1822 for(item = selection.first; item; item = next)
1825 DataRow row = item.data;
1826 ProjectNode n, node = (ProjectNode)row.tag;
1827 bool remove = false;
1830 for(i = selection.first; i && !remove; i = i.next)
1832 ProjectNode iNode = (ProjectNode)((DataRow)i.data).tag;
1833 for(n = node.parent; n; n = n.parent)
1843 selection.Delete(item);
1846 for(item = selection.first; item; item = item.next)
1848 DataRow row = item.data;
1849 ProjectNode node = (ProjectNode)row.tag;
1850 ProjectNode resNode;
1851 for(resNode = node.parent; resNode; resNode = resNode.parent)
1852 if(resNode.type == resources)
1854 if(node.type == file)
1856 Project prj = node.project;
1858 modifiedDocument = true;
1859 prj.topNode.modified = true;
1861 prj.ModifiedAllConfigs(true, false, true, true);
1863 else if(node.type == folder)
1866 sprintf(message, "Are you sure you want to remove the folder \"%s\"\n"
1867 "and all of its contents from the project?", node.name);
1868 if(MessageBox { master = ide, type = yesNo, text = "Delete Folder", contents = message }.Modal() == yes)
1870 Project prj = node.project;
1871 if(node.containsFile)
1872 prj.ModifiedAllConfigs(true, false, true, true);
1874 modifiedDocument = true;
1875 prj.topNode.modified = true;
1878 else if(node.type == project && node != project.topNode && !buildInProgress)
1882 for(p : workspace.projects)
1884 if(p.topNode == node)
1890 sprintf(message, "Are you sure you want to remove the \"%s\" project\n" "from this workspace?", node.name);
1891 if(MessageBox { master = ide, type = yesNo, text = "Remove Project", contents = message }.Modal() == yes)
1896 workspace.RemoveProject(prj);
1897 //modifiedDocument = true; // when project view is a workspace view
1901 selection.Free(null);