mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
mySelector(SMESH::GetViewWindow( theModule )->GetSelector()),
myIsBusy( false ),
+ myNameChanged(false),
myActor( 0 )
{
if (!name) setName("SMESHGUI_GroupDlg");
mySMESHGUI( theModule ),
mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ),
mySelector(SMESH::GetViewWindow( theModule )->GetSelector()),
- myIsBusy( false )
+ myIsBusy( false ),
+ myNameChanged(false)
{
if (!name) setName("SMESHGUI_GroupDlg");
myMesh = theGroup->GetMesh();
setShowEntityMode();
+ myNameChanged = true;
+ myName->blockSignals(true);
myName->setText(theGroup->GetName());
+ myName->blockSignals(false);
myName->home(false);
SALOMEDS::Color aColor = theGroup->GetColor();
aShapeName = aGroupShapeSO->GetName().c_str();
}
myGeomGroupLine->setText( aShapeName );
+ myNameChanged = true;
+ myName->blockSignals(true);
myName->setText("Group On " + aShapeName);
+ myName->blockSignals(false);
}
}
}
{
myOldName = myName->text();
updateButtons();
+ QString tmp = myName->text();
+ tmp.stripWhiteSpace();
+ if( !tmp.isEmpty() )
+ myNameChanged = true;
+ else
+ myNameChanged = false;
}
//=================================================================================
{
if (myGrpTypeId != id) {
myWGStack->raiseWidget( id );
+ myName->blockSignals(true);
myName->setText(myOldName);
+ myName->blockSignals(false);
onSelectGeomGroup(id == 1);
}
myGrpTypeId = id;
// change name of group only if it is empty
QString tmp = myName->text();
tmp.stripWhiteSpace();
- if(tmp.isEmpty()) {
+ if( tmp.isEmpty() || !myNameChanged ) {
myOldName = myName->text();
+ myName->blockSignals(true);
myName->setText(aString);
+ myName->blockSignals(false);
}
updateButtons();