Salome HOME
Fix for bug PAL12858(EDF210 GEOM Preferences menu of GEOM: color of the wireframe?)
[modules/geom.git] / src / RepairGUI / RepairGUI_GlueDlg.cxx
index 52572ac82170e56976e1203357b893446d34e0b5..bcdb30715cbc295b3ff5c9d8a21b90374c531008 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
 //
 //
 //
 //  Module : GEOM
 //  $Header$
 
-using namespace std;
 #include "RepairGUI_GlueDlg.h"
 #include "DlgRef_1Sel_Ext.h"
 #include "GEOMImpl_Types.hxx"
 
 #include "QtxDblSpinBox.h"
 #include "SalomeApp_Application.h"
-#include "SalomeApp_SelectionMgr.h"
+#include "LightApp_SelectionMgr.h"
 #include "SalomeApp_Study.h"
 #include "SalomeApp_Tools.h"
+
 #include "SUIT_Session.h"
 #include "SUIT_MessageBox.h"
+#include "SUIT_OverrideCursor.h"
 
 #include "SALOME_ListIteratorOfListIO.hxx"
 
@@ -46,10 +47,9 @@ using namespace std;
 #include <qapplication.h>
 #include <qlabel.h>
 
-#define DEFAULT_TOLERANCE_VALUE 1e-07
-
-
+using namespace std;
 
+#define DEFAULT_TOLERANCE_VALUE 1e-07
 
 //=================================================================================
 // class    : RepairGUI_GlueDlg()
@@ -58,11 +58,13 @@ using namespace std;
 //            The dialog will by default be modeless, unless you set 'modal' to
 //            TRUE to construct a modal dialog.
 //=================================================================================
-RepairGUI_GlueDlg::RepairGUI_GlueDlg(QWidget* parent, const char* name, bool modal, WFlags fl)
-  :GEOMBase_Skeleton(parent, name, modal, WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+RepairGUI_GlueDlg::RepairGUI_GlueDlg(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(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_GLUE_FACES")));
-  QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
+  QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_DLG_GLUE_FACES")));
+  QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM",tr("ICON_SELECT")));
 
   setCaption(tr("GEOM_GLUE_TITLE"));
 
@@ -82,7 +84,7 @@ RepairGUI_GlueDlg::RepairGUI_GlueDlg(QWidget* parent, const char* name, bool mod
 
   QGridLayout* aLay = new QGridLayout( 0, 2, 2, 0, 6, "aLay" );
   QLabel* aLbl1 = new QLabel( tr( "GEOM_TOLERANCE" ), GroupPoints->GroupBox1 );
-  myTolEdt = new QtxDblSpinBox( 0, 100, 1e-7, GroupPoints->GroupBox1 );//QAD_SpinBoxDbl( GroupPoints->GroupBox1, 0, 100, 1e-7, 10, 1e-10 );
+  myTolEdt = new QtxDblSpinBox( 0, 100, 1e-7, GroupPoints->GroupBox1 );
   myTolEdt->setPrecision( 10 );
   myTolEdt->setValue( DEFAULT_TOLERANCE_VALUE );
 
@@ -92,6 +94,8 @@ RepairGUI_GlueDlg::RepairGUI_GlueDlg(QWidget* parent, const char* name, bool mod
   GroupPoints->getGroupBoxLayout()->addLayout( aLay, 3, 0 );
   /***************************************************************/
 
+  setHelpFileName("glue_faces.htm");
+
   Init();
 }
 
@@ -120,10 +124,6 @@ void RepairGUI_GlueDlg::Init()
   globalSelection( GEOM_COMPOUND );
 
   /* signals and slots connections */
-  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
-  connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
-  connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
-
   connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
   connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
 
@@ -148,7 +148,6 @@ void RepairGUI_GlueDlg::ClickOnOk()
 }
 
 
-
 //=================================================================================
 // function : ClickOnApply()
 // purpose  :
@@ -169,16 +168,6 @@ bool RepairGUI_GlueDlg::ClickOnApply()
 }
 
 
-//=================================================================================
-// function : ClickOnCancel()
-// purpose  :
-//=================================================================================
-void RepairGUI_GlueDlg::ClickOnCancel()
-{
-  GEOMBase_Skeleton::ClickOnCancel();
-}
-
-
 //=================================================================================
 // function : SelectionIntoArgument()
 // purpose  : Called when selection
@@ -226,17 +215,6 @@ void RepairGUI_GlueDlg::LineEditReturnPressed()
 }
 
 
-//=================================================================================
-// function : DeactivateActiveDialog()
-// purpose  :
-//=================================================================================
-void RepairGUI_GlueDlg::DeactivateActiveDialog()
-{
-  //myGeomGUI->SetState( -1 );
-  GEOMBase_Skeleton::DeactivateActiveDialog();
-}
-
-
 //=================================================================================
 // function : ActivateThisDialog()
 // purpose  :
@@ -375,14 +353,15 @@ bool RepairGUI_GlueDlg::onAcceptLocal( const bool publish, const bool useTransac
 
   try {
     if ( ( !publish && !useTransaction ) || openCommand() ) {
-      QApplication::setOverrideCursor( Qt::waitCursor );
+
+      SUIT_OverrideCursor wc;
+
       SUIT_Session::session()->activeApplication()->putInfo( "" );
       ObjectList objects;
       // JFA 28.12.2004 if ( !execute( objects ) || !getOperation()->IsDone() ) {
       if ( !execute( objects ) ) { // JFA 28.12.2004 // To enable warnings
-       while( QApplication::overrideCursor() ) 
-         QApplication::restoreOverrideCursor(); 
-       abortCommand();
+       wc.suspend();
+        abortCommand();
        showError();
       }
       else {
@@ -423,9 +402,8 @@ bool RepairGUI_GlueDlg::onAcceptLocal( const bool publish, const bool useTransac
         // JFA 28.12.2004 BEGIN // To enable warnings
         if ( !getOperation()->_is_nil() ) {
           if ( !getOperation()->IsDone() ) {
-           while( QApplication::overrideCursor() ) 
-             QApplication::restoreOverrideCursor();
-            QString msgw = QObject::tr( getOperation()->GetErrorCode() );
+            wc.suspend();
+           QString msgw = QObject::tr( getOperation()->GetErrorCode() );
             SUIT_MessageBox::warn1((QWidget*)(SUIT_Session::session()->activeApplication()->desktop()),
                                   QObject::tr( "WRN_WARNING" ), 
                                   msgw,