Skip to content
Snippets Groups Projects
Commit f9b8cc2c authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

synchronize enabled state of adapt button

parent c207792a
No related branches found
No related tags found
1 merge request!2635InstrumentView: synchronize enabled state of adapt button
Pipeline #148994 passed
......@@ -71,6 +71,7 @@ InstrumentView::InstrumentView()
updateEditor();
updateActions();
});
connect(gDoc->datafiles(), &DatafilesSet::setChanged, [this] { updateActions(); });
updateActions();
}
......@@ -141,9 +142,10 @@ void InstrumentView::updateActions()
{
ASSERT(m_set);
bool enabled = m_set->currentIndex() != size_t(-1);
m_adapt_action->setEnabled(
!m_set->currentItem()->is<DepthprobeInstrumentItem>() && !gDoc->datafiles()->empty()
&& m_set->currentItem()->detectorRank() == gDoc->datafiles()->currentItem()->rank());
m_adapt_action->setEnabled(enabled && !m_set->currentItem()->is<DepthprobeInstrumentItem>()
&& !gDoc->datafiles()->empty()
&& m_set->currentItem()->detectorRank()
== gDoc->datafiles()->currentItem()->rank());
m_rm_action->setEnabled(enabled);
m_cp_action->setEnabled(enabled);
m_save_action->setEnabled(enabled);
......
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