connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
this, SLOT(SelectionIntoArgument()));
+ initName(tr("GEOM_FREE_FACES_NAME"));
+ buttonOk()->setEnabled(false);
+ buttonApply()->setEnabled(false);
activateSelection();
SelectionIntoArgument();
}
{
if (!onAccept())
return false;
+
+ initName();
return true;
}
aSelMgr->selectedObjects(aSelList);
if ( aSelList.Extent() != 1 ) {
+ buttonOk()->setEnabled(false);
+ buttonApply()->setEnabled(false);
return;
}
GEOMBase::ConvertIOinGEOMObject( aSelList.First() );
if ( !GEOMBase::IsShape( anObj ) ) {
+ buttonOk()->setEnabled(false);
+ buttonApply()->setEnabled(false);
return;
} else {
myObj = anObj;
TopoDS_Shape aSelShape;
TopoDS_Shape aFace;
TopTools_IndexedMapOfShape anIndices;
+ int aNbObj = 0;
+
if ( !myObj->_is_nil() && GEOMBase::GetShape( myObj, aSelShape ) ) {
myEdit->setText( GEOMBase::GetName( myObj ) );
QString aMess;
if ( !isValid( aMess ) ) {
erasePreview( true );
+ buttonOk()->setEnabled(false);
+ buttonApply()->setEnabled(false);
return false;
}
catch( const SALOME::SALOME_Exception& e )
{
SalomeApp_Tools::QtCatchCorbaException( e );
+ buttonOk()->setEnabled(false);
+ buttonApply()->setEnabled(false);
return false;
}
}
// Create sub-objects
GEOM::ListOfGO_var aList = anOper->MakeSubShapes(myObj, aFaceLst);
- for (i = 0, n = aList->length(); i < n; i++) {
+ aNbObj = aList->length();
+
+ for (i = 0; i < aNbObj; i++) {
objects.push_back(GEOM::GEOM_Object::_duplicate(aList[i]));
}
aResult = true;
}
+
+ buttonOk()->setEnabled(aNbObj > 0);
+ buttonApply()->setEnabled(aNbObj > 0);
+
return aResult;
}
return myDisplayer;
}
-//================================================================
-// Function : getNewObjectName
-// Purpose : Redefine this method to return proper name for a new object
-//================================================================
-QString RepairGUI_FreeFacesDlg::getNewObjectName (int currObj) const
-{
- QString aName = tr("GEOM_FREE_FACES_NAME").arg(currObj);
-
- return aName;
-}
-
//================================================================
// Function : getFather
// Purpose : Get father object for object to be added in study