mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 01:45:38 +08:00
refs #768, improved selectors
* added focus proxy * using &QLineEdit::editingFinished as signal (changes value also when focus is lost) * use enum to set how values are displayed * search for DB values by leveraging the smart selector functions * added isSet functions * minor renamings/formatting
This commit is contained in:
@@ -61,8 +61,15 @@ namespace BlackGui
|
||||
bool CDbAirlineIcaoSelectorBase::setAirlineIcao(const CAirlineIcaoCode &icao)
|
||||
{
|
||||
if (icao == m_currentIcao) { return false; }
|
||||
m_currentIcao = icao;
|
||||
emit changedAirlineIcao(icao);
|
||||
if (icao.isLoadedFromDb())
|
||||
{
|
||||
this->m_currentIcao = icao;
|
||||
}
|
||||
else
|
||||
{
|
||||
this->m_currentIcao = sGui->getWebDataServices()->smartAirlineIcaoSelector(icao);
|
||||
}
|
||||
emit changedAirlineIcao(this->m_currentIcao);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -80,6 +87,12 @@ namespace BlackGui
|
||||
}
|
||||
}
|
||||
|
||||
bool CDbAirlineIcaoSelectorBase::isSet() const
|
||||
{
|
||||
const CAirlineIcaoCode icao(this->getAirlineIcao());
|
||||
return icao.isLoadedFromDb() || icao.hasCompleteData();
|
||||
}
|
||||
|
||||
void CDbAirlineIcaoSelectorBase::dragEnterEvent(QDragEnterEvent *event)
|
||||
{
|
||||
if (!event || !acceptDrop(event->mimeData())) { return; }
|
||||
|
||||
Reference in New Issue
Block a user