DbViewer: neighbor links can be rejected (a warning about splitting the graph is shown though)

This commit is contained in:
matlabbe
2019-07-11 18:53:47 -04:00
parent 89f1e809e6
commit 5222506578

View File

@@ -5495,9 +5495,7 @@ void DatabaseViewer::updateConstraintButtons()
{
if(!containsLink(linksRemoved_, from ,to))
{
ui_->pushButton_reject->setEnabled(
currentLink.type() != Link::kNeighbor &&
currentLink.type() != Link::kNeighborMerged);
ui_->pushButton_reject->setEnabled(true);
}
//check for modified link
@@ -7109,8 +7107,13 @@ void DatabaseViewer::rejectConstraint()
{
if(iter->second.type() == Link::kNeighbor || iter->second.type() == Link::kNeighborMerged)
{
UWARN("Cannot reject neighbor links (%d->%d)", from, to);
return;
QMessageBox::StandardButton button = QMessageBox::warning(this, tr("Reject link"),
tr("Removing the neighbor link %1->%2 will split the graph. Do you want to continue?").arg(from).arg(to),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
if(button != QMessageBox::Yes)
{
return;
}
}
linksRemoved_.insert(*iter);
removed = true;