Sketcher: Support for clickable DoFs to launch DoF finder

This commit is contained in:
Abdullah Tahiri
2018-03-04 16:37:08 +01:00
committed by wmayer
parent 040923fcef
commit d75be1cd03
2 changed files with 11 additions and 7 deletions

View File

@@ -59,16 +59,16 @@ TaskSketcherMessages::TaskSketcherMessages(ViewProviderSketch *sketchView)
connectionSetUp = sketchView->signalSetUp.connect(boost::bind(&SketcherGui::TaskSketcherMessages::slotSetUp, this,_1));
connectionSolved = sketchView->signalSolved.connect(boost::bind(&SketcherGui::TaskSketcherMessages::slotSolved, this,_1));
ui->labelConstrainStatus->setOpenExternalLinks(false);
ui->autoUpdate->onRestore();
if(ui->autoUpdate->isChecked())
sketchView->getSketchObject()->noRecomputes=false;
else
sketchView->getSketchObject()->noRecomputes=true;
/*QObject::connect(
ui->labelConstrainStatus, SIGNAL(linkActivated(const QString &)),
this , SLOT (on_labelConstrainStatus_linkActivated(const QString &))
@@ -106,7 +106,11 @@ void TaskSketcherMessages::on_labelConstrainStatus_linkActivated(const QString &
Gui::Application::Instance->commandManager().runCommandByName("Sketcher_SelectConflictingConstraints");
if( str == QString::fromLatin1("#redundant"))
Gui::Application::Instance->commandManager().runCommandByName("Sketcher_SelectRedundantConstraints");
Gui::Application::Instance->commandManager().runCommandByName("Sketcher_SelectRedundantConstraints");
if( str == QString::fromLatin1("#dofs"))
Gui::Application::Instance->commandManager().runCommandByName("Sketcher_SelectElementsWithDoFs");
}
void TaskSketcherMessages::on_autoUpdate_stateChanged(int state)

View File

@@ -5502,9 +5502,9 @@ void ViewProviderSketch::UpdateSolverInformation()
}
else if (!hasRedundancies) {
if (dofs == 1)
signalSetUp(tr("Under-constrained sketch with 1 degree of freedom"));
signalSetUp(tr("Under-constrained sketch with <a href=\"#dofs\"><span style=\" text-decoration: underline; color:#0000ff;\">1 degree</span></a> of freedom"));
else
signalSetUp(tr("Under-constrained sketch with %1 degrees of freedom").arg(dofs));
signalSetUp(tr("Under-constrained sketch with <a href=\"#dofs\"><span style=\" text-decoration: underline; color:#0000ff;\">%2 degrees</span></a> of freedom").arg(dofs));
}
signalSolved(QString::fromLatin1("<font color='green'>%1</font>").arg(tr("Solved in %1 sec").arg(getSketchObject()->getLastSolveTime())));