Do NOT override METAR if user "manually entered some arbitrary callsign"

See https://discordapp.com/channels/539048679160676382/539486309882789888/621787641976717323
This commit is contained in:
Klaus Basan
2019-09-12 23:30:23 +02:00
parent 29258719a4
commit ad2cc0fded
2 changed files with 17 additions and 8 deletions

View File

@@ -249,9 +249,17 @@ namespace BlackGui
else if (!m_selectedCallsign.isEmpty() && onlineStations.containsCallsign(m_selectedCallsign))
{
const CAtcStation lastSelected = onlineStations.findFirstByCallsign(m_selectedCallsign);
if (lastSelected.hasCallsign())
{
// avoid override of manually entered METAR callsigns
const CCallsign currentCs(ui->le_AtcStationsOnlineMetar->text());
if (currentCs.isEmpty() || currentCs == lastSelected.getCallsign())
{
this->triggerOnlineAtcStationSelected(lastSelected);
}
}
} // stations
}
}
else
{
@@ -474,6 +482,7 @@ namespace BlackGui
(station.hasAtis() ? u"\n\n" % station.getAtis().getMessage() : QStringLiteral("")) %
(station.hasMetar() ? u"\n\n" % station.getMetar().getMessage() : QStringLiteral(""));
ui->te_AtcStationsOnlineInfo->setText(infoMessage);
ui->le_AtcStationsOnlineMetar->setText(station.getCallsign().asString());
m_selectedCallsign = station.getCallsign();
}

View File

@@ -229,7 +229,7 @@
<string extracomment="METAR: Airport ICAO code">METAR: Airport ICAO code</string>
</property>
<property name="maxLength">
<number>5</number>
<number>10</number>
</property>
<property name="placeholderText">
<string>e.g. KLAX</string>