diff --git a/src/libs/vtools/dialogs/tools/dialogrotation.cpp b/src/libs/vtools/dialogs/tools/dialogrotation.cpp index 9b93477ff..0800ed6fd 100644 --- a/src/libs/vtools/dialogs/tools/dialogrotation.cpp +++ b/src/libs/vtools/dialogs/tools/dialogrotation.cpp @@ -64,13 +64,15 @@ DialogRotation::DialogRotation(const VContainer *data, const quint32 &toolId, QW FillComboBoxPoints(ui->comboBoxOriginPoint); -// flagName = true; + flagName = true; CheckState(); connect(ui->lineEditSuffix, &QLineEdit::textChanged, this, &DialogRotation::SuffixChanged); connect(ui->toolButtonExprAngle, &QPushButton::clicked, this, &DialogRotation::FXAngle); connect(ui->plainTextEditFormula, &QPlainTextEdit::textChanged, this, &DialogRotation::AngleChanged); connect(ui->pushButtonGrowLength, &QPushButton::clicked, this, &DialogRotation::DeployAngleTextEdit); + connect(ui->comboBoxOriginPoint, static_cast(&QComboBox::currentIndexChanged), + this, &DialogRotation::PointChanged); vis = new VisToolRotation(data); } @@ -195,6 +197,11 @@ void DialogRotation::ChosenObject(quint32 id, const SceneObject &type) { if (type == SceneObject::Point) { + if (objects.contains(id)) + { + return; + } + if (SetObject(id, ui->comboBoxOriginPoint, "")) { VisToolRotation *operation = qobject_cast(vis); @@ -332,6 +339,24 @@ void DialogRotation::closeEvent(QCloseEvent *event) DialogTool::closeEvent(event); } +//--------------------------------------------------------------------------------------------------------------------- +void DialogRotation::PointChanged() +{ + QColor color = okColor; + if (objects.contains(getCurrentObjectId(ui->comboBoxOriginPoint))) + { + flagError = false; + color = errorColor; + } + else + { + flagError = true; + color = okColor; + } + ChangeColor(ui->labelOriginPoint, color); + CheckState(); +} + //--------------------------------------------------------------------------------------------------------------------- void DialogRotation::EvalAngle() { diff --git a/src/libs/vtools/dialogs/tools/dialogrotation.h b/src/libs/vtools/dialogs/tools/dialogrotation.h index 2f30ccfc4..8dce24d2a 100644 --- a/src/libs/vtools/dialogs/tools/dialogrotation.h +++ b/src/libs/vtools/dialogs/tools/dialogrotation.h @@ -75,6 +75,9 @@ protected: virtual void SaveData() Q_DECL_OVERRIDE; virtual void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE; +private slots: + void PointChanged(); + private: Q_DISABLE_COPY(DialogRotation) Ui::DialogRotation *ui;