Salome HOME
Fix for PAL6826.
[modules/geom.git] / src / BuildGUI / BuildGUI_WireDlg.cxx
index f7f52d8ad992d928bfbf4ffc431f9f4022a0c96d..4c9da598a08064b07d2e680bfb08fc46cf858e16 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
 //  $Header$
 
 #include "BuildGUI_WireDlg.h"
-#include "QAD_Desktop.h"
 #include "GEOMImpl_Types.hxx"
 
+#include "SUIT_Session.h"
+#include "SalomeApp_Application.h"
+#include "LightApp_SelectionMgr.h"
+
+#include "TColStd_MapOfInteger.hxx"
+
+#include <qlabel.h>
+
 //=================================================================================
 // class    : BuildGUI_WireDlg()
 // purpose  : Constructs a BuildGUI_WireDlg which is a child of 'parent', with the 
 //            The dialog will by default be modeless, unless you set 'modal' to
 //            TRUE to construct a modal dialog.
 //=================================================================================
-BuildGUI_WireDlg::BuildGUI_WireDlg(QWidget* parent, const char* name, SALOME_Selection* Sel, bool modal, WFlags fl)
-  :GEOMBase_Skeleton(parent, name, Sel, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+BuildGUI_WireDlg::BuildGUI_WireDlg(GeometryGUI* theGeometryGUI, QWidget* parent,
+                                   const char* name, bool modal, WFlags fl)
+  :GEOMBase_Skeleton(theGeometryGUI, parent, name, modal, WStyle_Customize |
+                     WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
 {
-  QPixmap image0(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_DLG_BUILD_WIRE")));
-  QPixmap image1(QAD_Desktop::getResourceManager()->loadPixmap("GEOM",tr("ICON_SELECT")));
+  QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_BUILD_WIRE")));
+  QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
 
   setCaption(tr("GEOM_WIRE_TITLE"));
 
@@ -60,6 +69,8 @@ BuildGUI_WireDlg::BuildGUI_WireDlg(QWidget* parent, const char* name, SALOME_Sel
   Layout1->addWidget(GroupPoints, 2, 0);
   /***************************************************************/
 
+  setHelpFileName("wire.htm");
+
   /* Initialisations */
   Init();
 }
@@ -96,8 +107,9 @@ void BuildGUI_WireDlg::Init()
   connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
   connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
   connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
-  connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
-
+  connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 
+         SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
+  
   initName(tr("GEOM_WIRE"));
 }
 
@@ -137,14 +149,14 @@ void BuildGUI_WireDlg::SelectionIntoArgument()
   QString aString = ""; /* name of selection */
 
   myOkEdgesAndWires = false;
-  int nbSel = GEOMBase::GetNameOfSelectedIObjects(mySelection, aString);
+  int nbSel = GEOMBase::GetNameOfSelectedIObjects(selectedIO(), aString);
 
   if(nbSel == 0)
     return;
   if(nbSel != 1)
     aString = tr("%1_objects").arg(nbSel);
 
-  GEOMBase::ConvertListOfIOInListOfGO(mySelection->StoredIObjects(),  myEdgesAndWires);
+  GEOMBase::ConvertListOfIOInListOfGO(selectedIO(),  myEdgesAndWires);
   if (!myEdgesAndWires.length())
     return;
 
@@ -181,7 +193,8 @@ void BuildGUI_WireDlg::SetEditCurrentArgument()
 void BuildGUI_WireDlg::ActivateThisDialog()
 {
   GEOMBase_Skeleton::ActivateThisDialog();
-  connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+  connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 
+         SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
   TColStd_MapOfInteger aMap;
   aMap.Add(GEOM_WIRE);
   aMap.Add(GEOM_EDGE);