From: dmv Date: Mon, 11 Feb 2008 08:41:26 +0000 (+0000) Subject: IPAL 18079 X-Git-Tag: V4_1_1rc1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=66d3644fbf62475fa0659c0e61b092404dab373a;p=modules%2Fgeom.git IPAL 18079 --- diff --git a/src/RepairGUI/RepairGUI_GlueDlg.cxx b/src/RepairGUI/RepairGUI_GlueDlg.cxx index fbeac2c3b..d723e1e80 100644 --- a/src/RepairGUI/RepairGUI_GlueDlg.cxx +++ b/src/RepairGUI/RepairGUI_GlueDlg.cxx @@ -174,7 +174,7 @@ void RepairGUI_GlueDlg::Init() connect( mySubShapesChk, SIGNAL( stateChanged( int ) ), this, SLOT( onSubShapesChk() ) ); 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())); @@ -240,8 +240,8 @@ void RepairGUI_GlueDlg::ConstructorsClicked( int constructorId ) myEditCurrentArgument->setFocus(); - connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), - SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); qApp->processEvents(); updateGeometry(); @@ -294,8 +294,10 @@ bool RepairGUI_GlueDlg::ClickOnApply() //================================================================================= void RepairGUI_GlueDlg::SelectionIntoArgument() { - if ( mySubShapesChk->isChecked() && getConstructorId() == 1 ) + if ( mySubShapesChk->isChecked() && getConstructorId() == 1 ) { + updateButtonState(); return; + } erasePreview(); myEditCurrentArgument->setText(""); @@ -350,7 +352,7 @@ void RepairGUI_GlueDlg::LineEditReturnPressed() void RepairGUI_GlueDlg::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())); //GroupPoints->LineEdit1->setText(""); @@ -651,6 +653,8 @@ void RepairGUI_GlueDlg::onDetect() 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" ); updateButtonState(); activateSelection(); @@ -667,15 +671,15 @@ void RepairGUI_GlueDlg::activateSelection() int anId = getConstructorId(); if ( anId == 0 ) // Case of whole gluing { - disconnect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), - SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()) ) ; + disconnect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()) ) ; globalSelection( GEOM_ALLSHAPES ); if (myObject->_is_nil()) SelectionIntoArgument(); - connect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), - SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()) ) ; + connect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()) ) ; } else // Second case of gluing { @@ -684,10 +688,13 @@ void RepairGUI_GlueDlg::activateSelection() else { 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 ); - } + connect( ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), + SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()) ) ; + } } - updateViewer(); } @@ -706,9 +713,13 @@ void RepairGUI_GlueDlg::updateButtonState() } else { + bool wasSelected = false; + SALOME_ListIteratorOfListIO it ( selectedIO() ); + if (it.More() > 0) + wasSelected = true; bool wasDetected = myTmpObjs.size() ? true : false; - buttonOk->setEnabled( hasMainObj && wasDetected ); - buttonApply->setEnabled( hasMainObj && wasDetected ); + buttonOk->setEnabled( hasMainObj && wasDetected && wasSelected); + buttonApply->setEnabled( hasMainObj && wasDetected && wasSelected); mySubShapesChk->setEnabled( hasMainObj && wasDetected ); myDetectBtn->setEnabled( hasMainObj ); if ( !hasMainObj || !wasDetected )