Salome HOME
Updated for PAL14857.
[modules/geom.git] / src / BlocksGUI / BlocksGUI_BlockDlg.cxx
index 888ee3a63eac13c6cd3cbfbb7ca2e58f3430b50a..cc7876a36c735be1fb18ac964b99a8c1069a5d16 100644 (file)
@@ -16,7 +16,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.salome-platform.org or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
 
 #include "BlocksGUI_BlockDlg.h"
 
-#include "QAD_Desktop.h"
+#include "SUIT_Session.h"
+#include "SalomeApp_Application.h"
+#include "LightApp_SelectionMgr.h"
 
 #include "GEOMImpl_Types.hxx"
 
 using namespace std;
 
+#include <qlabel.h>
+
 //=================================================================================
 // class    : BlocksGUI_BlockDlg()
 // purpose  : Constructs a BlocksGUI_BlockDlg which is a child of 'parent'.
 //=================================================================================
-BlocksGUI_BlockDlg::BlocksGUI_BlockDlg (QWidget* parent,
-                                        SALOME_Selection* Sel,
-                                        bool modal)
-     : GEOMBase_Skeleton(parent, "BlockDlg", Sel, modal,
+BlocksGUI_BlockDlg::BlocksGUI_BlockDlg (GeometryGUI* theGeometryGUI, QWidget* parent, bool modal)
+     : GEOMBase_Skeleton(theGeometryGUI, parent, "BlockDlg", modal,
                          WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
 {
-  QPixmap image0 (QAD_Desktop::getResourceManager()->loadPixmap("GEOM", tr("ICON_DLG_BLOCK_2F")));
-  QPixmap image1 (QAD_Desktop::getResourceManager()->loadPixmap("GEOM", tr("ICON_DLG_BLOCK_6F")));
-  QPixmap imageS (QAD_Desktop::getResourceManager()->loadPixmap("GEOM", tr("ICON_SELECT")));
+  QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BLOCK_2F")));
+  QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_BLOCK_6F")));
+  QPixmap imageS (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT")));
 
   setCaption(tr("GEOM_BLOCK_TITLE"));
 
@@ -85,6 +87,8 @@ BlocksGUI_BlockDlg::BlocksGUI_BlockDlg (QWidget* parent,
   Layout1->addWidget(Group6F, 2, 0);
   /***************************************************************/
 
+  setHelpFileName("newentity_blocks.htm#HexahedralSolid");
+
   Init();
 }
 
@@ -129,7 +133,8 @@ void BlocksGUI_BlockDlg::Init()
   connect(Group6F->PushButton5, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
   connect(Group6F->PushButton6, 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())) ;
 
   // init controls and fields
   initName(tr("GEOM_BLOCK"));
@@ -182,7 +187,8 @@ void BlocksGUI_BlockDlg::ConstructorsClicked (int constructorId)
 
   globalSelection(GEOM_FACE);
   SelectionIntoArgument();
-//  connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+  connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 
+         SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
 }
 
 //=================================================================================
@@ -217,7 +223,7 @@ void BlocksGUI_BlockDlg::SelectionIntoArgument()
   erasePreview();
   myEditCurrentArgument->setText("");
 
-  if (mySelection->IObjectCount() != 1)
+  if (IObjectCount() != 1)
   {
     if (myEditCurrentArgument == Group2F->LineEdit1 ||
         myEditCurrentArgument == Group6F->LineEdit1)
@@ -239,7 +245,7 @@ void BlocksGUI_BlockDlg::SelectionIntoArgument()
   // nbSel == 1
   Standard_Boolean testResult = Standard_False;
   GEOM::GEOM_Object_var aSelectedObject =
-    GEOMBase::ConvertIOinGEOMObject( mySelection->firstIObject(), testResult );
+    GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
 
   if (!testResult || CORBA::is_nil( aSelectedObject ))
     return;
@@ -304,7 +310,8 @@ void BlocksGUI_BlockDlg::SetEditCurrentArgument()
 void BlocksGUI_BlockDlg::ActivateThisDialog()
 {
   GEOMBase_Skeleton::ActivateThisDialog();
-  connect(mySelection, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+  connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 
+         SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
 
   globalSelection(GEOM_FACE);
 
@@ -321,15 +328,6 @@ void BlocksGUI_BlockDlg::enterEvent (QEvent* e)
     ActivateThisDialog();
 }
 
-//=================================================================================
-// function : DeactivateActiveDialog()
-// purpose  : public slot to deactivate if active
-//=================================================================================
-//void BlocksGUI_BlockDlg::DeactivateActiveDialog()
-//{
-//  GEOMBase_Skeleton::DeactivateActiveDialog();
-//}
-
 //=================================================================================
 // function : createOperation
 // purpose  :