IPAL 19883 Smoothing. Error on Apply if "Fixed nodes ids" is activated, but node is not selected.

This commit is contained in:
dmv 2008-06-20 13:53:26 +00:00
parent 3506ddb84a
commit 25dc346fe7

View File

@ -358,8 +358,7 @@ void SMESHGUI_SmoothingDlg::ClickOnApply()
if (mySMESHGUI->isActiveStudyLocked()) if (mySMESHGUI->isActiveStudyLocked())
return; return;
if (myNbOkElements && if (myNbOkElements && (myNbOkNodes || LineEditNodes->text().stripWhiteSpace().isEmpty())) {
(myNbOkNodes || LineEditNodes->text().stripWhiteSpace().isEmpty())) {
QStringList aListElementsId = QStringList::split(" ", myElementsId, false); QStringList aListElementsId = QStringList::split(" ", myElementsId, false);
QStringList aListNodesId = QStringList::split(" ", LineEditNodes->text(), false); QStringList aListNodesId = QStringList::split(" ", LineEditNodes->text(), false);
@ -370,7 +369,7 @@ void SMESHGUI_SmoothingDlg::ClickOnApply()
for (int i = 0; i < aListElementsId.count(); i++) for (int i = 0; i < aListElementsId.count(); i++)
anElementsId[i] = aListElementsId[i].toInt(); anElementsId[i] = aListElementsId[i].toInt();
if (myNbOkNodes) { if ( myNbOkNodes && aListNodesId.count() > 0 ) {
aNodesId->length(aListNodesId.count()); aNodesId->length(aListNodesId.count());
for (int i = 0; i < aListNodesId.count(); i++) for (int i = 0; i < aListNodesId.count(); i++)
aNodesId[i] = aListNodesId[i].toInt(); aNodesId[i] = aListNodesId[i].toInt();
@ -538,7 +537,6 @@ void SMESHGUI_SmoothingDlg::SelectionIntoArgument()
if (myBusy) return; if (myBusy) return;
// clear // clear
myActor = 0;
QString aString = ""; QString aString = "";
myBusy = true; myBusy = true;
@ -547,6 +545,7 @@ void SMESHGUI_SmoothingDlg::SelectionIntoArgument()
myNbOkElements = 0; myNbOkElements = 0;
buttonOk->setEnabled(false); buttonOk->setEnabled(false);
buttonApply->setEnabled(false); buttonApply->setEnabled(false);
myActor = 0;
} }
myBusy = false; myBusy = false;
@ -639,7 +638,7 @@ void SMESHGUI_SmoothingDlg::SelectionIntoArgument()
else if (myEditCurrentArgument == LineEditNodes) else if (myEditCurrentArgument == LineEditNodes)
myNbOkNodes = true; myNbOkNodes = true;
if (myNbOkElements) { if (myNbOkElements && (myNbOkNodes || LineEditNodes->text().stripWhiteSpace().isEmpty())) {
buttonOk->setEnabled(true); buttonOk->setEnabled(true);
buttonApply->setEnabled(true); buttonApply->setEnabled(true);
} }
@ -671,11 +670,13 @@ void SMESHGUI_SmoothingDlg::SetEditCurrentArgument()
aViewWindow->SetSelectionMode(CellSelection); aViewWindow->SetSelectionMode(CellSelection);
} }
} else if (send == SelectNodesButton) { } else if (send == SelectNodesButton) {
LineEditNodes->clear();
myEditCurrentArgument = LineEditNodes; myEditCurrentArgument = LineEditNodes;
SMESH::SetPointRepresentation(true); SMESH::SetPointRepresentation(true);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) {
aViewWindow->SetSelectionMode(NodeSelection); aViewWindow->SetSelectionMode(NodeSelection);
} }
}
myEditCurrentArgument->setFocus(); myEditCurrentArgument->setFocus();
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));