X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_PrecisionDlg.cxx;h=b589e15d33be3b8ccaf626db96474daab8bf45e1;hp=5024a235edc4b8fc712a5a1947610112e5623582;hb=365fd031c5276a039c84fcb1aaa335a40f77c7a7;hpb=c38c10811a065cf5b13e8807ed71864d92ca7d80 diff --git a/src/SMESHGUI/SMESHGUI_PrecisionDlg.cxx b/src/SMESHGUI/SMESHGUI_PrecisionDlg.cxx index 5024a235e..b589e15d3 100755 --- a/src/SMESHGUI/SMESHGUI_PrecisionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_PrecisionDlg.cxx @@ -29,7 +29,9 @@ #include "SMESHGUI.h" #include "SMESHGUI_VTKUtils.h" +#include "SMESHGUI_Utils.h" +#include "SUIT_Desktop.h" #include "SUIT_ResourceMgr.h" #include @@ -53,9 +55,10 @@ // name : SMESHGUI_PrecisionDlg::SMESHGUI_PrecisionDlg // Purpose : Constructor //======================================================================= -SMESHGUI_PrecisionDlg::SMESHGUI_PrecisionDlg (QWidget* theParent) - : QDialog(theParent, "SMESHGUI_PrecisionDlg", true, - WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu) +SMESHGUI_PrecisionDlg::SMESHGUI_PrecisionDlg ( SMESHGUI* theModule ) + : QDialog( SMESH::GetDesktop( theModule ), "SMESHGUI_PrecisionDlg", true, + WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu ), + mySMESHGUI( theModule ) { setCaption(tr("CAPTION")); @@ -129,9 +132,9 @@ void SMESHGUI_PrecisionDlg::Init() { bool isOk = false; int aVal = DEFAULT_VAL; - SUIT_ResourceMgr* mgr = SMESHGUI::resourceMgr(); - if (mgr && mgr->hasValue("SMESH", "ControlsPrecision")) { - QString aStr = mgr->stringValue("SMESH", "ControlsPrecision"); + SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI ); + if (mgr && mgr->hasValue("SMESH", "controls_precision")) { + QString aStr = mgr->stringValue("SMESH", "controls_precision"); aVal = aStr.toInt(&isOk); } @@ -140,9 +143,8 @@ void SMESHGUI_PrecisionDlg::Init() onNotUse(); - SMESHGUI* aSMESHGUI = SMESHGUI::GetSMESHGUI(); - aSMESHGUI->SetActiveDialogBox((QDialog*)this); - connect(aSMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose())); + mySMESHGUI->SetActiveDialogBox((QDialog*)this); + connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose())); } //======================================================================= @@ -151,23 +153,23 @@ void SMESHGUI_PrecisionDlg::Init() //======================================================================= void SMESHGUI_PrecisionDlg::onOk() { - SUIT_ResourceMgr* mgr = SMESHGUI::resourceMgr(); + SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI ); if (myNotUseChk->isChecked()) { if (mgr) { - mgr->remove("SMESH", "ControlsPrecision"); + mgr->remove("SMESH", "controls_precision"); } SMESH::SetControlsPrecision(-1); } else { mySpinBox->clearFocus(); int aVal = mySpinBox->value(); if (mgr) { - mgr->setValue("SMESH", "ControlsPrecision", QString("%1").arg(aVal)); + mgr->setValue("SMESH", "controls_precision", QString("%1").arg(aVal)); } SMESH::SetControlsPrecision(aVal); } - disconnect(SMESHGUI::GetSMESHGUI(), 0, this, 0); - SMESHGUI::GetSMESHGUI()->ResetState() ; + disconnect(mySMESHGUI, 0, this, 0); + mySMESHGUI->ResetState() ; accept(); } @@ -177,7 +179,7 @@ void SMESHGUI_PrecisionDlg::onOk() //======================================================================= void SMESHGUI_PrecisionDlg::onClose() { - disconnect(SMESHGUI::GetSMESHGUI(), 0, this, 0); + disconnect( mySMESHGUI, 0, this, 0); reject(); }