diff --git a/GUI/Model/Project/ProjectDocument.h b/GUI/Model/Project/ProjectDocument.h index de338e69d9c997f3b07e5e9e7bdfacd0af5ba81c..a96b4f2353796d1779e127d53a6bba9c979f213a 100644 --- a/GUI/Model/Project/ProjectDocument.h +++ b/GUI/Model/Project/ProjectDocument.h @@ -79,7 +79,6 @@ public: signals: void modifiedStateChanged(); - void modelChanged(); void sampleChanged(); private: diff --git a/GUI/View/View/InstrumentView.cpp b/GUI/View/View/InstrumentView.cpp index 30fa9efb6cbae89f632d55becc51aa1daf2605cb..5fdb5eed99062149152081a2d88852933828a784 100644 --- a/GUI/View/View/InstrumentView.cpp +++ b/GUI/View/View/InstrumentView.cpp @@ -20,6 +20,7 @@ #include "GUI/Model/Sim/InstrumentItems.h" #include "GUI/Model/Sim/InstrumentsSet.h" #include "GUI/View/IO/ComponentRW.h" +#include "GUI/View/Info/MessageBox.h" #include "GUI/View/Instrument/DepthprobeInstrumentEditor.h" #include "GUI/View/Instrument/OffspecInstrumentEditor.h" #include "GUI/View/Instrument/Scatter2DInstrumentEditor.h" @@ -125,9 +126,13 @@ void InstrumentView::createActions(QToolBar* toolbar) m_adapt_action->setToolTip("Take axes from current data file"); toolbar->addAction(m_adapt_action); connect(m_adapt_action, &QAction::triggered, [this] { - ASSERT(gDoc->datafiles()->currentItem()); - m_set->currentItem()->updateToRealData(gDoc->datafiles()->currentItem()); - emit gDoc->modelChanged(); + const DatafileItem* current_data = gDoc->datafiles()->currentItem(); + ASSERT(current_data); + if (!GUI::Message::question("Adapt instrument", "Adapt instrument dimensions to data", + QString("%1?").arg(current_data->name()), "Yes", "No")) + return; + m_set->currentItem()->updateToRealData(current_data); + m_scroll_area->setWidget(createEditor(m_set->currentItem())); }); m_save_action = new QAction("Save as XML", this);