Ref T118, color search follow up formatting

This commit is contained in:
Klaus Basan
2017-10-25 19:46:56 +02:00
parent 297426ae8e
commit b74623599e
4 changed files with 16 additions and 16 deletions

View File

@@ -25,7 +25,7 @@ namespace BlackGui
ui(new Ui::CDbLiveryColorSearchDialog) ui(new Ui::CDbLiveryColorSearchDialog)
{ {
ui->setupUi(this); ui->setupUi(this);
connect(this, &CDbLiveryColorSearchDialog::accepted, this, &CDbLiveryColorSearchDialog::ps_onAccepted); connect(this, &CDbLiveryColorSearchDialog::accepted, this, &CDbLiveryColorSearchDialog::onAccepted);
} }
CDbLiveryColorSearchDialog::~CDbLiveryColorSearchDialog() CDbLiveryColorSearchDialog::~CDbLiveryColorSearchDialog()
@@ -33,12 +33,12 @@ namespace BlackGui
const CLivery &CDbLiveryColorSearchDialog::getLivery() const const CLivery &CDbLiveryColorSearchDialog::getLivery() const
{ {
return this->m_foundLivery; return m_foundLivery;
} }
void CDbLiveryColorSearchDialog::ps_onAccepted() void CDbLiveryColorSearchDialog::onAccepted()
{ {
this->m_foundLivery = ui->comp_LiverySearch->getLivery(); m_foundLivery = ui->comp_LiverySearch->getLivery();
} }
} // ns } // ns
} // ns } // ns

View File

@@ -33,14 +33,14 @@ namespace BlackGui
explicit CDbLiveryColorSearchDialog(QWidget *parent = nullptr); explicit CDbLiveryColorSearchDialog(QWidget *parent = nullptr);
//! Destructor //! Destructor
~CDbLiveryColorSearchDialog(); virtual ~CDbLiveryColorSearchDialog();
//! Found livery if any, otherwise default //! Found livery if any, otherwise default
const BlackMisc::Aviation::CLivery &getLivery() const; const BlackMisc::Aviation::CLivery &getLivery() const;
private: private:
//! Dialog has been accepted //! Dialog has been accepted
void ps_onAccepted(); void onAccepted();
BlackMisc::Aviation::CLivery m_foundLivery; //!< last livery found BlackMisc::Aviation::CLivery m_foundLivery; //!< last livery found

View File

@@ -91,9 +91,9 @@ namespace BlackGui
bool CLiveryForm::setValue(const CLivery &livery) bool CLiveryForm::setValue(const CLivery &livery)
{ {
if (this->m_originalLivery == livery) { return false; } if (m_originalLivery == livery) { return false; }
this->m_originalLivery = livery; m_originalLivery = livery;
ui->comp_LiverySelector->setLivery(livery); ui->comp_LiverySelector->setLivery(livery);
ui->le_Id->setText(livery.getDbKeyAsString()); ui->le_Id->setText(livery.getDbKeyAsString());
ui->le_Description->setText(livery.getDescription()); ui->le_Description->setText(livery.getDescription());
@@ -172,7 +172,7 @@ namespace BlackGui
void CLiveryForm::setReadOnly(bool readOnly) void CLiveryForm::setReadOnly(bool readOnly)
{ {
this->m_readOnly = readOnly; m_readOnly = readOnly;
ui->le_Id->setReadOnly(readOnly); ui->le_Id->setReadOnly(readOnly);
ui->comp_LiverySelector->setReadOnly(readOnly); ui->comp_LiverySelector->setReadOnly(readOnly);
ui->le_Description->setReadOnly(readOnly); ui->le_Description->setReadOnly(readOnly);
@@ -249,14 +249,14 @@ namespace BlackGui
void CLiveryForm::ps_searchForColor() void CLiveryForm::ps_searchForColor()
{ {
if (!this->m_colorSearch) if (!m_colorSearch)
{ {
this->m_colorSearch = new CDbLiveryColorSearchDialog(this); m_colorSearch = new CDbLiveryColorSearchDialog(this);
this->m_colorSearch->setModal(true); m_colorSearch->setModal(true);
} }
const QDialog::DialogCode c = static_cast<QDialog::DialogCode>(this->m_colorSearch->exec()); const QDialog::DialogCode c = static_cast<QDialog::DialogCode>(m_colorSearch->exec());
if (c == QDialog::Rejected) { return; } if (c == QDialog::Rejected) { return; }
const CLivery found = this->m_colorSearch->getLivery(); const CLivery found = m_colorSearch->getLivery();
if (found.isLoadedFromDb()) if (found.isLoadedFromDb())
{ {
this->setValue(found); this->setValue(found);

View File

@@ -53,10 +53,10 @@ namespace BlackMisc
CLivery findStdLiveryByAirlineIcaoVDesignator(const CAirlineIcaoCode &icao) const; CLivery findStdLiveryByAirlineIcaoVDesignator(const CAirlineIcaoCode &icao) const;
//! Search for colors //! Search for colors
CLivery findColorLiveryOrDefault(const BlackMisc::CRgbColor &fuselage, const CRgbColor &tail) const; CLivery findColorLiveryOrDefault(const CRgbColor &fuselage, const CRgbColor &tail) const;
//! Search for colors //! Search for colors
CLivery findClosestColorLiveryOrDefault(const BlackMisc::CRgbColor &fuselage, const CRgbColor &tail) const; CLivery findClosestColorLiveryOrDefault(const CRgbColor &fuselage, const CRgbColor &tail) const;
//! By simplified name //! By simplified name
CLiveryList findStdLiveriesBySimplifiedAirlineName(const QString &containedString) const; CLiveryList findStdLiveriesBySimplifiedAirlineName(const QString &containedString) const;