X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/blast.git/blobdiff_plain/abbc64cf04a35ab3549d5c516f44c7c5921baa63..dd016ff4a3d4c5d4f90277637f86cdc31a7a91f8:/MainWindow.cpp diff --git a/MainWindow.cpp b/MainWindow.cpp index 01c23c1..e9f8414 100644 --- a/MainWindow.cpp +++ b/MainWindow.cpp @@ -60,7 +60,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { // creating block library library = new BlockLibraryWidget(dispatcher,params); - isCurrentProject = false; + params->isCurrentProject = false; QLabel* labDefault = new QLabel("BLAST: BLock ASsembler Tool"); stackedWidget = new QStackedWidget; @@ -270,6 +270,7 @@ void MainWindow::slotLoadProject(){ GroupWidget* topGroup = dispatcher->loadProject(absoluteFilename); if (topGroup != NULL) { addTopGroup(topGroup); + library->updateComboScene(); } else { QMessageBox msgBox; @@ -289,7 +290,8 @@ void MainWindow::slotNewProject(){ enableProjectActions(true, PROJECT_CLOSE | PROJECT_SAVE | PROJECT_SAVEAS | PROJECT_LIB, OP_RAZ); GroupWidget* topGroup = dispatcher->createTopScene(); addTopGroup(topGroup); - + library->updateComboScene(); + params->isCurrentProject = true; } void MainWindow::slotCloseProject(){ @@ -302,7 +304,7 @@ void MainWindow::slotCloseProject(){ dispatcher->closeCurrentProject(); - isCurrentProject = false; + params->isCurrentProject = false; params->unsaveModif = false; absoluteFilename = QString(); @@ -323,7 +325,7 @@ void MainWindow::slotSaveProject(){ } void MainWindow::slotSaveAsProject(){ - if(isCurrentProject){ + if(params->isCurrentProject){ QFileDialog dial(0, "Select a file", "save/"); dial.setDefaultSuffix(".xml"); dial.setAcceptMode(QFileDialog::AcceptSave); @@ -357,7 +359,7 @@ void MainWindow::removeTopGroup() { } void MainWindow::closeEvent(QCloseEvent *event){ - if(isCurrentProject){ + if(params->isCurrentProject){ QMessageBox msgBox; msgBox.setText("The project has been modified."); msgBox.setInformativeText("Do you want to save your changes?");