Added option to choose between different depth grid quantization schema.

This allows having 3m depth grid for metric users.

* All original properties ( named diferently ) were renamed to three_m_based_grid everywhere to be consistent.
* Plus other small changes requested during review.

Signed-off-by: Vlad A. <elf128@gmail.com>
Signed-off-by: Vlad A <elf128@gmail.com>
This commit is contained in:
Vlad A 2022-05-20 03:28:49 -04:00 committed by Dirk Hohndel
parent 15f3918171
commit 30a964c508
10 changed files with 85 additions and 8 deletions

View file

@ -28,6 +28,10 @@ void PreferencesDefaults::refreshSettings()
ui->fontsize->setValue(qPrefDisplay::font_size());
ui->velocitySlider->setValue(qPrefDisplay::animation_speed());
if (qPrefDisplay::three_m_based_grid())
ui->grid3MBased->setChecked(true);
else
ui->gridGeneric->setChecked(true);
}
void PreferencesDefaults::syncSettings()
@ -35,4 +39,5 @@ void PreferencesDefaults::syncSettings()
qPrefDisplay::set_divelist_font(ui->font->currentFont().toString());
qPrefDisplay::set_font_size(ui->fontsize->value());
qPrefDisplay::set_animation_speed(ui->velocitySlider->value());
qPrefDisplay::set_three_m_based_grid(ui->grid3MBased->isChecked());
}

View file

@ -118,7 +118,37 @@
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_gridDepth">
<property name="title">
<string>Dive profile depth grid</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Depth line intevals.</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="gridGeneric">
<property name="text">
<string>generic ( 1, 2, 4, 5, 10 )</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="grid3MBased">
<property name="text">
<string>based on ×3 intervals ( 1, 3, 6, 15 )</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">