From 1be2d39839d8362734a25d8078f2d4b20a86a4b5 Mon Sep 17 00:00:00 2001 From: dmv Date: Mon, 24 May 2010 07:55:16 +0000 Subject: [PATCH] IPAL21695 TC5.1.4: GEOM Dialogs Behavior --- src/BasicGUI/BasicGUI_CircleDlg.cxx | 1 + src/BasicGUI/BasicGUI_CurveDlg.cxx | 4 ++++ src/BasicGUI/BasicGUI_EllipseDlg.cxx | 3 ++- src/BasicGUI/BasicGUI_LineDlg.cxx | 1 - src/BasicGUI/BasicGUI_PlaneDlg.cxx | 1 + src/BasicGUI/BasicGUI_VectorDlg.cxx | 1 + src/BuildGUI/BuildGUI_FaceDlg.cxx | 1 + src/BuildGUI/BuildGUI_ShellDlg.cxx | 2 +- src/BuildGUI/BuildGUI_WireDlg.cxx | 1 + src/OperationGUI/OperationGUI_FilletDlg.cxx | 1 + src/OperationGUI/OperationGUI_PartitionDlg.cxx | 1 + src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx | 17 +++-------------- src/PrimitiveGUI/PrimitiveGUI_BoxDlg.h | 3 --- src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx | 13 +++---------- src/PrimitiveGUI/PrimitiveGUI_ConeDlg.h | 3 --- src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx | 15 ++------------- src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx | 18 +++--------------- src/PrimitiveGUI/PrimitiveGUI_DiskDlg.h | 3 --- src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx | 1 + src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx | 18 +++--------------- src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h | 3 --- .../TransformationGUI_OffsetDlg.cxx | 1 + 22 files changed, 30 insertions(+), 82 deletions(-) diff --git a/src/BasicGUI/BasicGUI_CircleDlg.cxx b/src/BasicGUI/BasicGUI_CircleDlg.cxx index 256d235b1..119176c59 100644 --- a/src/BasicGUI/BasicGUI_CircleDlg.cxx +++ b/src/BasicGUI/BasicGUI_CircleDlg.cxx @@ -271,6 +271,7 @@ void BasicGUI_CircleDlg::ConstructorsClicked( int constructorId ) qApp->processEvents(); updateGeometry(); resize( minimumSizeHint() ); + SelectionIntoArgument(); myEditCurrentArgument->setFocus(); globalSelection(); // close local contexts, if any diff --git a/src/BasicGUI/BasicGUI_CurveDlg.cxx b/src/BasicGUI/BasicGUI_CurveDlg.cxx index 6804419db..b1c6f000f 100644 --- a/src/BasicGUI/BasicGUI_CurveDlg.cxx +++ b/src/BasicGUI/BasicGUI_CurveDlg.cxx @@ -158,6 +158,10 @@ void BasicGUI_CurveDlg::ConstructorsClicked( int id ) myPoints->length( 0 ); myEditCurrentArgument->setText( "" ); + qApp->processEvents(); + updateGeometry(); + resize( minimumSizeHint() ); + SelectionIntoArgument(); } diff --git a/src/BasicGUI/BasicGUI_EllipseDlg.cxx b/src/BasicGUI/BasicGUI_EllipseDlg.cxx index 2bccca6e2..4354cf072 100644 --- a/src/BasicGUI/BasicGUI_EllipseDlg.cxx +++ b/src/BasicGUI/BasicGUI_EllipseDlg.cxx @@ -158,7 +158,8 @@ void BasicGUI_EllipseDlg::Init() initName( tr( "GEOM_ELLIPSE" ) ); - resize(100,100); + resize( minimumSizeHint() ); + SelectionIntoArgument(); displayPreview(); } diff --git a/src/BasicGUI/BasicGUI_LineDlg.cxx b/src/BasicGUI/BasicGUI_LineDlg.cxx index 738971849..9a45c86d4 100644 --- a/src/BasicGUI/BasicGUI_LineDlg.cxx +++ b/src/BasicGUI/BasicGUI_LineDlg.cxx @@ -228,7 +228,6 @@ void BasicGUI_LineDlg::ConstructorsClicked( int constructorId ) qApp->processEvents(); updateGeometry(); resize( minimumSizeHint() ); - SelectionIntoArgument(); } diff --git a/src/BasicGUI/BasicGUI_PlaneDlg.cxx b/src/BasicGUI/BasicGUI_PlaneDlg.cxx index 7cf7ecb45..e6b6f6610 100644 --- a/src/BasicGUI/BasicGUI_PlaneDlg.cxx +++ b/src/BasicGUI/BasicGUI_PlaneDlg.cxx @@ -364,6 +364,7 @@ void BasicGUI_PlaneDlg::ConstructorsClicked( int constructorId ) qApp->processEvents(); updateGeometry(); resize( minimumSizeHint() ); + SelectionIntoArgument(); myEditCurrentArgument->setFocus(); connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), diff --git a/src/BasicGUI/BasicGUI_VectorDlg.cxx b/src/BasicGUI/BasicGUI_VectorDlg.cxx index 3ec36f1a2..97e19c98d 100644 --- a/src/BasicGUI/BasicGUI_VectorDlg.cxx +++ b/src/BasicGUI/BasicGUI_VectorDlg.cxx @@ -231,6 +231,7 @@ void BasicGUI_VectorDlg::ConstructorsClicked( int constructorId ) qApp->processEvents(); updateGeometry(); resize( minimumSizeHint() ); + SelectionIntoArgument(); displayPreview(); } diff --git a/src/BuildGUI/BuildGUI_FaceDlg.cxx b/src/BuildGUI/BuildGUI_FaceDlg.cxx index 6f633d66f..8f204e411 100644 --- a/src/BuildGUI/BuildGUI_FaceDlg.cxx +++ b/src/BuildGUI/BuildGUI_FaceDlg.cxx @@ -116,6 +116,7 @@ void BuildGUI_FaceDlg::Init() SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); initName( tr( "GEOM_FACE" ) ); + SelectionIntoArgument(); } diff --git a/src/BuildGUI/BuildGUI_ShellDlg.cxx b/src/BuildGUI/BuildGUI_ShellDlg.cxx index 6c1b33bf9..3cf46a471 100644 --- a/src/BuildGUI/BuildGUI_ShellDlg.cxx +++ b/src/BuildGUI/BuildGUI_ShellDlg.cxx @@ -111,7 +111,6 @@ void BuildGUI_ShellDlg::Init() QList aSubShapes; aSubShapes.append( GEOM_FACE ); globalSelection( aMap, aSubShapes ); - /* signals and slots connections */ connect( buttonOk(), SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) ); @@ -123,6 +122,7 @@ void BuildGUI_ShellDlg::Init() SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); initName( tr( "GEOM_SHELL" ) ); + SelectionIntoArgument(); } diff --git a/src/BuildGUI/BuildGUI_WireDlg.cxx b/src/BuildGUI/BuildGUI_WireDlg.cxx index 1b930742e..5ecf3efb2 100644 --- a/src/BuildGUI/BuildGUI_WireDlg.cxx +++ b/src/BuildGUI/BuildGUI_WireDlg.cxx @@ -123,6 +123,7 @@ void BuildGUI_WireDlg::Init() SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); initName( tr( "GEOM_WIRE" ) ); + SelectionIntoArgument(); } diff --git a/src/OperationGUI/OperationGUI_FilletDlg.cxx b/src/OperationGUI/OperationGUI_FilletDlg.cxx index 7eb174826..6cd07c94a 100644 --- a/src/OperationGUI/OperationGUI_FilletDlg.cxx +++ b/src/OperationGUI/OperationGUI_FilletDlg.cxx @@ -298,6 +298,7 @@ void OperationGUI_FilletDlg::ConstructorsClicked (int constructorId) qApp->processEvents(); updateGeometry(); resize(minimumSizeHint()); + SelectionIntoArgument(); } //================================================================================= diff --git a/src/OperationGUI/OperationGUI_PartitionDlg.cxx b/src/OperationGUI/OperationGUI_PartitionDlg.cxx index 0b08ae59f..b6fac51c7 100644 --- a/src/OperationGUI/OperationGUI_PartitionDlg.cxx +++ b/src/OperationGUI/OperationGUI_PartitionDlg.cxx @@ -202,6 +202,7 @@ void OperationGUI_PartitionDlg::ConstructorsClicked( int constructorId ) myEditCurrentArgument->setFocus(); connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) ); + SelectionIntoArgument(); } diff --git a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx index f5115bd0e..b797fc1bf 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx @@ -54,8 +54,7 @@ //================================================================================= PrimitiveGUI_BoxDlg::PrimitiveGUI_BoxDlg (GeometryGUI* theGeometryGUI, QWidget* parent, bool modal, Qt::WindowFlags fl) - : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl), - myInitial(true) + : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl) { QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BOX_2P"))); QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BOX_DXYZ"))); @@ -196,15 +195,9 @@ void PrimitiveGUI_BoxDlg::ConstructorsClicked (int constructorId) qApp->processEvents(); updateGeometry(); resize(minimumSizeHint()); + SelectionIntoArgument(); - if (myInitial) { - // on dialog initialization we init the first field with a selected object (if any) - SelectionIntoArgument(); - myInitial = false; - } - else { - displayPreview(); - } + displayPreview(); } //================================================================================= @@ -331,10 +324,6 @@ void PrimitiveGUI_BoxDlg::SetEditCurrentArgument() // clear selection //disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0); - //if (myInitial) - // myInitial = false; - //else - // myGeomGUI->getApp()->selectionMgr()->clearSelected(); if (send == GroupPoints->PushButton1) { myEditCurrentArgument = GroupPoints->LineEdit1; diff --git a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.h b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.h index fab0dc390..bdc8e6af8 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.h +++ b/src/PrimitiveGUI/PrimitiveGUI_BoxDlg.h @@ -58,9 +58,6 @@ private: private: GEOM::GEOM_Object_var myPoint1, myPoint2; /* Points containing the vector */ - // to initialize the first selection field with a selected object on the dialog creation - bool myInitial; - DlgRef_2Sel* GroupPoints; DlgRef_3Spin* GroupDimensions; diff --git a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx index c5ebf0be9..bef1293eb 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx @@ -54,8 +54,7 @@ //================================================================================= PrimitiveGUI_ConeDlg::PrimitiveGUI_ConeDlg (GeometryGUI* theGeometryGUI, QWidget* parent, bool modal, Qt::WindowFlags fl) - : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl), - myInitial(true) + : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl) { QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_CONE_PV"))); QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_CONE_DXYZ"))); @@ -211,15 +210,9 @@ void PrimitiveGUI_ConeDlg::ConstructorsClicked (int constructorId) qApp->processEvents(); updateGeometry(); resize(minimumSizeHint()); + SelectionIntoArgument(); - if (myInitial) { - // on dialog initialization we init the first field with a selected object (if any) - SelectionIntoArgument(); - myInitial = false; - } - else { - displayPreview(); - } + displayPreview(); } //================================================================================= diff --git a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.h b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.h index 0e4d6ad14..abea2e72b 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.h +++ b/src/PrimitiveGUI/PrimitiveGUI_ConeDlg.h @@ -61,9 +61,6 @@ private: private: GEOM::GEOM_Object_var myPoint, myDir; - // to initialize the first selection field with a selected object on the dialog creation - bool myInitial; - DlgRef_2Sel3Spin* GroupPoints; DlgRef_3Spin* GroupDimensions; diff --git a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx index be7685d9f..cea029cf6 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx @@ -202,20 +202,9 @@ void PrimitiveGUI_CylinderDlg::ConstructorsClicked (int constructorId) qApp->processEvents(); updateGeometry(); resize(minimumSizeHint()); + SelectionIntoArgument(); - if (myInitial) { - myInitial = false; - if (constructorId == 0) { - // on dialog initialization we init the first field with a selected object (if any) - SelectionIntoArgument(); - } - else { - displayPreview(); - } - } - else { - displayPreview(); - } + displayPreview(); } //================================================================================= diff --git a/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx index fb23cb4ef..8aa1a6aee 100755 --- a/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx @@ -49,8 +49,7 @@ //================================================================================= PrimitiveGUI_DiskDlg::PrimitiveGUI_DiskDlg (GeometryGUI* theGeometryGUI, QWidget* parent, bool modal, Qt::WindowFlags fl) - : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl), - myInitial(true) + : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl) { SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr(); QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_DISK_PNT_VEC_R"))); @@ -253,20 +252,9 @@ void PrimitiveGUI_DiskDlg::ConstructorsClicked (int constructorId) qApp->processEvents(); updateGeometry(); resize(minimumSizeHint()); + SelectionIntoArgument(); - if (myInitial) { - myInitial = false; - if (constructorId == 1 || constructorId == 2) { - // on dialog initialization we init the first field with a selected object (if any) - SelectionIntoArgument(); - } - else { - displayPreview(); - } - } - else { - displayPreview(); - } + displayPreview(); } //================================================================================= diff --git a/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.h b/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.h index 6e3d3c36d..e7f4e9cc2 100755 --- a/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.h +++ b/src/PrimitiveGUI/PrimitiveGUI_DiskDlg.h @@ -60,9 +60,6 @@ private: private: GEOM::GEOM_Object_var myPoint, myDir, myPoint1, myPoint2, myPoint3; - // to initialize the first selection field with a selected object on the dialog creation - bool myInitial; - DlgRef_2Sel1Spin* GroupPntVecR; DlgRef_3Sel* Group3Pnts; DlgRef_1Spin* GroupDimensions; diff --git a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx index 23fb51375..44dd44ca0 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx @@ -193,6 +193,7 @@ void PrimitiveGUI_SphereDlg::ConstructorsClicked( int constructorId ) qApp->processEvents(); updateGeometry(); resize( minimumSizeHint() ); + SelectionIntoArgument(); displayPreview(); } diff --git a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx index f0253fcc6..f6a47130a 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx @@ -54,8 +54,7 @@ //================================================================================= PrimitiveGUI_TorusDlg::PrimitiveGUI_TorusDlg (GeometryGUI* theGeometryGUI, QWidget* parent, bool modal, Qt::WindowFlags fl) - : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl), - myInitial(true) + : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl) { SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr(); QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_TORUS_PV"))); @@ -201,20 +200,9 @@ void PrimitiveGUI_TorusDlg::ConstructorsClicked (int constructorId) qApp->processEvents(); updateGeometry(); resize(minimumSizeHint()); + SelectionIntoArgument(); - if (myInitial) { - myInitial = false; - if (constructorId == 0) { - // on dialog initialization we init the first field with a selected object (if any) - SelectionIntoArgument(); - } - else { - displayPreview(); - } - } - else { - displayPreview(); - } + displayPreview(); } //================================================================================= diff --git a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h index 9a190dc95..8cc2a57e2 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h +++ b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h @@ -60,9 +60,6 @@ private: private: GEOM::GEOM_Object_var myPoint, myDir; - // to initialize the first selection field with a selected object on the dialog creation - bool myInitial; - DlgRef_2Sel2Spin* GroupPoints; DlgRef_2Spin* GroupDimensions; diff --git a/src/TransformationGUI/TransformationGUI_OffsetDlg.cxx b/src/TransformationGUI/TransformationGUI_OffsetDlg.cxx index 442c8615d..d81792e8f 100644 --- a/src/TransformationGUI/TransformationGUI_OffsetDlg.cxx +++ b/src/TransformationGUI/TransformationGUI_OffsetDlg.cxx @@ -130,6 +130,7 @@ void TransformationGUI_OffsetDlg::Init() globalSelection( GEOM_ALLSHAPES ); resize(100,100); + SelectionIntoArgument(); } -- 2.39.2