From b9918993a178cb487a59f51cf16d9888d1a0fc9d Mon Sep 17 00:00:00 2001 From: ana Date: Mon, 28 Feb 2011 14:52:52 +0000 Subject: [PATCH] Fix for the bug IPAL22277: Crash on "Find elements by point" dialog box --- src/SMESHGUI/SMESHGUI.cxx | 4 ++-- src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx | 25 ++++++++++++++++++++ src/SMESHGUI/SMESHGUI_FindElemByPointDlg.h | 8 +++++++ 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index b32af3681..e99e2b787 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -3766,7 +3766,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createPopupItem( 900, OB, mesh_group ); // ADV_INFO //createPopupItem( 902, OB, mesh ); // STD_INFO createPopupItem( 903, OB, mesh_group ); // WHAT_IS - createPopupItem( 904, OB, mesh_group ); // FIND_ELEM + createPopupItem( 904, OB, mesh ); // FIND_ELEM popupMgr()->insert( separator(), -1, 0 ); createPopupItem( 801, OB, mesh ); // CREATE_GROUP createPopupItem( 806, OB, mesh ); // CREATE_GEO_GROUP @@ -3802,7 +3802,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createPopupItem( 900, View, mesh_group ); // ADV_INFO //createPopupItem( 902, View, mesh ); // STD_INFO createPopupItem( 903, View, mesh_group ); // WHAT_IS - createPopupItem( 904, View, mesh_group ); // FIND_ELEM + createPopupItem( 904, View, mesh ); // FIND_ELEM popupMgr()->insert( separator(), -1, 0 ); createPopupItem( 1136, OB + " " + View, mesh, "&& (not isAutoColor)" ); // AUTO_COLOR diff --git a/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx b/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx index a0888e3ff..ac6d9f3a9 100644 --- a/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx @@ -213,6 +213,7 @@ SMESHGUI_FindElemByPointOp::SMESHGUI_FindElemByPointOp() connect(myDlg->myZ, SIGNAL(valueChanged(double)), this, SLOT(redisplayPreview())); connect(myDlg->myFoundList, SIGNAL(itemSelectionChanged()), this, SLOT(onElemSelected())); connect(myDlg->myElemTypeCombo,SIGNAL(currentIndexChanged(int)),this, SLOT(onElemTypeChange(int))); + connect(myDlg, SIGNAL(rejectedDlg()), this, SLOT(onRejectedDlg())); } //======================================================================= @@ -305,6 +306,29 @@ void SMESHGUI_FindElemByPointOp::onElemTypeChange(int index) myDlg->myFoundList->clear(); } +//================================================================================ +/*! + * \brief Method needed for internal cuisine + */ +//================================================================================ + +void SMESHGUI_FindElemByPointDlg::reject() +{ + emit rejectedDlg(); + QtxDialog::reject(); +} + +//================================================================================ +/*! + * \brief Method needed for internal cuisine + */ +//================================================================================ + +void SMESHGUI_FindElemByPointOp::onRejectedDlg() +{ + myMeshIO.Nullify(); +} + //================================================================================ /*! * \brief perform it's intention action: find elements @@ -351,6 +375,7 @@ void SMESHGUI_FindElemByPointOp::onFind() bool SMESHGUI_FindElemByPointOp::onApply() { + onRejectedDlg(); return true; } diff --git a/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.h b/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.h index 72ecaeb7b..9dd1f8ef6 100644 --- a/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.h +++ b/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.h @@ -62,6 +62,8 @@ protected slots: virtual bool onApply(); private slots: + + void onRejectedDlg(); void onSelectionDone(); void onElemSelected(); void onElemTypeChange(int); @@ -104,6 +106,12 @@ private: friend class SMESHGUI_FindElemByPointOp; +signals: + void rejectedDlg(); + +protected slots: + virtual void reject(); + private slots: //void ButtonToggled( bool ); }; -- 2.39.2