mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +08:00
refs #575, using livery completer
* embedded in form * rectified readOnly / only for selection * added uper case validator where missing * selecting airline triggers loading of default livery
This commit is contained in:
@@ -125,12 +125,10 @@ namespace BlackGui
|
||||
Q_ASSERT_X(c, Q_FUNC_INFO, "missing converter");
|
||||
this->connect(c, static_cast<void (QCompleter::*)(const QString &)>(&QCompleter::activated), this, &CDbAirlineIcaoSelectorBase::ps_completerActivated);
|
||||
m_completer.reset(c); // deletes any old completer
|
||||
this->setReadOnly(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->m_completer.reset(nullptr);
|
||||
this->setReadOnly(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
#include "dbairlineicaoselectorcomponent.h"
|
||||
#include "ui_dbairlineicaoselectorcomponent.h"
|
||||
#include "blackgui/guiutility.h"
|
||||
#include "blackgui/uppercasevalidator.h"
|
||||
#include "blackmisc/datastoreutility.h"
|
||||
#include <QMimeData>
|
||||
|
||||
|
||||
using namespace BlackGui;
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Aviation;
|
||||
@@ -27,6 +27,7 @@ namespace BlackGui
|
||||
ui(new Ui::CDbAirlineIcaoSelectorComponent)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->le_Airline->setValidator(new CUpperCaseValidator(this));
|
||||
connect(ui->le_Airline, &QLineEdit::returnPressed, this, &CDbAirlineIcaoSelectorComponent::ps_dataChanged);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace BlackGui
|
||||
//! \copydoc CDbAirlineIcaoSelectorBase::setAirlineIcao
|
||||
virtual void setAirlineIcao(const BlackMisc::Aviation::CAirlineIcaoCode &icao) override;
|
||||
|
||||
//! Display distributor description
|
||||
//! Display ICAO description
|
||||
void withIcaoDescription(bool description);
|
||||
|
||||
//! \copydoc CDbAirlineIcaoSelectorBase::clear
|
||||
|
||||
@@ -95,7 +95,9 @@ namespace BlackGui
|
||||
{
|
||||
this->ui->le_CountryIso->setReadOnly(readOnly);
|
||||
this->ui->le_CountryName->setReadOnly(readOnly);
|
||||
this->ui->le_CountryName->setEnabled((!readOnly));
|
||||
this->ui->lbl_CountryIcon->setVisible(!readOnly);
|
||||
this->setEnabled(!readOnly);
|
||||
}
|
||||
|
||||
bool CDbCountrySelectorComponent::isSet() const
|
||||
@@ -165,12 +167,10 @@ namespace BlackGui
|
||||
|
||||
this->ui->le_CountryName->setCompleter(c);
|
||||
m_completerCountryNames.reset(c); // deletes any old completer
|
||||
this->setReadOnly(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->m_completerCountryNames.reset(nullptr);
|
||||
this->setReadOnly(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -164,12 +164,12 @@ namespace BlackGui
|
||||
this->connect(c, static_cast<void (QCompleter::*)(const QString &)>(&QCompleter::activated), this, &CDbDistributorSelectorComponent::ps_completerActivated);
|
||||
|
||||
this->ui->le_Distributor->setCompleter(c);
|
||||
m_completerDistributorNames.reset(c); // deletes any old completer
|
||||
m_completerDistributors.reset(c); // deletes any old completer
|
||||
this->setReadOnly(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->m_completerDistributorNames.reset(nullptr);
|
||||
this->m_completerDistributors.reset(nullptr);
|
||||
this->setReadOnly(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,10 +96,10 @@ namespace BlackGui
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CDbDistributorSelectorComponent> ui;
|
||||
QScopedPointer<QCompleter> m_completerDistributorNames;
|
||||
QMetaObject::Connection m_signalConnection;
|
||||
QScopedPointer<QCompleter> m_completerDistributors;
|
||||
QMetaObject::Connection m_signalConnection;
|
||||
BlackMisc::Simulation::CDistributor m_currentDistributor;
|
||||
};
|
||||
}
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
#endif // guard
|
||||
|
||||
@@ -62,9 +62,9 @@ namespace BlackGui
|
||||
ui->tvp_OwnAircraftModels->updateContainerMaybeAsync(this->m_cachedOwnModels.get());
|
||||
|
||||
// how to display forms
|
||||
ui->editor_AircraftIcao->setMappingMode(true);
|
||||
ui->editor_Distributor->setMappingMode(true);
|
||||
ui->editor_Livery->setMappingMode(true);
|
||||
ui->editor_AircraftIcao->setSelectOnly();
|
||||
ui->editor_Distributor->setSelectOnly();
|
||||
ui->editor_Livery->setSelectOnly();
|
||||
|
||||
this->ui->tw_ModelsToBeMapped->setTabIcon(TabStash, CIcons::appDbStash16());
|
||||
this->ui->tw_ModelsToBeMapped->setTabIcon(TabOwnModels, CIcons::appModels16());
|
||||
|
||||
Reference in New Issue
Block a user