From: dmv Date: Wed, 19 Nov 2008 08:35:08 +0000 (+0000) Subject: Correct multiply connection of signals on activate this dialogs. X-Git-Tag: V5_1_0rc2~31 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8558f56ffb51634a810ee28aaa11bba689d100fd;p=modules%2Fgeom.git Correct multiply connection of signals on activate this dialogs. --- diff --git a/src/BooleanGUI/BooleanGUI_Dialog.cxx b/src/BooleanGUI/BooleanGUI_Dialog.cxx index 024d9d8e0..d3309fad8 100644 --- a/src/BooleanGUI/BooleanGUI_Dialog.cxx +++ b/src/BooleanGUI/BooleanGUI_Dialog.cxx @@ -281,8 +281,9 @@ void BooleanGUI_Dialog::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); - // reinit, because some selected objects could be removed - Init(); + connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), + this, SLOT( SelectionIntoArgument() ) ); + displayPreview(); } //================================================================================= diff --git a/src/BuildGUI/BuildGUI_EdgeDlg.cxx b/src/BuildGUI/BuildGUI_EdgeDlg.cxx index 12cd0786a..16a027d57 100644 --- a/src/BuildGUI/BuildGUI_EdgeDlg.cxx +++ b/src/BuildGUI/BuildGUI_EdgeDlg.cxx @@ -253,8 +253,10 @@ void BuildGUI_EdgeDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); - // reinit, because some selected objects could be removed - Init(); + connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), + this, SLOT( SelectionIntoArgument() ) ); + + displayPreview(); } //================================================================================= diff --git a/src/GenerationGUI/GenerationGUI_PrismDlg.cxx b/src/GenerationGUI/GenerationGUI_PrismDlg.cxx index b168cc19e..81c7347be 100644 --- a/src/GenerationGUI/GenerationGUI_PrismDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_PrismDlg.cxx @@ -574,8 +574,10 @@ void GenerationGUI_PrismDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); - // reinit, because some selected objects could be removed - Init(); + connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), + this, SLOT( SelectionIntoArgument() ) ); + + ConstructorsClicked( getConstructorId() ); } //================================================================================= diff --git a/src/GenerationGUI/GenerationGUI_RevolDlg.cxx b/src/GenerationGUI/GenerationGUI_RevolDlg.cxx index f8ceba68a..16c2d9d0a 100644 --- a/src/GenerationGUI/GenerationGUI_RevolDlg.cxx +++ b/src/GenerationGUI/GenerationGUI_RevolDlg.cxx @@ -343,9 +343,10 @@ void GenerationGUI_RevolDlg::LineEditReturnPressed() void GenerationGUI_RevolDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); + connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), + this, SLOT( SelectionIntoArgument() ) ); - // reinit, because some selected objects could be removed - Init(); + displayPreview(); } //================================================================================= diff --git a/src/MeasureGUI/MeasureGUI_NormaleDlg.cxx b/src/MeasureGUI/MeasureGUI_NormaleDlg.cxx index 033beb9bd..f1428280f 100644 --- a/src/MeasureGUI/MeasureGUI_NormaleDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_NormaleDlg.cxx @@ -313,9 +313,10 @@ void MeasureGUI_NormaleDlg::LineEditReturnPressed() void MeasureGUI_NormaleDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); + connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), + this, SLOT( SelectionIntoArgument() ) ); - // reinit, because some selected objects could be removed - Init(); + displayPreview(); } //================================================================================= diff --git a/src/OperationGUI/OperationGUI_ChamferDlg.cxx b/src/OperationGUI/OperationGUI_ChamferDlg.cxx index c634ea7f6..fc4facff5 100644 --- a/src/OperationGUI/OperationGUI_ChamferDlg.cxx +++ b/src/OperationGUI/OperationGUI_ChamferDlg.cxx @@ -582,9 +582,10 @@ void OperationGUI_ChamferDlg::LineEditReturnPressed() void OperationGUI_ChamferDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); + connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), + this, SLOT( SelectionIntoArgument() ) ); - // reinit, because some selected objects could be removed - Init(); + ConstructorsClicked( getConstructorId() ); } //================================================================================= diff --git a/src/OperationGUI/OperationGUI_FilletDlg.cxx b/src/OperationGUI/OperationGUI_FilletDlg.cxx index 447374237..6c1182ee9 100644 --- a/src/OperationGUI/OperationGUI_FilletDlg.cxx +++ b/src/OperationGUI/OperationGUI_FilletDlg.cxx @@ -494,9 +494,10 @@ void OperationGUI_FilletDlg::LineEditReturnPressed() void OperationGUI_FilletDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); + connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), + this, SLOT( SelectionIntoArgument() ) ); - // reinit, because some selected objects could be removed - Init(); + ConstructorsClicked( getConstructorId() ); } //================================================================================= diff --git a/src/OperationGUI/OperationGUI_GetShapesOnShapeDlg.cxx b/src/OperationGUI/OperationGUI_GetShapesOnShapeDlg.cxx index 3f5f95e4a..754630a17 100644 --- a/src/OperationGUI/OperationGUI_GetShapesOnShapeDlg.cxx +++ b/src/OperationGUI/OperationGUI_GetShapesOnShapeDlg.cxx @@ -264,9 +264,9 @@ void OperationGUI_GetShapesOnShapeDlg::LineEditReturnPressed() void OperationGUI_GetShapesOnShapeDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); - - // reinit, because some selected objects could be removed - Init(); + globalSelection(GEOM_ALLSHAPES); + connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), + this, SLOT( SelectionIntoArgument() ) ); } //================================================================================= diff --git a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx index 14104b1f4..caadbcee2 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx @@ -382,15 +382,12 @@ void PrimitiveGUI_BoxDlg::LineEditReturnPressed() void PrimitiveGUI_BoxDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); - //if (getConstructorId() == 0) { - // localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX); - // connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), - // this, SLOT(SelectionIntoArgument())); - //} - //displayPreview(); - - // reinit, because some selected objects could be removed - Init(); + if (getConstructorId() == 0) { + localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX); + connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), + this, SLOT(SelectionIntoArgument())); + } + displayPreview(); } //================================================================================= diff --git a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx index 6900955d0..835cd5be0 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx @@ -396,8 +396,10 @@ void PrimitiveGUI_CylinderDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); - // reinit, because some selected objects could be removed - Init(); + connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), + this, SLOT( SelectionIntoArgument() ) ); + + ConstructorsClicked( getConstructorId() ); } //================================================================================= diff --git a/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx index 7260f90c8..3477dd36b 100755 --- a/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx @@ -495,9 +495,10 @@ QLineEdit* send = (QLineEdit*)sender(); void PrimitiveGUI_DiskDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); + connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), + this, SLOT( SelectionIntoArgument() ) ); - // reinit, because some selected objects could be removed - Init(); + ConstructorsClicked( getConstructorId() ); } //================================================================================= diff --git a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx index a76f569ce..1045d004e 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx @@ -393,8 +393,10 @@ void PrimitiveGUI_TorusDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); - // reinit, because some selected objects could be removed - Init(); + connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), + this, SLOT( SelectionIntoArgument() ) ); + + ConstructorsClicked( getConstructorId() ); } //================================================================================= diff --git a/src/RepairGUI/RepairGUI_CloseContourDlg.cxx b/src/RepairGUI/RepairGUI_CloseContourDlg.cxx index c532a6b30..ac348383c 100644 --- a/src/RepairGUI/RepairGUI_CloseContourDlg.cxx +++ b/src/RepairGUI/RepairGUI_CloseContourDlg.cxx @@ -270,9 +270,16 @@ void RepairGUI_CloseContourDlg::LineEditReturnPressed() void RepairGUI_CloseContourDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); + connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), + this, SLOT( SelectionIntoArgument() ) ); - // reinit, because some selected objects could be removed - Init(); + myEditCurrentArgument = GroupPoints->LineEdit1; + myEditCurrentArgument->setText( "" ); + GroupPoints->LineEdit2->setText( "" ); + myObject = GEOM::GEOM_Object::_nil(); + myWiresInd->length( 0 ); + + initSelection(); } //================================================================================= diff --git a/src/RepairGUI/RepairGUI_RemoveHolesDlg.cxx b/src/RepairGUI/RepairGUI_RemoveHolesDlg.cxx index 5ac6a2d3e..cbf6fcb64 100644 --- a/src/RepairGUI/RepairGUI_RemoveHolesDlg.cxx +++ b/src/RepairGUI/RepairGUI_RemoveHolesDlg.cxx @@ -271,9 +271,19 @@ void RepairGUI_RemoveHolesDlg::LineEditReturnPressed() void RepairGUI_RemoveHolesDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); + connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), + this, SLOT( SelectionIntoArgument() ) ); - // reinit, because some selected objects could be removed - Init(); + myEditCurrentArgument = GroupPoints->LineEdit1; + myEditCurrentArgument->setText( "" ); + GroupPoints->LineEdit2->setText( "" ); + myObject = GEOM::GEOM_Object::_nil(); + myWiresInd->length( 0 ); + + myClosed = -1; + myOpen = -1; + + initSelection(); } //================================================================================= diff --git a/src/RepairGUI/RepairGUI_RemoveIntWiresDlg.cxx b/src/RepairGUI/RepairGUI_RemoveIntWiresDlg.cxx index aaf5de0d1..dd0dbcd0a 100644 --- a/src/RepairGUI/RepairGUI_RemoveIntWiresDlg.cxx +++ b/src/RepairGUI/RepairGUI_RemoveIntWiresDlg.cxx @@ -258,9 +258,17 @@ void RepairGUI_RemoveIntWiresDlg::LineEditReturnPressed() void RepairGUI_RemoveIntWiresDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); + connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), + this, SLOT( SelectionIntoArgument() ) ); - // reinit, because some selected objects could be removed - Init(); + myEditCurrentArgument = GroupPoints->LineEdit1; + myEditCurrentArgument->setText( "" ); + GroupPoints->LineEdit2->setText( "" ); + myObject = GEOM::GEOM_Object::_nil(); + myWiresInd->length( 0 ); + + //myGeomGUI->SetState( 0 ); + initSelection(); } //================================================================================= diff --git a/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx b/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx index 8195e4bbf..4da6e745f 100644 --- a/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MirrorDlg.cxx @@ -365,9 +365,10 @@ void TransformationGUI_MirrorDlg::LineEditReturnPressed() void TransformationGUI_MirrorDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); + connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), + this, SLOT( SelectionIntoArgument() ) ); - // reinit, because some selected objects could be removed - Init(); + ConstructorsClicked( getConstructorId() ); } //================================================================================= diff --git a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx index 439a14753..04124c3a5 100644 --- a/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx @@ -445,9 +445,10 @@ void TransformationGUI_MultiRotationDlg::LineEditReturnPressed() void TransformationGUI_MultiRotationDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); + connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), + this, SLOT( SelectionIntoArgument() ) ); - // reinit, because some selected objects could be removed - Init(); + ConstructorsClicked( getConstructorId() ); } //================================================================================= diff --git a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx index c3d4b216e..7ad4a872d 100644 --- a/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx @@ -490,9 +490,10 @@ void TransformationGUI_MultiTranslationDlg::LineEditReturnPressed() void TransformationGUI_MultiTranslationDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); + connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), + this, SLOT( SelectionIntoArgument() ) ); - // reinit, because some selected objects could be removed - Init(); + ConstructorsClicked( getConstructorId() ); } //================================================================================= diff --git a/src/TransformationGUI/TransformationGUI_PositionDlg.cxx b/src/TransformationGUI/TransformationGUI_PositionDlg.cxx index 7fcac82a4..4451aebed 100644 --- a/src/TransformationGUI/TransformationGUI_PositionDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_PositionDlg.cxx @@ -371,9 +371,10 @@ void TransformationGUI_PositionDlg::LineEditReturnPressed() void TransformationGUI_PositionDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); + connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), + this, SLOT( SelectionIntoArgument() ) ); - // reinit, because some selected objects could be removed - Init(); + ConstructorsClicked( getConstructorId() ); } //================================================================================= diff --git a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx index eb4d0703c..5b51ac419 100644 --- a/src/TransformationGUI/TransformationGUI_RotationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_RotationDlg.cxx @@ -449,9 +449,10 @@ void TransformationGUI_RotationDlg::LineEditReturnPressed() void TransformationGUI_RotationDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); + connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), + this, SLOT( SelectionIntoArgument() ) ); - // reinit, because some selected objects could be removed - Init(); + ConstructorsClicked( getConstructorId() ); } //================================================================================= diff --git a/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx b/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx index f9c28818b..c479b6445 100644 --- a/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_ScaleDlg.cxx @@ -410,9 +410,10 @@ void TransformationGUI_ScaleDlg::LineEditReturnPressed() void TransformationGUI_ScaleDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); + connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), + this, SLOT( SelectionIntoArgument() ) ); - // reinit, because some selected objects could be removed - Init(); + ConstructorsClicked( getConstructorId() ); } //================================================================================= diff --git a/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx b/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx index f47bb590d..1ce1d3874 100644 --- a/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_TranslationDlg.cxx @@ -479,9 +479,10 @@ void TransformationGUI_TranslationDlg::LineEditReturnPressed() void TransformationGUI_TranslationDlg::ActivateThisDialog() { GEOMBase_Skeleton::ActivateThisDialog(); + connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), + this, SLOT( SelectionIntoArgument() ) ); - // reinit, because some selected objects could be removed - Init(); + ConstructorsClicked( getConstructorId() ); } //=================================================================================