[TD]fix fail on missing base view (#7856)

This commit is contained in:
wandererfan
2022-11-22 16:46:13 -05:00
committed by WandererFan
parent 52398d8f58
commit cdda6f2c38
4 changed files with 46 additions and 3 deletions

View File

@@ -190,8 +190,10 @@ void TaskProjGroup::viewToggled(bool toggle)
multiView->getNameInDocument(), viewNameCStr);
changed = true;
} else if ( !toggle && multiView->hasProjection( viewNameCStr ) ) {
multiView->removeProjection( viewNameCStr );
changed = true;
if (multiView->canDelete(viewNameCStr)) {
multiView->removeProjection( viewNameCStr );
changed = true;
}
}
if (changed) {
if (multiView->ScaleType.isValue("Automatic")) {
@@ -473,6 +475,9 @@ void TaskProjGroup::setupViewCheckboxes(bool addConnections)
const char *viewStr = viewChkIndexToCStr(i);
if (viewStr && multiView->hasProjection(viewStr)) {
box->setCheckState(Qt::Checked);
if (!multiView->canDelete(viewStr)) {
box->setEnabled(false);
}
} else {
box->setCheckState(Qt::Unchecked);
}