refs #742, allow to search for color liveries in livery form

(using dialog)
This commit is contained in:
Klaus Basan
2016-08-25 00:28:48 +02:00
committed by Mathew Sutcliffe
parent c5f60bc582
commit b7d689d63d
3 changed files with 111 additions and 84 deletions

View File

@@ -57,8 +57,9 @@ namespace BlackGui
// embedded form
connect(ui->editor_AirlineIcao, &CAirlineIcaoForm::airlineChanged, this, &CLiveryForm::ps_airlineChanged);
// Set as temp.livery
// Set as temp.livery or search color
connect(ui->pb_TempLivery, &QPushButton::pressed, this, &CLiveryForm::ps_setTemporaryLivery);
connect(ui->pb_SearchColor, &QPushButton::pressed, this, &CLiveryForm::ps_searchForColor);
}
CLiveryForm::~CLiveryForm() { }
@@ -204,5 +205,21 @@ namespace BlackGui
this->setValue(l);
}
}
void CLiveryForm::ps_searchForColor()
{
if (!this->m_colorSearch)
{
this->m_colorSearch = new CDbLiveryColorSearch(this);
this->m_colorSearch->setModal(true);
}
const QDialog::DialogCode c = static_cast<QDialog::DialogCode>(this->m_colorSearch->exec());
if (c == QDialog::Rejected) { return; }
const CLivery found = this->m_colorSearch->getLivery();
if (found.isLoadedFromDb())
{
this->setValue(found);
}
}
} // ns
} // ns