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

disable remove button if there are no samples to remove

parent 3647453f
No related branches found
No related tags found
1 merge request!2404ensure that there are no duplicate names in lists; disable cp/rm actions for empty lists
......@@ -97,6 +97,7 @@ SampleView::SampleView()
editor->setCurrentSample(t);
onRequestViewInRealspace(t);
scriptPanel->setCurrentSample(t);
updateActions();
});
connect(editor, &SampleEditor::modified, scriptPanel, &ScriptPanel::onSampleModified);
......@@ -110,6 +111,8 @@ SampleView::SampleView()
&RealspaceWidget::updateScene);
connect(editor, &SampleEditor::modified, gDoc.get(), &ProjectDocument::setModified);
updateActions();
}
SampleView::~SampleView()
......@@ -180,6 +183,13 @@ void SampleView::setToolbarActions(QToolBar* toolbar)
connect(m_rm_action, &QAction::triggered, m_set, &SamplesSet::delete_current);
}
void SampleView::updateActions()
{
bool enabled = m_set->currentIndex() != size_t(-1);
m_rm_action->setEnabled(enabled);
m_cp_action->setEnabled(enabled);
}
void SampleView::applySplitterPos()
{
QSettings settings;
......
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