Added tooltips and changed units for radar site threshold.

This commit is contained in:
AdenKoperczak 2024-12-13 10:24:53 -05:00
parent 9174a4de91
commit c0b7f85278
3 changed files with 41 additions and 3 deletions

View file

@ -755,6 +755,22 @@ void SettingsDialogImpl::SetupGeneralTab()
generalSettings.radar_site_threshold());
radarSiteThreshold_.SetEditWidget(self_->ui->radarSiteThresholdSpinBox);
radarSiteThreshold_.SetResetButton(self_->ui->resetRadarSiteThresholdButton);
radarSiteThreshold_.SetUnitLabel(self_->ui->radarSiteThresholdUnitLabel);
auto radarSiteThresholdUpdateUnits = [this](const std::string& newValue)
{
types::DistanceUnits radiusUnits =
types::GetDistanceUnitsFromName(newValue);
double radiusScale = types::GetDistanceUnitsScale(radiusUnits);
std::string abbreviation =
types::GetDistanceUnitsAbbreviation(radiusUnits);
radarSiteThreshold_.SetUnit(radiusScale, abbreviation);
};
settings::UnitSettings::Instance()
.distance_units()
.RegisterValueStagedCallback(radarSiteThresholdUpdateUnits);
radarSiteThresholdUpdateUnits(
settings::UnitSettings::Instance().distance_units().GetValue());
antiAliasingEnabled_.SetSettingsVariable(
generalSettings.anti_aliasing_enabled());

View file

@ -122,7 +122,7 @@
</sizepolicy>
</property>
<property name="currentIndex">
<number>0</number>
<number>3</number>
</property>
<widget class="QWidget" name="general">
<layout class="QVBoxLayout" name="verticalLayout_2">
@ -572,8 +572,17 @@
</item>
<item row="23" column="2">
<widget class="QDoubleSpinBox" name="radarSiteThresholdSpinBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Set to 0 to disable</string>
</property>
<property name="suffix">
<string>NM</string>
<string/>
</property>
<property name="decimals">
<number>0</number>
@ -589,6 +598,16 @@
</property>
</widget>
</item>
<item row="23" column="3">
<widget class="QLabel" name="radarSiteThresholdUnitLabel">
<property name="toolTip">
<string/>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@ -822,6 +841,9 @@
</item>
<item row="5" column="1" colspan="2">
<widget class="QDoubleSpinBox" name="alertAudioRadiusSpinBox">
<property name="toolTip">
<string>Set to 0 to disable</string>
</property>
<property name="decimals">
<number>2</number>
</property>