FEM: Restore and harmonize FEM Task selection hints (#23678)

* FEM: Add hint about selectable geometry types in 'Geometry reference selector'

* FEM: Harmonize selection hint in FEM Task dialogs

[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

FEM: Add translation support, correct selectable geometry

FEM: Harmonize selection hint in FEM Task dialogs

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Krzysztof
2025-09-29 17:43:23 +02:00
committed by GitHub
parent e1a3b1cbe7
commit 861470c6ac
25 changed files with 61 additions and 13 deletions

View File

@@ -136,6 +136,13 @@ TaskFemConstraintContact::TaskFemConstraintContact(ViewProviderFemConstraintCont
ui->lw_referencesSlave->addItem(makeRefText(Objects[0], SubElements[0]));
}
ui->lbl_info->setText(tr("Select slave geometry of type: ")
+ QString::fromUtf8("<b>%1</b>; ").arg(tr("Face"))
+ tr("click Add or Remove"));
ui->lbl_info_2->setText(tr("Select master geometry of type: ")
+ QString::fromUtf8("<b>%1</b>; ").arg(tr("Face"))
+ tr("click Add or Remove"));
// Selection buttons
connect(ui->btnAddSlave,
&QToolButton::clicked,

View File

@@ -17,7 +17,7 @@
<item>
<widget class="QLabel" name="lbl_info_2">
<property name="text">
<string>Select master face, click Add or Remove</string>
<string>Select master geometry of type: Face; click Add or Remove</string>
</property>
</widget>
</item>
@@ -76,7 +76,7 @@
<item>
<widget class="QLabel" name="lbl_info">
<property name="text">
<string>Select slave face, click Add or Remove</string>
<string>Select slave geometry of type: Face; click Add or Remove</string>
</property>
</widget>
</item>

View File

@@ -161,6 +161,9 @@ TaskFemConstraintDisplacement::TaskFemConstraintDisplacement(
ui->DisplacementZFormulaCB->setChecked(bStates[8]);
ui->FlowForceCB->setChecked(bStates[9]);
ui->lbl_info->setText(tr("Select geometry of type: ")
+ QString::fromUtf8("<b>%1</b>").arg(tr("Vertex, Edge, Face")));
// Selection buttons
buttonGroup->addButton(ui->btnAdd, static_cast<int>(SelectionChangeModes::refAdd));
buttonGroup->addButton(ui->btnRemove, static_cast<int>(SelectionChangeModes::refRemove));

View File

@@ -38,7 +38,7 @@
<item>
<widget class="QLabel" name="lbl_info">
<property name="text">
<string>Click Add or Remove and select geometric elements</string>
<string>Select geometry of type: Vertex, Edge, Face</string>
</property>
</widget>
</item>

View File

@@ -82,6 +82,9 @@ TaskFemConstraintFixed::TaskFemConstraintFixed(ViewProviderFemConstraintFixed* C
ui->lw_references->setCurrentRow(0, QItemSelectionModel::ClearAndSelect);
}
ui->lbl_info->setText(tr("Select geometry of type: ")
+ QString::fromUtf8("<b>%1</b>").arg(tr("Vertex, Edge, Face")));
// Selection buttons
buttonGroup->addButton(ui->btnAdd, (int)SelectionChangeModes::refAdd);
buttonGroup->addButton(ui->btnRemove, (int)SelectionChangeModes::refRemove);

View File

@@ -17,7 +17,7 @@
<item>
<widget class="QLabel" name="lbl_info">
<property name="text">
<string>Click Add or Remove and select geometric elements</string>
<string>Select geometry of type: Vertex, Edge, Face</string>
</property>
</widget>
</item>

View File

@@ -370,6 +370,9 @@ TaskFemConstraintFluidBoundary::TaskFemConstraintFluidBoundary(
ui->buttonDirection->blockSignals(false);
ui->checkReverse->blockSignals(false);
ui->lbl_info->setText(tr("Select geometry of type: ")
+ QString::fromUtf8("<b>%1</b>").arg(tr("Face")));
updateUI();
}

View File

@@ -67,7 +67,7 @@
<item>
<widget class="QLabel" name="lbl_info">
<property name="text">
<string>Select multiple faces, click Add or Remove</string>
<string>Select geometry of type: Face</string>
</property>
</widget>
</item>

View File

@@ -86,6 +86,9 @@ TaskFemConstraintForce::TaskFemConstraintForce(ViewProviderFemConstraintForce* C
ui->lineDirection->setText(dir.isEmpty() ? QString() : dir);
ui->checkReverse->setChecked(reversed);
ui->lbl_info->setText(tr("Select geometry of type: ")
+ QString::fromUtf8("<b>%1</b>").arg(tr("Vertex, Edge, Face")));
// create a context menu for the listview of the references
createActions(ui->listReferences);
connect(deleteAction, &QAction::triggered, this, &TaskFemConstraintForce::onReferenceDeleted);

View File

@@ -29,7 +29,7 @@
<item>
<widget class="QLabel" name="lbl_info">
<property name="text">
<string>Click Add or Remove and select geometric elements</string>
<string>Select geometry of type: Vertex, Edge, Face</string>
</property>
</widget>
</item>

View File

@@ -145,6 +145,9 @@ TaskFemConstraintHeatflux::TaskFemConstraintHeatflux(
ui->lw_references->setCurrentRow(0, QItemSelectionModel::ClearAndSelect);
}
ui->lbl_references->setText(tr("Select geometry of type: ")
+ QString::fromUtf8("<b>%1</b>").arg(tr("Edge, Face")));
// Selection buttons
buttonGroup->addButton(ui->btnAdd, static_cast<int>(SelectionChangeModes::refAdd));
buttonGroup->addButton(ui->btnRemove, static_cast<int>(SelectionChangeModes::refRemove));

View File

@@ -17,7 +17,7 @@
<item>
<widget class="QLabel" name="lbl_references">
<property name="text">
<string>Click Add or Remove and select faces</string>
<string>Select geometry of type: Edge, Face</string>
</property>
</widget>
</item>

View File

@@ -92,6 +92,9 @@ TaskFemConstraintPlaneRotation::TaskFemConstraintPlaneRotation(
ui->lw_references->setCurrentRow(0, QItemSelectionModel::ClearAndSelect);
}
ui->lbl_info->setText(tr("Select single geometry of type: ")
+ QString::fromUtf8("<b>%1</b>").arg(tr("Face")));
// Selection buttons
connect(ui->btnAdd,
&QToolButton::clicked,

View File

@@ -17,7 +17,7 @@
<item>
<widget class="QLabel" name="lbl_info">
<property name="text">
<string>Select a single face, click Add or Remove</string>
<string>Select single geometry of type: Face</string>
</property>
</widget>
</item>

View File

@@ -70,6 +70,9 @@ TaskFemConstraintPressure::TaskFemConstraintPressure(
bool reversed = pcConstraint->Reversed.getValue();
ui->checkBoxReverse->setChecked(reversed);
ui->lbl_info->setText(tr("Select geometry of type: ")
+ QString::fromUtf8("<b>%1</b>").arg(tr("Edge, Face")));
ui->lw_references->clear();
for (std::size_t i = 0; i < Objects.size(); i++) {
ui->lw_references->addItem(makeRefText(Objects[i], SubElements[i]));

View File

@@ -17,7 +17,7 @@
<item>
<widget class="QLabel" name="lbl_info">
<property name="text">
<string>Click Add or Remove and select faces</string>
<string>Select geometry of type: Edge, Face</string>
</property>
</widget>
</item>

View File

@@ -248,6 +248,9 @@ TaskFemConstraintRigidBody::TaskFemConstraintRigidBody(
buttonGroup->addButton(ui->btnAdd, (int)SelectionChangeModes::refAdd);
buttonGroup->addButton(ui->btnRemove, (int)SelectionChangeModes::refRemove);
ui->lbl_info->setText(tr("Select geometry of type: ")
+ QString::fromUtf8("<b>%1</b>").arg(tr("Vertex, Edge, Face")));
updateUI();
}

View File

@@ -17,7 +17,7 @@
<item>
<widget class="QLabel" name="lbl_info">
<property name="text">
<string>Click Add or Remove and select geometric elements</string>
<string>Select geometry of type: Vertex, Edge, Face</string>
</property>
</widget>
</item>

View File

@@ -99,6 +99,9 @@ TaskFemConstraintSpring::TaskFemConstraintSpring(ViewProviderFemConstraintSpring
ui->lw_references->setCurrentRow(0, QItemSelectionModel::ClearAndSelect);
}
ui->lbl_info->setText(tr("Select geometry of type: ")
+ QString::fromUtf8("<b>%1</b>").arg(tr("Face")));
// Selection buttons
buttonGroup->addButton(ui->btnAdd, (int)SelectionChangeModes::refAdd);
buttonGroup->addButton(ui->btnRemove, (int)SelectionChangeModes::refRemove);

View File

@@ -17,7 +17,7 @@
<item>
<widget class="QLabel" name="lbl_info">
<property name="text">
<string>Click Add or Remove and select faces</string>
<string>Select geometry of type: Face</string>
</property>
</widget>
</item>

View File

@@ -97,6 +97,9 @@ TaskFemConstraintTemperature::TaskFemConstraintTemperature(
ui->lw_references->setCurrentRow(0, QItemSelectionModel::ClearAndSelect);
}
ui->lbl_info->setText(tr("Select geometry of type: ")
+ QString::fromUtf8("<b>%1</b>").arg(tr("Vertex, Edge, Face")));
// create a context menu for the listview of the references
createActions(ui->lw_references);
connect(deleteAction,

View File

@@ -29,7 +29,7 @@
<item>
<widget class="QLabel" name="lbl_info">
<property name="text">
<string>Click Add or Remove and select geometric elements</string>
<string>Select geometry of type: Vertex, Edge, Face</string>
</property>
</widget>
</item>

View File

@@ -153,6 +153,9 @@ TaskFemConstraintTransform::TaskFemConstraintTransform(
ui->lw_Rect->clear();
ui->lbl_info_2->setText(tr("Select single geometry of type: ")
+ QString::fromUtf8("<b>%1</b>").arg(tr("Face")));
// Transformable surfaces
Gui::Command::doCommand(Gui::Command::Doc,
TaskFemConstraintTransform::getSurfaceReferences(

View File

@@ -41,7 +41,7 @@
<item>
<widget class="QLabel" name="lbl_info_2">
<property name="text">
<string>Select a face, click Add or Remove</string>
<string>Select single geometry of type: Face</string>
</property>
</widget>
</item>

View File

@@ -296,6 +296,13 @@ class GeometryElementsSelection(QtGui.QWidget):
# button
self.pushButton_Add = QtGui.QPushButton(self.tr("Add"))
self.pushButton_Remove = QtGui.QPushButton(self.tr("Remove"))
# label
self.lb_help = QtGui.QLabel()
self.lb_help.setWordWrap(True)
selectHelpText = self.tr("Select geometry of type: {}{}{}").format(
"<b>", self.sel_elem_text, "</b>"
)
self.lb_help.setText(selectHelpText)
# list
self.list_References = QtGui.QListWidget()
# radiobutton down the list
@@ -314,6 +321,7 @@ class GeometryElementsSelection(QtGui.QWidget):
subLayout.addWidget(self.pushButton_Remove)
# main layout
mainLayout = QtGui.QVBoxLayout()
mainLayout.addWidget(self.lb_help)
mainLayout.addLayout(subLayout)
mainLayout.addWidget(self.list_References)