void DeviceEditWidget::UpdateVisibilities() { const DeviceConfig::PortType type = GetPortType(GetDataField(Port)); const bool maybe_bluetooth = DeviceConfig::MaybeBluetooth(type, GetDataField(Port).GetAsString()); const bool k6bt = maybe_bluetooth && GetValueBoolean(K6Bt); const bool uses_speed = DeviceConfig::UsesSpeed(type) || k6bt; SetRowAvailable(BaudRate, uses_speed); SetRowAvailable(BulkBaudRate, uses_speed && DeviceConfig::UsesDriver(type)); SetRowVisible(BulkBaudRate, uses_speed && DeviceConfig::UsesDriver(type) && SupportsBulkBaudRate(GetDataField(Driver))); SetRowAvailable(IP_ADDRESS, DeviceConfig::UsesIPAddress(type)); SetRowAvailable(TCPPort, DeviceConfig::UsesTCPPort(type)); SetRowAvailable(I2CBus, DeviceConfig::UsesI2C(type)); SetRowAvailable(I2CAddr, DeviceConfig::UsesI2C(type) && type != DeviceConfig::PortType::NUNCHUCK); SetRowAvailable(PressureUsage, DeviceConfig::IsPressureSensor(type)); SetRowVisible(Driver, DeviceConfig::UsesDriver(type)); SetRowVisible(UseSecondDriver, DeviceConfig::UsesDriver(type) && CanPassThrough(GetDataField(Driver))); SetRowVisible(SecondDriver, DeviceConfig::UsesDriver(type) && CanPassThrough(GetDataField(Driver)) && GetValueBoolean(UseSecondDriver)); SetRowVisible(SyncFromDevice, DeviceConfig::UsesDriver(type) && CanReceiveSettings(GetDataField(Driver))); SetRowVisible(SyncToDevice, DeviceConfig::UsesDriver(type) && CanSendSettings(GetDataField(Driver))); SetRowAvailable(K6Bt, maybe_bluetooth); }
inline void FontEditWidget::SaveValues() { #ifdef USE_GDI CopyString(data.lfFaceName, GetDataField(FACE).GetAsString(), LF_FACESIZE); #endif data.lfHeight = GetValueInteger(HEIGHT); data.lfWeight = GetValueBoolean(WEIGHT) ? 700 : 500; data.lfItalic = GetValueBoolean(ITALIC); }
void WaypointDisplayConfigPanel::UpdateVisibilities() { bool visible = GetValueBoolean(AppUseSWLandablesRendering); SetRowVisible(AppLandableRenderingScale, visible); SetRowVisible(AppScaleRunwayLength, visible); }
bool RowFormWidget::SaveValue(unsigned i, bool &value, bool negated) const { bool new_value = GetValueBoolean(i); if (negated) new_value = !new_value; if (new_value == value) return false; value = new_value; return true; }
void TrackingConfigPanel::SetSkyLinesEnabled(bool enabled) { #ifdef HAVE_NET_STATE_ROAMING SetRowEnabled(SL_ROAMING, enabled); #endif SetRowEnabled(SL_INTERVAL, enabled); SetRowEnabled(SL_TRAFFIC_ENABLED, enabled); SetRowEnabled(SL_NEAR_TRAFFIC_ENABLED, enabled && GetValueBoolean(SL_TRAFFIC_ENABLED)); SetRowEnabled(SL_KEY, enabled); }