X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_DeleteGroupDlg.cxx;h=90f42d96ab702073ce87a1f798e7d30781dd10db;hb=96874fc4b6eeeec6b368ffefca982d3339de3519;hp=b71866823d94bb66f4c53a70b73f3d233668094d;hpb=c38c10811a065cf5b13e8807ed71864d92ca7d80;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx b/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx index b71866823..90f42d96a 100644 --- a/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx @@ -36,12 +36,14 @@ #include "SUIT_Desktop.h" #include "SalomeApp_Study.h" -#include "SalomeApp_SelectionMgr.h" +#include "LightApp_SelectionMgr.h" -#include "SVTK_Selection.h" #include "SALOME_ListIO.hxx" #include "SALOME_ListIteratorOfListIO.hxx" +#include "SVTK_Selection.h" +#include "SVTK_ViewWindow.h" + // QT Includes #include #include @@ -68,10 +70,13 @@ // function : SMESHGUI_DeleteGroupDlg() // purpose : Constructor //================================================================================= -SMESHGUI_DeleteGroupDlg::SMESHGUI_DeleteGroupDlg (QWidget* theParent, - SalomeApp_SelectionMgr* theSelection) - : QDialog(theParent, "SMESHGUI_DeleteGroupDlg", false, - WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +SMESHGUI_DeleteGroupDlg::SMESHGUI_DeleteGroupDlg (SMESHGUI* theModule): + QDialog(SMESH::GetDesktop(theModule), + "SMESHGUI_DeleteGroupDlg", + false, + WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu), + mySelectionMgr(SMESH::GetSelectionMgr(theModule)), + mySMESHGUI(theModule) { setCaption(tr("CAPTION")); @@ -85,7 +90,7 @@ SMESHGUI_DeleteGroupDlg::SMESHGUI_DeleteGroupDlg (QWidget* theParent, aDlgLay->setStretchFactor(aMainFrame, 1); - Init(theSelection); + Init(); } //================================================================================= @@ -147,30 +152,25 @@ SMESHGUI_DeleteGroupDlg::~SMESHGUI_DeleteGroupDlg() // function : Init() // purpose : Init dialog fields, connect signals and slots, show dialog //================================================================================= -void SMESHGUI_DeleteGroupDlg::Init (SalomeApp_SelectionMgr* theSelection) +void SMESHGUI_DeleteGroupDlg::Init () { myBlockSelection = false; - mySelectionMgr = theSelection; - SMESHGUI* aSMESHGUI = SMESHGUI::GetSMESHGUI(); - aSMESHGUI->SetActiveDialogBox((QDialog*)this); + mySMESHGUI->SetActiveDialogBox((QDialog*)this); // selection and SMESHGUI connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); - connect(aSMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate())); - connect(aSMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose())); + connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate())); + connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose())); int x, y; - aSMESHGUI->DefineDlgPosition(this, x, y); + mySMESHGUI->DefineDlgPosition(this, x, y); this->move(x, y); this->show(); // set selection mode -#ifdef NEW_GUI - mySelectionMgr->setSelectionModes(ActorSelection, true); -#else - mySelectionMgr->setSelectionModes(ActorSelection); -#endif mySelectionMgr->installFilter(new SMESH_TypeFilter(GROUP)); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(ActorSelection); onSelectionDone(); return; @@ -188,7 +188,7 @@ bool SMESHGUI_DeleteGroupDlg::isValid() return false; } - return !SMESHGUI::GetSMESHGUI()->isActiveStudyLocked(); + return !mySMESHGUI->isActiveStudyLocked(); } //================================================================================= @@ -213,7 +213,7 @@ bool SMESHGUI_DeleteGroupDlg::onApply() myListGrp.clear(); mySelectionMgr->clearSelected(); SMESH::UpdateView(); - SMESHGUI::GetSMESHGUI()->updateObjBrowser(true); + mySMESHGUI->updateObjBrowser(true); myBlockSelection = false; return true; @@ -235,10 +235,11 @@ void SMESHGUI_DeleteGroupDlg::onOk() //================================================================================= void SMESHGUI_DeleteGroupDlg::onClose() { - mySelectionMgr->setSelectionModes(ActorSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(ActorSelection); disconnect(mySelectionMgr, 0, this, 0); - disconnect(SMESHGUI::GetSMESHGUI(), 0, this, 0); - SMESHGUI::GetSMESHGUI()->ResetState(); + disconnect(mySMESHGUI, 0, this, 0); + mySMESHGUI->ResetState(); mySelectionMgr->clearFilters(); reject(); } @@ -287,13 +288,10 @@ void SMESHGUI_DeleteGroupDlg::onDeactivate() //================================================================================= void SMESHGUI_DeleteGroupDlg::enterEvent (QEvent*) { - SMESHGUI::GetSMESHGUI()->EmitSignalDeactivateDialog(); + mySMESHGUI->EmitSignalDeactivateDialog(); setEnabled(true); -#ifdef NEW_GUI - mySelectionMgr->setSelectionModes(ActorSelection, true); -#else - mySelectionMgr->setSelectionModes(ActorSelection); -#endif + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(ActorSelection); mySelectionMgr->installFilter(new SMESH_TypeFilter (GROUP)); }