From abf4ddf9f7465ece2ed35b1a5f27a577cee99bf7 Mon Sep 17 00:00:00 2001 From: DeepSOIC Date: Fri, 6 May 2016 00:53:26 +0300 Subject: [PATCH] Attacher: UI: another fix of status label When no references were filled in, and modes were switched, it falsely claimed 'Attached'. This has been fixed. --- src/Mod/PartDesign/Gui/TaskDatumParameters.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Mod/PartDesign/Gui/TaskDatumParameters.cpp b/src/Mod/PartDesign/Gui/TaskDatumParameters.cpp index c259c1cb52..50faacd4ca 100644 --- a/src/Mod/PartDesign/Gui/TaskDatumParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskDatumParameters.cpp @@ -307,9 +307,9 @@ bool TaskDatumParameters::updatePreview() { Part::Datum* pcDatum = static_cast(DatumView->getObject()); QString errMessage; - bool attached; + bool attached = false; try{ - pcDatum->positionBySupport(); + attached = pcDatum->positionBySupport(); } catch (Base::Exception &err){ errMessage = QString::fromLatin1(err.what()); } catch (Standard_Failure &err){ @@ -320,17 +320,14 @@ bool TaskDatumParameters::updatePreview() if (errMessage.length()>0){ ui->message->setText(tr("Attachment mode failed: %1").arg(errMessage)); ui->message->setStyleSheet(QString::fromLatin1("QLabel{color: red;}")); - attached = false; } else { - if (pcDatum->MapMode.getValue() == mmDeactivated){ + if (!attached){ ui->message->setText(tr("Not attached")); ui->message->setStyleSheet(QString()); - attached = false; } else { std::vector strs = AttacherGui::getUIStrings(pcDatum->attacher().getTypeId(),eMapMode(pcDatum->MapMode.getValue())); ui->message->setText(tr("Attached with mode %1").arg(strs[0])); ui->message->setStyleSheet(QString::fromLatin1("QLabel{color: green;}")); - attached = true; } } QString splmLabelText = attached ? tr("Extra placement:") : tr("Extra placement (inactive - not attached):");