From 44bdc37348991a7672ba5e44490df871b7e81893 Mon Sep 17 00:00:00 2001 From: Matthias Puchner <github@mpuchner.de> Date: Thu, 25 Nov 2021 16:33:41 +0100 Subject: [PATCH] cleanup SimulationView --- GUI/View/Toplevel/SimulationView.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/GUI/View/Toplevel/SimulationView.cpp b/GUI/View/Toplevel/SimulationView.cpp index 1b32d6f5908..61ce8f53090 100644 --- a/GUI/View/Toplevel/SimulationView.cpp +++ b/GUI/View/Toplevel/SimulationView.cpp @@ -13,18 +13,18 @@ // ************************************************************************************************ #include "GUI/View/Toplevel/SimulationView.h" -#include "GUI/Model/Data/DocumentModel.h" #include "GUI/Model/Data/RealDataItem.h" #include "GUI/Model/Data/RealDataModel.h" #include "GUI/Model/Instrument/InstrumentItems.h" +#include "GUI/Model/Instrument/InstrumentModel.h" #include "GUI/Model/Job/JobItem.h" #include "GUI/Model/Job/JobModel.h" +#include "GUI/Model/Project/ProjectDocument.h" #include "GUI/Model/Sample/MultiLayerItem.h" #include "GUI/Model/Sample/SampleModel.h" #include "GUI/Model/Sample/SampleValidator.h" #include "GUI/Model/Session/ModelUtils.h" #include "GUI/Model/Session/SimulationOptionsItem.h" -#include "GUI/Model/State/SessionData.h" #include "GUI/View/Main/MainWindow.h" #include "GUI/View/Main/ProjectManager.h" #include "GUI/View/Script/PythonScriptWidget.h" @@ -74,25 +74,21 @@ SimulationView::SimulationView(QWidget* parent, ProjectDocument* document) &SimulationView::updateEnabling); connect(m_ui->runPolicyImmediatelyRadio, &QRadioButton::toggled, - []() { gSessionData->projectDocument->setModified(true); }); + [=]() { document->setModified(true); }); - connect(m_ui->analyticalRadio, &QRadioButton::toggled, - []() { gSessionData->projectDocument->setModified(true); }); + connect(m_ui->analyticalRadio, &QRadioButton::toggled, [=]() { document->setModified(true); }); connect(m_ui->averageLayerRadio, &QRadioButton::toggled, - []() { gSessionData->projectDocument->setModified(true); }); + [=]() { document->setModified(true); }); connect(m_ui->numberOfThreadsCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), - []() { gSessionData->projectDocument->setModified(true); }); + [=]() { document->setModified(true); }); connect(m_ui->numberOfMonteCarloPoints, QOverload<int>::of(&QSpinBox::valueChanged), - []() { gSessionData->projectDocument->setModified(true); }); + [=]() { document->setModified(true); }); connect(m_ui->includeSpecularCheck, &QCheckBox::toggled, - []() { gSessionData->projectDocument->setModified(true); }); - - connect(ProjectManager::instance(), &ProjectManager::documentOpenedOrClosed, this, - &SimulationView::writeOptionsToUI); + [=]() { document->setModified(true); }); connect(m_document, &ProjectDocument::modified, this, &SimulationView::updateFunctionalityNarrowing); -- GitLab