From 227e568b4f3d71feb7ae6df1e4ca7d763b9e9311 Mon Sep 17 00:00:00 2001 From: Uwe Date: Mon, 13 Jun 2022 01:42:58 +0200 Subject: [PATCH] [FEM] cut and clip filter: handle new functions - on adding a new function, it should be used - there is still a bug, see the added FIXME --- src/Mod/Fem/Gui/TaskPostBoxes.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/Mod/Fem/Gui/TaskPostBoxes.cpp b/src/Mod/Fem/Gui/TaskPostBoxes.cpp index 23d821794c..d28272e542 100644 --- a/src/Mod/Fem/Gui/TaskPostBoxes.cpp +++ b/src/Mod/Fem/Gui/TaskPostBoxes.cpp @@ -482,7 +482,19 @@ void TaskPostClip::collectImplicitFunctions() { void TaskPostClip::on_CreateButton_triggered(QAction*) { + int currentItem = ui->FunctionBox->currentIndex(); collectImplicitFunctions(); + // if a new function was successfuly added use it + int indexCount = ui->FunctionBox->count(); + if (indexCount > currentItem + 1) + ui->FunctionBox->setCurrentIndex(ui->FunctionBox->count() - 1); + + // FIXME: when the first function ever was added, a signal must be emit + // that is received by TaskPostDisplay to trigger + // updateEnumerationList(getTypedView()->Field, ui->Field); + // at it is the Field combo keeps empty and the user must reopen the task dialog to get + // it filled + recompute(); } @@ -1376,7 +1388,19 @@ void TaskPostCut::collectImplicitFunctions() { void TaskPostCut::on_CreateButton_triggered(QAction*) { + int currentItem = ui->FunctionBox->currentIndex(); collectImplicitFunctions(); + // if a new function was successfuly added use it + int indexCount = ui->FunctionBox->count(); + if (indexCount > currentItem + 1) + ui->FunctionBox->setCurrentIndex(ui->FunctionBox->count() - 1); + + // FIXME: when the first function ever was added, a signal must be emit + // that is received by TaskPostDisplay to trigger + // updateEnumerationList(getTypedView()->Field, ui->Field); + // at it is the Field combo keeps empty and the user must reopen the task dialog to get + // it filled + recompute(); }