import "FileSystemIterator"
+class ImportFolderProjectsFSI : NormalFileSystemIterator
+{
+ bool noParsing;
+ char selfProjectPath[MAX_LOCATION];
+ extensions = ProjectExtension;
+ bool OnFile(const char * filePath)
+ {
+ if(fstrcmp(filePath, selfProjectPath))
+ ide.OpenFile(filePath, false, true, ProjectExtension, no, add, noParsing);
+ return true;
+ }
+}
+
AVLTree<const String> binaryDocExt
{ [
"wav", "mp3", "flac", "ogg",
{ $"All files", null }
] };
+FileDialog importFolderProjectsDialog { autoCreate = false, type = selectDir, text = $"Import Folder Projects" };
FileDialog ideFileDialog
{
type = multiOpen, text = $"Open";
return true;
}
};
+ MenuItem projectImportAddItem
+ {
+ projectMenu, $"Import projects into workspace...", a, Key { a, true, true };
+ disabled = true;
+ bool NotifySelect(MenuItem selection, Modifiers mods)
+ {
+ char path[MAX_LOCATION];
+ FileDialog fileDialog = importFolderProjectsDialog;
+ fileDialog.master = parent;
+ path[0] = '\0';
+ StripLastDirectory(path, ide.workspace.workspaceDir);
+ MakeSystemPath(path);
+ fileDialog.currentDirectory = path;
+ fileDialog.filePath = path;
+ if(fileDialog.Modal() == ok)
+ {
+ ImportFolderProjectsFSI fsi { noParsing = mods.ctrl && mods.shift };
+ ide.project.topNode.GetFullFilePath(fsi.selfProjectPath);
+ MakeSystemPath(fsi.selfProjectPath);
+ PrintLn("self: ", fsi.selfProjectPath);
+ fsi.Iterate(fileDialog.filePath);
+ delete fsi;
+ }
+ return true;
+ }
+ };
MenuItem projectCloseItem
{
projectMenu, $"Close", c, disabled = true;
bool unavailable = !project;
projectAddItem.disabled = unavailable;
+ projectImportAddItem.disabled = unavailable;
toolBar.buttonAddProject.disabled = unavailable;
projectSettingsItem.disabled = unavailable;