mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 06:10:04 +00:00 
			
		
		
		
	Added tooltips and changed units for radar site threshold.
This commit is contained in:
		
							parent
							
								
									9174a4de91
								
							
						
					
					
						commit
						c0b7f85278
					
				
					 3 changed files with 41 additions and 3 deletions
				
			
		|  | @ -63,7 +63,7 @@ void RadarSiteLayer::Render( | ||||||
|    p->hoverText_.clear(); |    p->hoverText_.clear(); | ||||||
| 
 | 
 | ||||||
|    auto mapDistance = util::maplibre::GetMapDistance(params); |    auto mapDistance = util::maplibre::GetMapDistance(params); | ||||||
|    auto threshold   = units::length::nautical_miles<double>( |    auto threshold   = units::length::kilometers<double>( | ||||||
|       settings::GeneralSettings::Instance().radar_site_threshold().GetValue()); |       settings::GeneralSettings::Instance().radar_site_threshold().GetValue()); | ||||||
| 
 | 
 | ||||||
|    if (!(threshold.value() == 0.0 || mapDistance <= threshold || |    if (!(threshold.value() == 0.0 || mapDistance <= threshold || | ||||||
|  |  | ||||||
|  | @ -755,6 +755,22 @@ void SettingsDialogImpl::SetupGeneralTab() | ||||||
|       generalSettings.radar_site_threshold()); |       generalSettings.radar_site_threshold()); | ||||||
|    radarSiteThreshold_.SetEditWidget(self_->ui->radarSiteThresholdSpinBox); |    radarSiteThreshold_.SetEditWidget(self_->ui->radarSiteThresholdSpinBox); | ||||||
|    radarSiteThreshold_.SetResetButton(self_->ui->resetRadarSiteThresholdButton); |    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( |    antiAliasingEnabled_.SetSettingsVariable( | ||||||
|       generalSettings.anti_aliasing_enabled()); |       generalSettings.anti_aliasing_enabled()); | ||||||
|  |  | ||||||
|  | @ -122,7 +122,7 @@ | ||||||
|           </sizepolicy> |           </sizepolicy> | ||||||
|          </property> |          </property> | ||||||
|          <property name="currentIndex"> |          <property name="currentIndex"> | ||||||
|           <number>0</number> |           <number>3</number> | ||||||
|          </property> |          </property> | ||||||
|          <widget class="QWidget" name="general"> |          <widget class="QWidget" name="general"> | ||||||
|           <layout class="QVBoxLayout" name="verticalLayout_2"> |           <layout class="QVBoxLayout" name="verticalLayout_2"> | ||||||
|  | @ -572,8 +572,17 @@ | ||||||
|                   </item> |                   </item> | ||||||
|                   <item row="23" column="2"> |                   <item row="23" column="2"> | ||||||
|                    <widget class="QDoubleSpinBox" name="radarSiteThresholdSpinBox"> |                    <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"> |                     <property name="suffix"> | ||||||
|                      <string>NM</string> |                      <string/> | ||||||
|                     </property> |                     </property> | ||||||
|                     <property name="decimals"> |                     <property name="decimals"> | ||||||
|                      <number>0</number> |                      <number>0</number> | ||||||
|  | @ -589,6 +598,16 @@ | ||||||
|                     </property> |                     </property> | ||||||
|                    </widget> |                    </widget> | ||||||
|                   </item> |                   </item> | ||||||
|  |                   <item row="23" column="3"> | ||||||
|  |                    <widget class="QLabel" name="radarSiteThresholdUnitLabel"> | ||||||
|  |                     <property name="toolTip"> | ||||||
|  |                      <string/> | ||||||
|  |                     </property> | ||||||
|  |                     <property name="text"> | ||||||
|  |                      <string/> | ||||||
|  |                     </property> | ||||||
|  |                    </widget> | ||||||
|  |                   </item> | ||||||
|                  </layout> |                  </layout> | ||||||
|                 </widget> |                 </widget> | ||||||
|                </item> |                </item> | ||||||
|  | @ -822,6 +841,9 @@ | ||||||
|               </item> |               </item> | ||||||
|               <item row="5" column="1" colspan="2"> |               <item row="5" column="1" colspan="2"> | ||||||
|                <widget class="QDoubleSpinBox" name="alertAudioRadiusSpinBox"> |                <widget class="QDoubleSpinBox" name="alertAudioRadiusSpinBox"> | ||||||
|  |                 <property name="toolTip"> | ||||||
|  |                  <string>Set to 0 to disable</string> | ||||||
|  |                 </property> | ||||||
|                 <property name="decimals"> |                 <property name="decimals"> | ||||||
|                  <number>2</number> |                  <number>2</number> | ||||||
|                 </property> |                 </property> | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 AdenKoperczak
						AdenKoperczak