SMESHGUI_BuildCompoundDlg::SMESHGUI_BuildCompoundDlg( SMESHGUI* theModule )
: QDialog(SMESH::GetDesktop(theModule)),
mySMESHGUI(theModule),
- mySelectionMgr(SMESH::GetSelectionMgr(theModule))
+ mySelectionMgr(SMESH::GetSelectionMgr(theModule)),
+ myIsApplyAndClose( false )
{
setModal(false);
setAttribute(Qt::WA_DeleteOnClose, true);
if (!myMesh->_is_nil()) {
QStringList aParameters;
aParameters << (CheckBoxMerge->isChecked() ? SpinBoxTol->text() : QString(" "));
+ QStringList anEntryList;
try {
SUIT_OverrideCursor aWaitCursor;
aCompoundMesh->SetParameters( aParameters.join(":").toLatin1().constData() );
- SMESH::SetName( SMESH::FindSObject( aCompoundMesh ), LineEditName->text() );
+ _PTR(SObject) aSO = SMESH::FindSObject( aCompoundMesh );
+ if( aSO ) {
+ SMESH::SetName( aSO, LineEditName->text() );
+ anEntryList.append( aSO->GetID().c_str() );
+ }
mySMESHGUI->updateObjBrowser();
} catch(...) {
return false;
SMESH::DisplayActor(SMESH::GetActiveWindow(), anActor);
}// end IPAL21468
+ if( LightApp_Application* anApp =
+ dynamic_cast<LightApp_Application*>( SUIT_Session::session()->activeApplication() ) )
+ anApp->browseObjects( anEntryList, isApplyAndClose() );
+
SMESHGUI::Modified();
#ifdef WITHGENERICOBJ
// It is safe to decrement its refcount
// so that it will be destroyed when the entry in study will be removed
if (!CORBA::is_nil(aCompoundMesh))
- aCompoundMesh->Destroy();
+ aCompoundMesh->UnRegister();
#endif
return true;
//=================================================================================
void SMESHGUI_BuildCompoundDlg::ClickOnOk()
{
+ setIsApplyAndClose( true );
if (ClickOnApply())
ClickOnCancel();
}
}
return true;
}
+
+//================================================================
+// function : setIsApplyAndClose
+// Purpose : Set value of the flag indicating that the dialog is
+// accepted by Apply & Close button
+//================================================================
+void SMESHGUI_BuildCompoundDlg::setIsApplyAndClose( const bool theFlag )
+{
+ myIsApplyAndClose = theFlag;
+}
+
+//================================================================
+// function : isApplyAndClose
+// Purpose : Get value of the flag indicating that the dialog is
+// accepted by Apply & Close button
+//================================================================
+bool SMESHGUI_BuildCompoundDlg::isApplyAndClose() const
+{
+ return myIsApplyAndClose;
+}