Skip to content

Commit

Permalink
+ fixes 0001563: Add units to Linear Pattern in PartDesign
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Jul 22, 2014
1 parent b5b929c commit d2cbd68
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
6 changes: 4 additions & 2 deletions src/Mod/PartDesign/Gui/TaskLinearPatternParameters.cpp
Expand Up @@ -129,9 +129,11 @@ void TaskLinearPatternParameters::setupUI()

ui->comboDirection->setEnabled(true);
ui->checkReverse->setEnabled(true);
ui->spinLength->blockSignals(true);
ui->spinLength->setEnabled(true);
ui->spinLength->setUnit(Base::Unit::Length);
ui->spinLength->blockSignals(false);
ui->spinOccurrences->setEnabled(true);
ui->spinLength->setDecimals(Base::UnitsApi::getDecimals());
updateUI();
}

Expand Down Expand Up @@ -370,7 +372,7 @@ const bool TaskLinearPatternParameters::getReverse(void) const

const double TaskLinearPatternParameters::getLength(void) const
{
return ui->spinLength->value();
return ui->spinLength->value().getValue();
}

const unsigned TaskLinearPatternParameters::getOccurrences(void) const
Expand Down
16 changes: 10 additions & 6 deletions src/Mod/PartDesign/Gui/TaskLinearPatternParameters.ui
Expand Up @@ -75,12 +75,9 @@
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="spinLength">
<property name="decimals">
<number>3</number>
</property>
<property name="maximum">
<double>999999.000000000000000</double>
<widget class="Gui::QuantitySpinBox" name="spinLength">
<property name="unit" stdset="0">
<string>mm</string>
</property>
<property name="value">
<double>100.000000000000000</double>
Expand Down Expand Up @@ -146,6 +143,13 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>Gui::QuantitySpinBox</class>
<extends>QWidget</extends>
<header>Gui/QuantitySpinBox.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

0 comments on commit d2cbd68

Please sign in to comment.