void WorkspaceWork::NewPackageFile() { NewPackageFileWindow dlg; dlg.folder = GetFileFolder(GetActivePackagePath()); dlg.Open(); dlg.name.SetFocus(); dlg.name.SetSelection(0, 0); for(;;) { if(dlg.Run() != IDOK) return; String e = dlg.GetError(); if(e.GetCount() == 0) break; Exclamation(e); } AddItem(~dlg.name, false, false); }
void WorkspaceWork::DeletePackage() { String active = GetActivePackage(); if(package.GetCursor() == 0) { Exclamation("Cannot delete the main package!"); return; } if(IsAux() || !package.IsCursor() || !PromptYesNo("Do you really want to delete package [* \1" + active + "\1]?&&" "[/ Warning:] [* Package will only be removed&" "from packages of current workspace!]")) return; if(!PromptYesNo("This operation is irreversible.&Do you really want to proceed?")) return; if(!DeleteFolderDeep(GetFileFolder(GetActivePackagePath()))) { Exclamation("Deleting directory has failed."); return; } PackageOp(active, Null, Null); }
void WorkspaceWork::OpenPackageFolder() { ShellOpenFolder(GetFileDirectory(GetActivePackagePath())); }