0021327: EDF 1915 SMESH: impossible to select a group to copy mesh

trim white spaces at end of object name, else the object seems not selected
This commit is contained in:
eap 2011-07-19 12:57:51 +00:00
parent 39f36db219
commit 6426baa9f3
5 changed files with 7 additions and 4 deletions

View File

@ -487,7 +487,8 @@ void SMESHGUI_DuplicateNodesDlg::onSelectionChanged()
if ( myCurrentLineEdit == myLineEdit1 ) myGroups1 = aGroups;
else if ( myCurrentLineEdit == myLineEdit2 ) myGroups2 = aGroups;
else if ( myCurrentLineEdit == myLineEdit3 ) myGroups3 = aGroups;
myCurrentLineEdit->setText( aGroups.count() == 1 ? aGroups[0]->GetName() :
CORBA::String_var name = aGroups[0]->GetName();
myCurrentLineEdit->setText( aGroups.count() == 1 ? QString(name).trimmed() :
QObject::tr( "SMESH_OBJECTS_SELECTED" ).arg( aGroups.count() ) );
}
else {

View File

@ -468,7 +468,8 @@ void SMESHGUI_FindElemByPointOp::onSelectionDone()
if ( pObj && !myMeshOrPart->_is_nil() )
{
myMeshIO = anIO;
myDlg->myMeshName->setText( pObj->GetName().c_str() );
std::string name = pObj->GetName();
myDlg->myMeshName->setText( QString( name.c_str() ).trimmed() );
newMeshEntry = anIO->getEntry();
SMESH::array_of_ElementType_var types = myMeshOrPart->GetTypes();
myDlg->setTypes( types );

View File

@ -1612,7 +1612,6 @@ void SMESHGUI_GroupDlg::onSelectGeomGroup(bool on)
}
}
//=================================================================================
// function : setCurrentSelection()
// purpose :

View File

@ -294,6 +294,8 @@ void SMESHGUI_Make2DFrom3DOp::selectionDone()
QStringList names, ids;
LightApp_Dialog::TypesList types;
selected( names, types, ids );
for ( int i = 0; i < names.count(); ++i )
names[i] = names[i].trimmed();
myDlg->selectObject( names, types, ids );
// enable/desable "new mesh" button

View File

@ -252,7 +252,7 @@ namespace SMESH
int aNbSel = selected.Extent();
if (aNbSel == 1) {
Handle(SALOME_InteractiveObject) anIObject = selected.First();
theName = anIObject->getName();
theName = QString( anIObject->getName() ).trimmed();
} else {
theName = QObject::tr("SMESH_OBJECTS_SELECTED").arg(aNbSel);
}