//----------------------------------------------------------------------------- void GeneralPropertyGrid::RefreshOnProject () { Clear(); Project *proj = Project::GetSingletonPtr(); if (!proj) return; mProjName = proj->GetName(); mProjWidth = proj->GetWidth(); mProjHeight = proj->GetHeight(); Float4 color = proj->GetColor(); mProjColor = Float3(color[0], color[1], color[2]); mIsShowProjectInfo = proj->IsShowProjectInfo(); PropertyPage *page = AddPropertyPage("General"); page->AddProperty(PX2_LM.GetValue("Project"), Property::PT_CATEGORY, 0); page->AddProperty(PX2_LM.GetValue("Name"), Property::PT_STRING, &mProjName, false); page->AddProperty(PX2_LM.GetValue("Width"), Property::PT_INT, &mProjWidth, false); page->AddProperty(PX2_LM.GetValue("Height"), Property::PT_INT, &mProjHeight, false); page->AddProperty(PX2_LM.GetValue("BackColor"), Property::PT_COLOR3FLOAT3, &mProjColor); page->AddProperty(PX2_LM.GetValue("Show"), Property::PT_CATEGORY, 0); page->AddProperty(PX2_LM.GetValue("IsShowProjectInfo"), Property::PT_BOOLCHECK, &mIsShowProjectInfo); }
void setMissingProjectProperties (Project& project) const { const String sanitisedProjectName (CodeHelpers::makeValidIdentifier (project.getTitle(), false, true, false)); setValueIfVoid (shouldBuildVST (project), true); setValueIfVoid (shouldBuildAU (project), true); setValueIfVoid (getPluginName (project), project.getTitle()); setValueIfVoid (getPluginDesc (project), project.getTitle()); setValueIfVoid (getPluginManufacturer (project), "yourcompany"); setValueIfVoid (getPluginManufacturerCode (project), "Manu"); setValueIfVoid (getPluginCode (project), "Plug"); setValueIfVoid (getPluginChannelConfigs (project), "{1, 1}, {2, 2}"); setValueIfVoid (getPluginIsSynth (project), false); setValueIfVoid (getPluginWantsMidiInput (project), false); setValueIfVoid (getPluginProducesMidiOut (project), false); setValueIfVoid (getPluginSilenceInProducesSilenceOut (project), false); setValueIfVoid (getPluginTailLengthSeconds (project), 0); setValueIfVoid (getPluginEditorNeedsKeyFocus (project), false); setValueIfVoid (getPluginAUExportPrefix (project), sanitisedProjectName + "AU"); setValueIfVoid (getPluginAUCocoaViewClassName (project), sanitisedProjectName + "AU_V1"); setValueIfVoid (getPluginRTASCategory (project), String::empty); setValueIfVoid (project.getBundleIdentifier(), project.getDefaultBundleIdentifier()); setValueIfVoid (project.getAAXIdentifier(), project.getDefaultAAXIdentifier()); setValueIfVoid (getPluginAAXCategory (project), "AAX_ePlugInCategory_Dynamics"); }
void ProjectDialog::slotNext() { QWidget * vw = mStack->currentWidget(); if( vw == mPageOne ) { Project p = project(); if( !p.isRecord() ){ if( p.name().isEmpty() ){ ResinError::nameEmpty( this, "Project Name" ); return; } if( Project::recordByName( p.name() ).isRecord() ){ ResinError::nameTaken( this, p.name() ); return; } if( p.shortName().isEmpty() ){ ResinError::nameEmpty( this, "Abbreviation" ); return; } } mStack->setCurrentWidget( mPageTwo ); mPrevButton->show(); mOKButton->show(); mNextButton->hide(); } else LOG_5( "ProjectDialog::slotNext(), error - should be mPageOne or mPageTwo" ); }
static Array<File> getAllPossibleModulePaths (Project& project) { StringArray paths; for (Project::ExporterIterator exporter (project); exporter.next();) { if (exporter->mayCompileOnCurrentOS()) { for (int i = 0; i < project.getModules().getNumModules(); ++i) { const String path (exporter->getPathForModuleString (project.getModules().getModuleID (i))); if (path.isNotEmpty()) paths.addIfNotAlreadyThere (path); } String oldPath (exporter->getLegacyModulePath()); if (oldPath.isNotEmpty()) paths.addIfNotAlreadyThere (oldPath); } } Array<File> files; for (int i = 0; i < paths.size(); ++i) { const File f (project.resolveFilename (paths[i])); if (f.isDirectory()) { files.add (f); if (f.getChildFile ("modules").isDirectory()) files.addIfNotAlreadyThere (f.getChildFile ("modules")); } } return files; }
int DBimpl::createProject(Project& project){ QSqlQuery query; query.prepare(DatabaseQueries::insertProject); query.bindValue(":projectName",project.getTitle()); query.bindValue(":description",project.getDescription()); query.bindValue(":minTeamSize",project.getMinTeamSize()); query.bindValue(":maxTeamSize",project.getMaxTeamSize()); query.bindValue(":results",0); if(!query.exec()) { qDebug() << query.lastError(); qDebug() << query.lastQuery(); return 0; } else { int lastID = query.lastInsertId().toInt(); QList<Student*> students = project.getRegisteredStudents(); addStudentsToProject(lastID,&students); project.setID(lastID); return lastID; } }
void BuildWindows::Initialize() { ToolSystem* tsystem = GetSubsystem<ToolSystem>(); Project* project = tsystem->GetProject(); Vector<String> defaultResourcePaths; GetDefaultResourcePaths(defaultResourcePaths); String projectResources = project->GetResourcePath(); for (unsigned i = 0; i < defaultResourcePaths.Size(); i++) { AddResourceDir(defaultResourcePaths[i]); } // TODO: smart filtering of cache AddResourceDir(project->GetProjectPath() + "Cache/"); AddResourceDir(projectResources); BuildResourceEntries(); }
// This constructor is called for existing (recorded/imported) audio sources ReadSource::ReadSource(const QDomNode node) : AudioSource() { set_state(node); private_init(); Project* project = pm().get_project(); // FIXME The check below no longer makes sense!!!!! // Check if the audiofile exists in our project audiosources dir // and give it priority over the dir as given by the project.tpf file // This makes it possible to move project directories without Traverso being // unable to find it's audiosources! if ( QFile::exists(project->get_root_dir() + "/audiosources/" + m_name) || QFile::exists(project->get_root_dir() + "/audiosources/" + m_name + "-ch0.wav") ) { set_dir(project->get_root_dir() + "/audiosources/"); } m_silent = (m_channelCount == 0); }
void BuildWindows::Initialize() { ToolSystem* tsystem = GetSubsystem<ToolSystem>(); Project* project = tsystem->GetProject(); Vector<String> defaultResourcePaths; GetDefaultResourcePaths(defaultResourcePaths); for (unsigned i = 0; i < defaultResourcePaths.Size(); i++) { AddResourceDir(defaultResourcePaths[i]); } BuildDefaultResourceEntries(); // Include the project resources and cache separately AddProjectResourceDir(project->GetResourcePath()); AssetDatabase* db = GetSubsystem<AssetDatabase>(); String cachePath = db->GetCachePath(); AddProjectResourceDir(cachePath); BuildProjectResourceEntries(); }
int DBimpl::updateProject(const Project& project) { QSqlQuery query; query.prepare(DatabaseQueries::updateProject); query.bindValue(":projectName",project.getTitle()); query.bindValue(":description",project.getDescription()); query.bindValue(":minTeamSize",project.getMinTeamSize()); query.bindValue(":maxTeamSize",project.getMaxTeamSize()); query.bindValue(":projectID", project.getID()); if(!query.exec()) { qDebug() << query.lastError(); qDebug() << query.lastQuery(); return 0; } else { return 1; } }
bool LocalTypeAnalysisPass::execute(UserProc *proc) { // Now we need to add the implicit assignments. Doing this earlier // is extremely problematic, because of all the m[...] that change // their sorting order as their arguments get subscripted or propagated into. // Do this regardless of whether doing dfa-based TA, so things // like finding parameters can rely on implicit assigns. PassManager::get()->executePass(PassID::ImplicitPlacement, proc); Project *project = proc->getProg()->getProject(); ITypeRecovery *rec = project->getTypeRecoveryEngine(); // Data flow based type analysis // Want to be after all propagation, but before converting expressions to locals etc if (rec && project->getSettings()->useTypeAnalysis) { rec->recoverFunctionTypes(proc); return true; } else { return false; } }
static void getDependencies (Project& project, const String& moduleID, StringArray& dependencies) { ModuleDescription info (project.getModules().getModuleInfo (moduleID)); for (auto uid : info.getDependencies()) { if (! dependencies.contains (uid, true)) { dependencies.add (uid); getDependencies (project, uid, dependencies); } } }
void Linker :: run(Project& project, Image& image, ref_t tls_directory) { ImageInfo info(&project, &image); info.entryPoint = image.getEntryPoint(); if (_mode64bit) { createImportTable64(info); } else createImportTable(info); mapImage(info); fixImage(info); Path path(project.StrSetting(opTarget)); if (emptystr(path)) throw InternalError(errEmptyTarget); if (!createExecutable(info, path.c_str(), tls_directory)) project.raiseError(errCannotCreate, project.StrSetting(opTarget)); }
bool ResourceOps::CheckCreateScript(const String& resourcePath, const String& resourceName, bool reportError) { Editor* editor = GetSubsystem<Editor>(); Project* project = editor->GetProject(); String fullpath = resourcePath + resourceName; if (!resourceName.EndsWith(".js")) fullpath += ".js"; FileSystem* fs = GetSubsystem<FileSystem>(); if (fs->FileExists(fullpath)) { if (reportError) { String errorMsg; errorMsg.AppendWithFormat("The script:\n\n%s\n\nalready exists", fullpath.CString()); editor->PostModalError("Create Script Error", errorMsg); } return false; } if (!project->IsScriptsDirOrFile(resourcePath)) { if (reportError) { String errorMsg; errorMsg.AppendWithFormat("Scripts must reside in or in a subfolder of the Scripts folder"); editor->PostModalError("Create Script Error", errorMsg); } return false; } return true; }
Project* Project::CreateNewProject(const QString& projectFilePath) { QString file = projectFilePath; if(!projectFilePath.endsWith(N_PROJECT_FILE_EXTENSION)) { file.append(N_PROJECT_FILE_EXTENSION); } Project* result = DocumentInstance::CreateDocumentInstance<Project>(file); K_ASSERT( result ) // Project layout is created here. QDir projectRoot = result->fileInfo().dir(); if(!QFileInfo(projectRoot.path()).isWritable()) { Kore::KoreEngine::Error( tr("Could not create project !"), tr("Project folder %s is not writable !").arg(projectRoot.path()) ); result->destroy(); return K_NULL; } // Create the resources folder. projectRoot.mkdir(N_PROJECT_RESOURCES_FOLDER); // Create the scenes folder. projectRoot.mkdir(N_PROJECT_SCENES_FOLDER); // Create the models folder. projectRoot.mkdir(N_PROJECT_MODELS_FOLDER); // TODO: Add default Project stuff (default scene, default model, default everything...) return result; }
void BuildIOS::Initialize() { Editor* editor = GetSubsystem<Editor>(); Project* project = editor->GetProject(); FileSystem* fileSystem = GetSubsystem<FileSystem>(); #ifdef ATOMIC_PLATFORM_WINDOWS String bundleResources = fileSystem->GetProgramDir(); #else String bundleResources = fileSystem->GetAppBundleResourceFolder(); #endif String projectResources = project->GetResourcePath(); String coreDataFolder = bundleResources + "CoreData/"; AddResourceDir(coreDataFolder); AddResourceDir(projectResources); BuildResourceEntries(); }
/// Undo adding a transition. void UndoBuffer::undoAddTransition(Undo* u) { Project* p; p = u->getProject(); GTransition* t; GState *from, *to; t = u->getTransition(); from = (GState*)t->getStart(); to = (GState*)t->getEnd(); p->getMain()->getScrollView()->getDrawArea()->getSelection()->select(t, FALSE); // if (t->isSelected()) // t->select(FALSE); if (to) to->reflist.remove(t); if (from) from->tlist.remove(t); }
void CleanExecutor::execute() { using namespace ProjectExplorer; ProjectExplorerPlugin *projectExplorerPlugin = ProjectExplorerPlugin::instance(); Project *project = projectExplorerPlugin->startupProject(); ProjectNode *rootProjectNode = project->rootProjectNode(); const QString &activeRunConfigurationDir = getRunConfigurationPath(rootProjectNode, project->activeTarget()->activeRunConfiguration()); const QString &buildDir = activeRunConfigurationDir.mid(0, activeRunConfigurationDir.lastIndexOf('/')); const QString &objectFilesDir = getObjectFilesDir(buildDir); const QString program = "lcov"; const QStringList arguments = { "-z", "-d", objectFilesDir }; process->start(program, arguments); }
DNASequenceGeneratorTask::DNASequenceGeneratorTask(const DNASequenceGeneratorConfig& cfg) : Task(tr("Generate sequence task"), TaskFlag_NoRun), cfg(cfg), loadRefTask(NULL), evalTask(NULL), generateTask(NULL), saveTask(NULL) { GCOUNTER( cvar, tvar, "DNASequenceGeneratorTask" ); if (cfg.useReference()) { // do not load reference file if it is already in project and has loaded state const QString& docUrl = cfg.getReferenceUrl(); Project* prj = AppContext::getProject(); if (prj) { Document* doc = prj->findDocumentByURL(docUrl); if (doc && doc->isLoaded()) { QString err; evalTask = createEvaluationTask(doc, err); if (evalTask) { addSubTask(evalTask); } else { stateInfo.setError(err); } return; } } loadRefTask = LoadDocumentTask::getDefaultLoadDocTask(GUrl(docUrl)); if (loadRefTask) { addSubTask(loadRefTask); } else { stateInfo.setError(tr("Incorrect reference file")); return; } } else { generateTask = new GenerateDNASequenceTask(cfg.getContent(), cfg.getLength(), cfg.window, cfg.getNumberOfSequences(), cfg.seed); addSubTask(generateTask); } }
int Shader::ConfirmSave() { Project* project = Project::GetProject(); bool modified = false; if (project != 0) { int count = (int)project->GetPageCount(); for (int index = 0; index < count; index++) { Panel* panel = (Panel *)project->GetPage(index); modified = modified || panel->GetUndoerCtrl()->IsDirty(); } } if (modified) { wxString message = wxT("Save changes to "); if (m_FileName.IsEmpty()) { message.Append(wxT("(untitled)")); } else { message.Append(m_FileName); } message.Append('?'); wxMessageDialog dialog(this, message, wxT("Confirm"), wxYES_NO | wxCANCEL); int choice = dialog.ShowModal(); if (choice == wxID_YES) { return Save(); } return choice; } return wxID_YES; }
vector<BaseRecord *> Project::RetrieveTableRecords(string where, string limit) const { vector<BaseRecord *> projects; BaseRecord* baseRecord; MYSQL_RES* res; MYSQL_ROW row; Project* project; string sql; sql = "SELECT `id`, `name`, `description`, `team`, `timming_plan`, `status`, `created_at`, `expired_at`, `deadline`, `priority` FROM `" + this->table + "` " + where + " " + limit; try { res = this->connector->Query(sql, SELECT); } catch(MySQLRecordNotFound* rnf) { std::cout << rnf->what() << std::endl; exit(ERROR_MYSQL_QUERY); } while(row = mysql_fetch_row(res)) { project = new Project(this->connector); project->id = atoi(row[0]); project->Name(row[1]); project->Description(row[2]); project->SetTeam(new Team(this->connector, atoi(row[3]))); project->TimmingPlan(atof(row[4])); project->SetStatus(new Status(this->connector, atoi(row[5]))); project->CreatedAt(new DateTime(atoi(row[6]))); project->ExpiredAt(new DateTime(atoi(row[7]))); project->Deadline(new DateTime(atoi(row[8]))); project->Priority(atoi(row[9])); baseRecord = project; projects.push_back(baseRecord); } return projects; }
void MainWindow::on_ui_removeFile_clicked() { foreach(const QModelIndex& index, ui_projects->selectionModel()->selectedRows()) { const int type = m_projectsModel.indexType(index); Project* project = m_projectsModel.indexToProject(index); if(type == ProjectsModel::FileType) { const TinyNode* node = m_projectsModel.indexToNode(index); QMessageBox::StandardButton ret = QMessageBox::question(this, tr("Are You Sure?"), tr("Permanently delete ") + QTinyNode::name(node) + "?", QMessageBox::Yes | QMessageBox::No, QMessageBox::No); if(ret == QMessageBox::No) continue; qWarning() << "Node path" << QString::fromStdString(node->path()); closeNode(node); project->archive()->TinyArchive::remove(node->path()); project->sync(); } else if(type == ProjectsModel::ProjectType) { project->sync(); ProjectManager::ref().closeProject(project); } } // ui_projects->expandAll(); }
void Component::traversalProject(Project& p) { BON::Folder folder = p->getRootFolder(); std::set<BON::Model> models = folder->getChildModels(); for(auto it=models.begin(); it!=models.end(); it++) { GarbledCircuit_BON::Library l(*it); std::set<GarbledCircuit_BON::GarbledCircuit> gc = l->getGarbledCircuit(); for(auto i=gc.begin(); i!=gc.end(); i++) { traversalGarbledCircuit(*i); } } }
void Project::Con(int p[],int m) { Project proj; int i=0,n=0,flag=0; for(i=0;i<6;i++) { if(i==1) { continue; } p[m]=prime[i]; if(proj.trun(p,m+1,1)==1) { if(proj.trun(p,m+1,2)==1) { n++; } proj.Con(p,m+1); } } }
QVariant modelData( const QModelIndex & idx, int role ) { int col = idx.column(); if( role == Qt::DisplayRole || role == Qt::EditRole ) { switch( col ) { case 0: return project.name(); case 1: return record.getValue("arsenalSlotReserve"); case 2: return record.getValue("currentAllocation"); } } return QVariant(); }
void ProjectWriter::writeProject(const Project& project) { // Space to save the crc code _outStream->writeChars(project.id()->c_str(), project.id()->length()); _outStream->writeChars(project.name()->c_str(), project.name()->length()); _outStream->writeChars(project.description()->c_str(), project.description()->length()); vector<Task*>* tasks = project.tasks(); int taskCount = tasks->size(); _outStream->writeInt(taskCount); _outStream->writeInt(project.type()); for (vector<Task*>::iterator iterTask = tasks->begin(); iterTask != tasks->end(); iterTask++) { Task* task = *iterTask; writeTask(*task); } delete(tasks); }
void TestProject::checkCurrent() { Project* project = SessionManager::startupProject (); CustomRunConfiguration* configuration = parse (project); if (configuration == NULL) { return; } IDocument* document = EditorManager::currentDocument (); if (document == NULL) { return; } FileName file = document->filePath(); QStringList files = project->files (Project::ExcludeGeneratedFiles); if (!files.contains (file.toString ())) { return; } runTestsForFiles (FileNameList () << file, configuration); }
bool Relation::load(KoXmlElement &element, Project &project) { m_parent = project.findNode(element.attribute("parent-id")); if (m_parent == 0) { return false; } m_child = project.findNode(element.attribute("child-id")); if (m_child == 0) { return false; } if (m_child == m_parent) { kDebug(planDbg())<<"child == parent"; return false; } if (m_child == m_parent) { kDebug(planDbg())<<"child == parent"; return false; } if (!m_parent->legalToLink(m_child)) return false; setType( element.attribute("type") ); m_lag = Duration::fromString(element.attribute("lag")); if (!m_parent->addDependChildNode(this)) { kError()<<"Failed to add relation: Child="<<m_child->name()<<" parent="<<m_parent->name()<<endl; return false; } if (!m_child->addDependParentNode(this)) { m_parent->takeDependChildNode(this); kError()<<"Failed to add relation: Child="<<m_child->name()<<" parent="<<m_parent->name()<<endl; return false; } //kDebug(planDbg())<<"Added relation: Child="<<m_child->name()<<" parent="<<m_parent->name(); return true; }
void LoadObjectsProgressPage::ended(kint status) { _ended = status; // Add all data to the project Project* project = static_cast<Project*>(PantinEngine::ActiveManager()->rootInstance()); QFileInfo info(((FileImporterWizard*)wizard())->file()->fileName()); // Create a model within the project Nigel::project::Model* model = project->createModel(info.baseName()); model->blockName(info.baseName()); QList<Geometry*> geometries = _tasklet->geometries(); for(kint i=0; i<geometries.size(); i++) { model->geometries()->addBlock(geometries.at(i)); } QList<Node*> sceneNodes = _tasklet->sceneNodes(); Node* rootNode = model->scene()->visualSceneInstance()->instantiatedElement()->node(0); for(kint i=0; i<sceneNodes.size(); i++) { rootNode->addBlock(sceneNodes.at(i)); } // Save the model to disk model->manager()->saveInstance(model); // Add a reference to the project ProjectAddModel* add = new ProjectAddModel(project, model); QUndoStack* stack = PantinEngine::InstanceUndoStack(project); stack->setActive(true); stack->push(add); emit completeChanged(); }
//---------------------------------------------------------------------------- void EditRenderView_Scene::_UpdateBrushPos(const APoint &pos) { Project *proj = Project::GetSingletonPtr(); if (!proj) return; Scene *scene = proj->GetScene(); if (!scene) return; TerrainActor *terrainActor = scene->GetTerrainActor(); if (!terrainActor) return; RawTerrain *terrain = terrainActor->GetRawTerrain(); APoint origin; AVector dir; mRenderStep->GetPickRay(pos.X(), pos.Z(), origin, dir); Movable *pickObject = terrain; #ifdef _DEBUG pickObject = PX2_GR.GetXYPlane(); pickObject->WorldTransform.SetTranslate(APoint::ORIGIN); #endif if (pickObject) { PX2::Picker picker; picker.Execute(pickObject, origin, dir, 0.0f, Mathf::MAX_REAL); if ((int)picker.Records.size() > 0) { PX2::PickRecord pickRecord = picker.GetClosestToZero(); PX2::APoint dest = origin + dir*pickRecord.T; PX2_EDIT.GetTerrainEdit()->GetBrush()->SetPos(dest); } } }
int TSend::set_state( const QDomNode & node ) { Project* project = pm().get_project(); if (!project) { printf("TSend::set_state: Oh boy, no project?? Can't restore state without a project running!!\n"); return -1; } QDomElement e = node.toElement(); m_id = e.attribute("id", "0").toLongLong(); qint64 busId = e.attribute("bus", "0").toLongLong(); QString type = e.attribute("type", ""); QString busName = e.attribute("busname", "No Busname in Project file"); set_gain(e.attribute("gain", "1.0").toFloat()); set_pan(e.attribute("pan", "0.00").toFloat()); if (type == "post") { m_type = POSTSEND; } else if (type == "pre") { m_type = PRESEND; } else { // default to post send if no type was stored m_type = POSTSEND; } m_bus = project->get_audio_bus(busId); if (!m_bus) { printf("TSend::set_state: Project didn't return my Bus (%s)!\n", busName.toAscii().data()); return -1; } return 1; }