Skip to content
Snippets Groups Projects
Commit 6d823577 authored by Mikhail Svechnikov's avatar Mikhail Svechnikov
Browse files

[m.0] Ask about data and upd instrument view (#1051) (Closes #1051)

Merging branch 'm.0'  into 'main'.

See merge request !2792
parents e42b01e0 9f5e92b2
No related branches found
No related tags found
1 merge request!2792Ask about data and upd instrument view (#1051)
Pipeline #179159 passed
...@@ -79,7 +79,6 @@ public: ...@@ -79,7 +79,6 @@ public:
signals: signals:
void modifiedStateChanged(); void modifiedStateChanged();
void modelChanged();
void sampleChanged(); void sampleChanged();
private: private:
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "GUI/Model/Sim/InstrumentItems.h" #include "GUI/Model/Sim/InstrumentItems.h"
#include "GUI/Model/Sim/InstrumentsSet.h" #include "GUI/Model/Sim/InstrumentsSet.h"
#include "GUI/View/IO/ComponentRW.h" #include "GUI/View/IO/ComponentRW.h"
#include "GUI/View/Info/MessageBox.h"
#include "GUI/View/Instrument/DepthprobeInstrumentEditor.h" #include "GUI/View/Instrument/DepthprobeInstrumentEditor.h"
#include "GUI/View/Instrument/OffspecInstrumentEditor.h" #include "GUI/View/Instrument/OffspecInstrumentEditor.h"
#include "GUI/View/Instrument/Scatter2DInstrumentEditor.h" #include "GUI/View/Instrument/Scatter2DInstrumentEditor.h"
...@@ -125,9 +126,13 @@ void InstrumentView::createActions(QToolBar* toolbar) ...@@ -125,9 +126,13 @@ void InstrumentView::createActions(QToolBar* toolbar)
m_adapt_action->setToolTip("Take axes from current data file"); m_adapt_action->setToolTip("Take axes from current data file");
toolbar->addAction(m_adapt_action); toolbar->addAction(m_adapt_action);
connect(m_adapt_action, &QAction::triggered, [this] { connect(m_adapt_action, &QAction::triggered, [this] {
ASSERT(gDoc->datafiles()->currentItem()); const DatafileItem* current_data = gDoc->datafiles()->currentItem();
m_set->currentItem()->updateToRealData(gDoc->datafiles()->currentItem()); ASSERT(current_data);
emit gDoc->modelChanged(); 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); m_save_action = new QAction("Save as XML", this);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment