diff --git a/src/Mod/Inspection/Gui/VisualInspection.cpp b/src/Mod/Inspection/Gui/VisualInspection.cpp
index 8ad958036..d5b353eb7 100644
--- a/src/Mod/Inspection/Gui/VisualInspection.cpp
+++ b/src/Mod/Inspection/Gui/VisualInspection.cpp
@@ -89,9 +89,9 @@ VisualInspection::VisualInspection(QWidget* parent, Qt::WindowFlags fl)
//FIXME: Not used yet
ui->textLabel2->hide();
- ui->prefFloatSpinBox2->hide();
- ui->prefFloatSpinBox1->setDecimals(Base::UnitsApi::getDecimals());
- ui->prefFloatSpinBox2->setDecimals(Base::UnitsApi::getDecimals());
+ ui->thickness->hide();
+ ui->searchRadius->setUnit(Base::Unit::Length);
+ ui->thickness->setUnit(Base::Unit::Length);
App::Document* doc = App::GetApplication().getActiveDocument();
// disable Ok button and enable of at least one item in each view is on
@@ -147,14 +147,27 @@ VisualInspection::~VisualInspection()
void VisualInspection::loadSettings()
{
- ui->prefFloatSpinBox1->onRestore();
- ui->prefFloatSpinBox2->onRestore();
+ ParameterGrp::handle handle = App::GetApplication().GetParameterGroupByPath
+ ("User parameter:BaseApp/Preferences/Mod/Inspection/Inspection");
+
+ double searchDistance = ui->searchRadius->value().getValue();
+ searchDistance = handle->GetFloat("SearchDistance", searchDistance);
+ ui->searchRadius->setValue(searchDistance);
+
+ double thickness = ui->thickness->value().getValue();
+ thickness = handle->GetFloat("Thickness", thickness);
+ ui->thickness->setValue(thickness);
}
void VisualInspection::saveSettings()
{
- ui->prefFloatSpinBox1->onSave();
- ui->prefFloatSpinBox2->onSave();
+ ParameterGrp::handle handle = App::GetApplication().GetParameterGroupByPath
+ ("User parameter:BaseApp/Preferences/Mod/Inspection/Inspection");
+ double searchDistance = ui->searchRadius->value().getValue();
+ handle->SetFloat("SearchDistance", searchDistance);
+
+ double thickness = ui->thickness->value().getValue();
+ handle->SetFloat("Thickness", thickness);
}
void VisualInspection::onActivateItem(QTreeWidgetItem* item)
@@ -204,8 +217,8 @@ void VisualInspection::accept()
nominalNames << sel->data(0, Qt::UserRole).toString();
}
- float searchRadius = ui->prefFloatSpinBox1->value();
- float thickness = ui->prefFloatSpinBox2->value();
+ double searchRadius = ui->searchRadius->value().getValue();
+ double thickness = ui->thickness->value().getValue();
// open a new command
Gui::Document* doc = Gui::Application::Instance->activeDocument();
diff --git a/src/Mod/Inspection/Gui/VisualInspection.ui b/src/Mod/Inspection/Gui/VisualInspection.ui
index d00078dd1..74f37e883 100644
--- a/src/Mod/Inspection/Gui/VisualInspection.ui
+++ b/src/Mod/Inspection/Gui/VisualInspection.ui
@@ -6,7 +6,7 @@
0
0
- 540
+ 568
406
@@ -89,7 +89,7 @@
Qt::Horizontal
- QSizePolicy::Expanding
+ QSizePolicy::Preferred
@@ -108,16 +108,19 @@
6
-
-
-
- mm
-
-
- 3
+
+
+ mm
0.100000000000000
+
+ mm
+
+
+ 3
+
Thickness
@@ -134,16 +137,22 @@
-
-
-
- mm
+
+
+ mm
-
- 3
+
+ 0.100000000000000
0.050000000000000
+
+ mm
+
+
+ 3
+
SearchDistance
@@ -165,7 +174,7 @@
Qt::Horizontal
- QSizePolicy::Expanding
+ QSizePolicy::Preferred
@@ -181,7 +190,7 @@
Qt::Horizontal
- QSizePolicy::Expanding
+ QSizePolicy::Preferred
@@ -208,14 +217,14 @@
- Gui::PrefDoubleSpinBox
- QDoubleSpinBox
-
+ Gui::QuantitySpinBox
+ QWidget
+
- prefFloatSpinBox1
- prefFloatSpinBox2
+ searchRadius
+ thickness
diff --git a/src/Mod/Mesh/Gui/DlgSettingsImportExportImp.cpp b/src/Mod/Mesh/Gui/DlgSettingsImportExportImp.cpp
index 510e061ef..c03988c0a 100644
--- a/src/Mod/Mesh/Gui/DlgSettingsImportExportImp.cpp
+++ b/src/Mod/Mesh/Gui/DlgSettingsImportExportImp.cpp
@@ -43,7 +43,7 @@ DlgSettingsImportExport::~DlgSettingsImportExport()
void DlgSettingsImportExport::saveSettings()
{
ParameterGrp::handle handle = App::GetApplication().GetParameterGroupByPath
- ("User parameter:BaseApp/Preferences/Mod/Mesh/");
+ ("User parameter:BaseApp/Preferences/Mod/Mesh");
double value = ui->maxDeviationExport->value().getValue();
handle->SetFloat("MaxDeviationExport", value);
}
@@ -51,7 +51,7 @@ void DlgSettingsImportExport::saveSettings()
void DlgSettingsImportExport::loadSettings()
{
ParameterGrp::handle handle = App::GetApplication().GetParameterGroupByPath
- ("User parameter:BaseApp/Preferences/Mod/Mesh/");
+ ("User parameter:BaseApp/Preferences/Mod/Mesh");
double value = ui->maxDeviationExport->value().getValue();
value = handle->GetFloat("MaxDeviationExport", value);
ui->maxDeviationExport->setValue(value);