From 1fbd084500943416425821c0737a4e968782b786 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Fri, 20 Jul 2018 18:06:13 +0200 Subject: [PATCH] Livery form style fixes --- src/blackgui/editors/liveryform.cpp | 20 ++++++++++---------- src/blackgui/editors/liveryform.h | 28 +++++++++++++--------------- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/src/blackgui/editors/liveryform.cpp b/src/blackgui/editors/liveryform.cpp index d3b539bab..cc9fd75c7 100644 --- a/src/blackgui/editors/liveryform.cpp +++ b/src/blackgui/editors/liveryform.cpp @@ -47,23 +47,23 @@ namespace BlackGui ui->comp_LiverySelector->withLiveryDescription(false); // Id - connect(ui->le_Id, &QLineEdit::returnPressed, this, &CLiveryForm::ps_idEntered); + connect(ui->le_Id, &QLineEdit::returnPressed, this, &CLiveryForm::onIdEntered); // selector connect(ui->comp_LiverySelector, &CDbLiverySelectorComponent::changedLivery, this, &CLiveryForm::setValue); // drag and drop, paste 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(""); ui->drop_DropData->setAcceptedMetaTypeIds({ qMetaTypeId(), qMetaTypeId()}); // 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 - connect(ui->pb_TempLivery, &QPushButton::pressed, this, &CLiveryForm::ps_setTemporaryLivery); - connect(ui->pb_SearchColor, &QPushButton::pressed, this, &CLiveryForm::ps_searchForColor); + connect(ui->pb_TempLivery, &QPushButton::pressed, this, &CLiveryForm::setTemporaryLivery); + connect(ui->pb_SearchColor, &QPushButton::pressed, this, &CLiveryForm::searchForColor); } CLiveryForm::~CLiveryForm() { } @@ -209,7 +209,7 @@ namespace BlackGui this->setValue(m_originalLivery); } - void CLiveryForm::ps_droppedLivery(const BlackMisc::CVariant &variantDropped) + void CLiveryForm::onDroppedLivery(const BlackMisc::CVariant &variantDropped) { CLivery livery; if (variantDropped.canConvert()) @@ -226,7 +226,7 @@ namespace BlackGui this->setValue(livery); } - void CLiveryForm::ps_airlineChanged(const CAirlineIcaoCode &code) + void CLiveryForm::onAirlineChanged(const CAirlineIcaoCode &code) { if (!code.hasCompleteData()) { return; } if (!code.hasValidDbKey()) { return; } @@ -238,7 +238,7 @@ namespace BlackGui } } - void CLiveryForm::ps_setTemporaryLivery() + void CLiveryForm::setTemporaryLivery() { if (!sGui || !sGui->hasWebDataServices()) { return; } const CLivery l = sGui->getWebDataServices()->getTempLiveryOrDefault(); @@ -248,7 +248,7 @@ namespace BlackGui } } - void CLiveryForm::ps_searchForColor() + void CLiveryForm::searchForColor() { if (!m_colorSearch) { @@ -264,7 +264,7 @@ namespace BlackGui } } - void CLiveryForm::ps_idEntered() + void CLiveryForm::onIdEntered() { if (!sGui || !sGui->hasWebDataServices()) { diff --git a/src/blackgui/editors/liveryform.h b/src/blackgui/editors/liveryform.h index db58bdaf3..62fb6a37b 100644 --- a/src/blackgui/editors/liveryform.h +++ b/src/blackgui/editors/liveryform.h @@ -69,34 +69,32 @@ namespace BlackGui //! Clear data void clear(); - //! Reset value to current value - void resetValue(); - - public slots: //! Value bool setValue(const BlackMisc::Aviation::CLivery &livery); + //! Reset value to current value + void resetValue(); + protected: //! \copydoc CForm::jsonPasted virtual void jsonPasted(const QString &json) override; - private slots: + private: //! Livery dropped - void ps_droppedLivery(const BlackMisc::CVariant &variantDropped); + void onDroppedLivery(const BlackMisc::CVariant &variantDropped); //! Airline of embedded form has changed - void ps_airlineChanged(const BlackMisc::Aviation::CAirlineIcaoCode &code); - - //! Set data for a temp.livery - void ps_setTemporaryLivery(); - - //! Search for color - void ps_searchForColor(); + void onAirlineChanged(const BlackMisc::Aviation::CAirlineIcaoCode &code); //! Id entered - void ps_idEntered(); + void onIdEntered(); + + //! Set data for a temp.livery + void setTemporaryLivery(); + + //! Search for color + void searchForColor(); - private: QScopedPointer ui; BlackMisc::Aviation::CLivery m_originalLivery; //!< object allowing to override values BlackGui::Components::CDbLiveryColorSearchDialog *m_colorSearch = nullptr; //!< search for color