Example #1
0
void EnabledModuleList::addModule (const File& moduleManifestFile, bool copyLocally)
{
    ModuleDescription info (moduleManifestFile);

    if (info.isValid())
    {
        const String moduleID (info.getID());

        if (! isModuleEnabled (moduleID))
        {
            ValueTree module (Ids::MODULES);
            module.setProperty (Ids::ID, moduleID, nullptr);

            state.addChild (module, -1, getUndoManager());
            sortAlphabetically();

            shouldShowAllModuleFilesInProject (moduleID) = true;
            shouldCopyModuleFilesLocally (moduleID) = copyLocally;

            RelativePath path (moduleManifestFile.getParentDirectory().getParentDirectory(),
                               project.getProjectFolder(), RelativePath::projectFolder);

            for (Project::ExporterIterator exporter (project); exporter.next();)
                exporter->getPathForModuleValue (moduleID) = path.toUnixStyle();
        }
    }
}
Example #2
0
void Project::addModule (const String& moduleID, bool shouldCopyFilesLocally)
{
    if (! isModuleEnabled (moduleID))
    {
        ValueTree module (Tags::module);
        module.setProperty (Ids::ID, moduleID, nullptr);

        ValueTree modules (getModulesNode());
        modules.addChild (module, -1, getUndoManagerFor (modules));

        shouldShowAllModuleFilesInProject (moduleID) = true;
    }

    if (shouldCopyFilesLocally)
        shouldCopyModuleFilesLocally (moduleID) = true;
}