IPAL 18079

This commit is contained in:
dmv 2008-02-11 08:41:26 +00:00
parent 0040988ed9
commit 66d3644fbf

View File

@ -174,7 +174,7 @@ void RepairGUI_GlueDlg::Init()
connect( mySubShapesChk, SIGNAL( stateChanged( int ) ), this, SLOT( onSubShapesChk() ) ); connect( mySubShapesChk, SIGNAL( stateChanged( int ) ), this, SLOT( onSubShapesChk() ) );
connect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), connect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()) ); SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()) );
connect(myDetectBtn, SIGNAL(clicked()), this, SLOT(onDetect())); connect(myDetectBtn, SIGNAL(clicked()), this, SLOT(onDetect()));
@ -240,8 +240,8 @@ void RepairGUI_GlueDlg::ConstructorsClicked( int constructorId )
myEditCurrentArgument->setFocus(); myEditCurrentArgument->setFocus();
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
qApp->processEvents(); qApp->processEvents();
updateGeometry(); updateGeometry();
@ -294,8 +294,10 @@ bool RepairGUI_GlueDlg::ClickOnApply()
//================================================================================= //=================================================================================
void RepairGUI_GlueDlg::SelectionIntoArgument() void RepairGUI_GlueDlg::SelectionIntoArgument()
{ {
if ( mySubShapesChk->isChecked() && getConstructorId() == 1 ) if ( mySubShapesChk->isChecked() && getConstructorId() == 1 ) {
updateButtonState();
return; return;
}
erasePreview(); erasePreview();
myEditCurrentArgument->setText(""); myEditCurrentArgument->setText("");
@ -350,7 +352,7 @@ void RepairGUI_GlueDlg::LineEditReturnPressed()
void RepairGUI_GlueDlg::ActivateThisDialog() void RepairGUI_GlueDlg::ActivateThisDialog()
{ {
GEOMBase_Skeleton::ActivateThisDialog(); GEOMBase_Skeleton::ActivateThisDialog();
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
//GroupPoints->LineEdit1->setText(""); //GroupPoints->LineEdit1->setText("");
@ -651,6 +653,8 @@ void RepairGUI_GlueDlg::onDetect()
msg = tr( "THERE_ARE_NO_FACES_FOR_GLUING" ); msg = tr( "THERE_ARE_NO_FACES_FOR_GLUING" );
} }
connect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()) ) ;
SUIT_MessageBox::info1( this, tr( "GEOM_FREE_BOUNDS_TLT" ), msg, "Close" ); SUIT_MessageBox::info1( this, tr( "GEOM_FREE_BOUNDS_TLT" ), msg, "Close" );
updateButtonState(); updateButtonState();
activateSelection(); activateSelection();
@ -667,15 +671,15 @@ void RepairGUI_GlueDlg::activateSelection()
int anId = getConstructorId(); int anId = getConstructorId();
if ( anId == 0 ) // Case of whole gluing if ( anId == 0 ) // Case of whole gluing
{ {
disconnect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), disconnect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()) ) ; SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()) ) ;
globalSelection( GEOM_ALLSHAPES ); globalSelection( GEOM_ALLSHAPES );
if (myObject->_is_nil()) if (myObject->_is_nil())
SelectionIntoArgument(); SelectionIntoArgument();
connect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), connect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()) ) ; SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()) ) ;
} }
else // Second case of gluing else // Second case of gluing
{ {
@ -684,10 +688,13 @@ void RepairGUI_GlueDlg::activateSelection()
else else
{ {
displayPreview( true, false, false, 2/*line width*/, 1/*display mode*/, Quantity_NOC_RED ); displayPreview( true, false, false, 2/*line width*/, 1/*display mode*/, Quantity_NOC_RED );
disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()) ) ;
globalSelection( GEOM_PREVIEW ); globalSelection( GEOM_PREVIEW );
} connect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()) ) ;
}
} }
updateViewer(); updateViewer();
} }
@ -706,9 +713,13 @@ void RepairGUI_GlueDlg::updateButtonState()
} }
else else
{ {
bool wasSelected = false;
SALOME_ListIteratorOfListIO it ( selectedIO() );
if (it.More() > 0)
wasSelected = true;
bool wasDetected = myTmpObjs.size() ? true : false; bool wasDetected = myTmpObjs.size() ? true : false;
buttonOk->setEnabled( hasMainObj && wasDetected ); buttonOk->setEnabled( hasMainObj && wasDetected && wasSelected);
buttonApply->setEnabled( hasMainObj && wasDetected ); buttonApply->setEnabled( hasMainObj && wasDetected && wasSelected);
mySubShapesChk->setEnabled( hasMainObj && wasDetected ); mySubShapesChk->setEnabled( hasMainObj && wasDetected );
myDetectBtn->setEnabled( hasMainObj ); myDetectBtn->setEnabled( hasMainObj );
if ( !hasMainObj || !wasDetected ) if ( !hasMainObj || !wasDetected )