#include "SMESHGUI.h"
#include "SMESHGUI_VTKUtils.h"
+#include "SMESHGUI_Utils.h"
+#include "SUIT_Desktop.h"
#include "SUIT_ResourceMgr.h"
#include <qgroupbox.h>
// 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"));
{
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);
}
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()));
}
//=======================================================================
//=======================================================================
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();
}
//=======================================================================
void SMESHGUI_PrecisionDlg::onClose()
{
- disconnect(SMESHGUI::GetSMESHGUI(), 0, this, 0);
+ disconnect( mySMESHGUI, 0, this, 0);
reject();
}