Livery form style fixes

This commit is contained in:
Klaus Basan
2018-07-20 18:06:13 +02:00
parent 9c0e4356b2
commit 1fbd084500
2 changed files with 23 additions and 25 deletions

View File

@@ -47,23 +47,23 @@ namespace BlackGui
ui->comp_LiverySelector->withLiveryDescription(false); ui->comp_LiverySelector->withLiveryDescription(false);
// Id // Id
connect(ui->le_Id, &QLineEdit::returnPressed, this, &CLiveryForm::ps_idEntered); connect(ui->le_Id, &QLineEdit::returnPressed, this, &CLiveryForm::onIdEntered);
// selector // selector
connect(ui->comp_LiverySelector, &CDbLiverySelectorComponent::changedLivery, this, &CLiveryForm::setValue); connect(ui->comp_LiverySelector, &CDbLiverySelectorComponent::changedLivery, this, &CLiveryForm::setValue);
// drag and drop, paste // drag and drop, paste
connect(ui->tb_Paste, &QToolButton::clicked, this, &CLiveryForm::pasted); connect(ui->tb_Paste, &QToolButton::clicked, this, &CLiveryForm::pasted);
connect(ui->drop_DropData, &CDropSite::droppedValueObject, this, &CLiveryForm::ps_droppedLivery); connect(ui->drop_DropData, &CDropSite::droppedValueObject, this, &CLiveryForm::onDroppedLivery);
ui->drop_DropData->setInfoText("<drop livery>"); ui->drop_DropData->setInfoText("<drop livery>");
ui->drop_DropData->setAcceptedMetaTypeIds({ qMetaTypeId<CLivery>(), qMetaTypeId<CLiveryList>()}); ui->drop_DropData->setAcceptedMetaTypeIds({ qMetaTypeId<CLivery>(), qMetaTypeId<CLiveryList>()});
// embedded form // embedded form
connect(ui->editor_AirlineIcao, &CAirlineIcaoForm::airlineChanged, this, &CLiveryForm::ps_airlineChanged); connect(ui->editor_AirlineIcao, &CAirlineIcaoForm::airlineChanged, this, &CLiveryForm::onAirlineChanged);
// Set as temp.livery or search color // Set as temp.livery or search color
connect(ui->pb_TempLivery, &QPushButton::pressed, this, &CLiveryForm::ps_setTemporaryLivery); connect(ui->pb_TempLivery, &QPushButton::pressed, this, &CLiveryForm::setTemporaryLivery);
connect(ui->pb_SearchColor, &QPushButton::pressed, this, &CLiveryForm::ps_searchForColor); connect(ui->pb_SearchColor, &QPushButton::pressed, this, &CLiveryForm::searchForColor);
} }
CLiveryForm::~CLiveryForm() { } CLiveryForm::~CLiveryForm() { }
@@ -209,7 +209,7 @@ namespace BlackGui
this->setValue(m_originalLivery); this->setValue(m_originalLivery);
} }
void CLiveryForm::ps_droppedLivery(const BlackMisc::CVariant &variantDropped) void CLiveryForm::onDroppedLivery(const BlackMisc::CVariant &variantDropped)
{ {
CLivery livery; CLivery livery;
if (variantDropped.canConvert<CLivery>()) if (variantDropped.canConvert<CLivery>())
@@ -226,7 +226,7 @@ namespace BlackGui
this->setValue(livery); this->setValue(livery);
} }
void CLiveryForm::ps_airlineChanged(const CAirlineIcaoCode &code) void CLiveryForm::onAirlineChanged(const CAirlineIcaoCode &code)
{ {
if (!code.hasCompleteData()) { return; } if (!code.hasCompleteData()) { return; }
if (!code.hasValidDbKey()) { return; } if (!code.hasValidDbKey()) { return; }
@@ -238,7 +238,7 @@ namespace BlackGui
} }
} }
void CLiveryForm::ps_setTemporaryLivery() void CLiveryForm::setTemporaryLivery()
{ {
if (!sGui || !sGui->hasWebDataServices()) { return; } if (!sGui || !sGui->hasWebDataServices()) { return; }
const CLivery l = sGui->getWebDataServices()->getTempLiveryOrDefault(); const CLivery l = sGui->getWebDataServices()->getTempLiveryOrDefault();
@@ -248,7 +248,7 @@ namespace BlackGui
} }
} }
void CLiveryForm::ps_searchForColor() void CLiveryForm::searchForColor()
{ {
if (!m_colorSearch) if (!m_colorSearch)
{ {
@@ -264,7 +264,7 @@ namespace BlackGui
} }
} }
void CLiveryForm::ps_idEntered() void CLiveryForm::onIdEntered()
{ {
if (!sGui || !sGui->hasWebDataServices()) if (!sGui || !sGui->hasWebDataServices())
{ {

View File

@@ -69,34 +69,32 @@ namespace BlackGui
//! Clear data //! Clear data
void clear(); void clear();
//! Reset value to current value
void resetValue();
public slots:
//! Value //! Value
bool setValue(const BlackMisc::Aviation::CLivery &livery); bool setValue(const BlackMisc::Aviation::CLivery &livery);
//! Reset value to current value
void resetValue();
protected: protected:
//! \copydoc CForm::jsonPasted //! \copydoc CForm::jsonPasted
virtual void jsonPasted(const QString &json) override; virtual void jsonPasted(const QString &json) override;
private slots: private:
//! Livery dropped //! Livery dropped
void ps_droppedLivery(const BlackMisc::CVariant &variantDropped); void onDroppedLivery(const BlackMisc::CVariant &variantDropped);
//! Airline of embedded form has changed //! Airline of embedded form has changed
void ps_airlineChanged(const BlackMisc::Aviation::CAirlineIcaoCode &code); void onAirlineChanged(const BlackMisc::Aviation::CAirlineIcaoCode &code);
//! Set data for a temp.livery
void ps_setTemporaryLivery();
//! Search for color
void ps_searchForColor();
//! Id entered //! Id entered
void ps_idEntered(); void onIdEntered();
//! Set data for a temp.livery
void setTemporaryLivery();
//! Search for color
void searchForColor();
private:
QScopedPointer<Ui::CLiveryForm> ui; QScopedPointer<Ui::CLiveryForm> ui;
BlackMisc::Aviation::CLivery m_originalLivery; //!< object allowing to override values BlackMisc::Aviation::CLivery m_originalLivery; //!< object allowing to override values
BlackGui::Components::CDbLiveryColorSearchDialog *m_colorSearch = nullptr; //!< search for color BlackGui::Components::CDbLiveryColorSearchDialog *m_colorSearch = nullptr; //!< search for color