Salome HOME
Fix bug 10955: Collisions with 'Ctrl+I' and 'Ctrl+M' hot keys.
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_Preferences_ColorDlg.cxx
index abe998f850bbe163ed578df544f8ebe263ba44e0..cef1b66eb2b4924195d6701e27fe1c1286fd4fec 100644 (file)
@@ -28,6 +28,7 @@
 
 #include "SMESHGUI_Preferences_ColorDlg.h"
 #include "SMESHGUI.h"
+#include "SMESHGUI_Utils.h"
 
 #include "utilities.h"
 
@@ -44,6 +45,8 @@
 #include <qspinbox.h>
 #include <qcolor.h>
 
+#include "SUIT_Desktop.h"
+
 using namespace std;
 
 //=================================================================================
@@ -53,10 +56,10 @@ using namespace std;
 //            The dialog will by default be modeless, unless you
 //            set'modal' to TRUE to construct a modal dialog.
 //=================================================================================
-SMESHGUI_Preferences_ColorDlg::SMESHGUI_Preferences_ColorDlg (QWidget* parent,
-                                                              const char* name)
-     : QDialog(parent, name, true, WStyle_Customize |
-               WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu)
+SMESHGUI_Preferences_ColorDlg::SMESHGUI_Preferences_ColorDlg( SMESHGUI* theModule, const char* name)
+     : QDialog( SMESH::GetDesktop( theModule ), name, true, WStyle_Customize |
+                WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ),
+    mySMESHGUI( theModule )
 {
     if (!name)
        setName("SMESHGUI_Preferences_ColorDlg");
@@ -182,7 +185,6 @@ SMESHGUI_Preferences_ColorDlg::~SMESHGUI_Preferences_ColorDlg()
 //=================================================================================
 void SMESHGUI_Preferences_ColorDlg::Init()
 {
-  mySMESHGUI = SMESHGUI::GetSMESHGUI();
   mySMESHGUI->SetActiveDialogBox((QDialog*)this);
 
   /* signals and slots connections */
@@ -197,11 +199,6 @@ void SMESHGUI_Preferences_ColorDlg::Init()
   connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
   /* to close dialog if study change */
   connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
-
-  /* Move widget on the botton right corner of main widget */
-  int x, y;
-  mySMESHGUI->DefineDlgPosition(this, x, y);
-  this->move(x, y);
 }
 
 //=================================================================================