X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/abbc64cf04a35ab3549d5c516f44c7c5921baa63..dd016ff4a3d4c5d4f90277637f86cdc31a7a91f8:/Parameters.cpp?ds=sidebyside diff --git a/Parameters.cpp b/Parameters.cpp index c991e5f..fce0435 100644 --- a/Parameters.cpp +++ b/Parameters.cpp @@ -69,37 +69,23 @@ void Parameters::destroyGraph() { delete graph; } -GroupBlock* Parameters::addGroupBlock() { - GroupBlock* parent = AB_TO_GRP(currentScene->getGroupItem()->getRefBlock()); - GroupBlock* newOne = graph->createChildBlock(parent); - return newOne; -} - -FunctionalBlock* Parameters::addFunctionalBlock(int idCategory, int idBlock) { +ReferenceBlock* Parameters::getReferenceBlock(int idCategory, int idBlock) { BlockCategory* blockCat = categoryTree->searchCategory(idCategory); if (blockCat == NULL) return NULL; - GroupBlock* group = AB_TO_GRP(currentScene->getGroupItem()->getRefBlock()); ReferenceBlock* ref = blockCat->getBlock(idBlock); - if (ref == NULL) return NULL; - - FunctionalBlock* newOne = graph->addFunctionalBlock(group, ref); - unsaveModif = true; - - return newOne; + return ref; } + FunctionalBlock* Parameters::duplicateFunctionalBlock(FunctionalBlock *block) { ReferenceBlock* ref = block->getReference(); GroupBlock* group = AB_TO_GRP(block->getParent()); - // adding to the group - FunctionalBlock* newBlock = new FunctionalBlock(group,ref); - newBlock->populate(); - group->addBlock(newBlock); - + // adding to the graph + FunctionalBlock* newBlock = graph->addFunctionalBlock(group,ref); return newBlock; } @@ -1032,11 +1018,11 @@ void Parameters::updateToolbar() { int nb = currentScene->getBlockItems().length(); for(int i = 0; igetBlockItems().at(i)->isSelected()){ - currentScene->getGroupWindow()->enableGroupButton(true); + currentScene->getGroupWidget()->enableGroupButton(true); return; } } - currentScene->getGroupWindow()->enableGroupButton(false); + currentScene->getGroupWidget()->enableGroupButton(false); } @@ -1098,9 +1084,6 @@ void Parameters::save(QString confFile) { // cross the scene level by level using a FIFO QList fifoScene; fifoScene.append(topScene); - foreach(ConnectionItem* item, topScene->getConnectionItems()) { - allConnections.append(item); - } GroupScene *scene; while (!fifoScene.isEmpty()) { @@ -1109,11 +1092,12 @@ void Parameters::save(QString confFile) { foreach(GroupScene* s, scene->getChildrenScene()) { fifoScene.append(s); } - foreach(ConnectionItem* item, topScene->getConnectionItems()) { + + foreach(ConnectionItem* item, scene->getConnectionItems()) { allConnections.append(item); } } - + writer.writeEndElement(); // writer.writeStartElement("connections"); foreach(ConnectionItem* item, allConnections) {