From 18c12db710bdd0abed7e4d473b51fec7b63c509c Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Thu, 24 Sep 2015 00:55:07 +0200 Subject: [PATCH] refs #452 removed old data mapping component --- .../components/datamappingcomponent.cpp | 87 ---------- .../components/datamappingcomponent.h | 68 -------- .../components/datamappingcomponent.ui | 159 ------------------ 3 files changed, 314 deletions(-) delete mode 100644 src/blackgui/components/datamappingcomponent.cpp delete mode 100644 src/blackgui/components/datamappingcomponent.h delete mode 100644 src/blackgui/components/datamappingcomponent.ui diff --git a/src/blackgui/components/datamappingcomponent.cpp b/src/blackgui/components/datamappingcomponent.cpp deleted file mode 100644 index 78379b700..000000000 --- a/src/blackgui/components/datamappingcomponent.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/* Copyright (C) 2015 - * swift project Community / Contributors - * - * This file is part of swift Project. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, - * including this file, may be copied, modified, propagated, or distributed except according to the terms - * contained in the LICENSE file. - */ - -#include "datamappingcomponent.h" -#include "ui_datamappingcomponent.h" -#include "blackcore/web_datareader.h" - -using namespace BlackGui::Views; -using namespace BlackCore; - -namespace BlackGui -{ - namespace Components - { - CDataMappingComponent::CDataMappingComponent(QWidget *parent) : - QFrame(parent), - ui(new Ui::CDataMappingComponent) - { - ui->setupUi(this); - connect(this->ui->tvp_Distributors, &CDistributorView::requestUpdate, this, &CDataMappingComponent::ps_requestModelDataUpdate); - connect(this->ui->tvp_Liveries, &CLiveryView::requestUpdate, this, &CDataMappingComponent::ps_requestModelDataUpdate); - connect(this->ui->tvp_Models, &CLiveryView::requestUpdate, this, &CDataMappingComponent::ps_requestModelDataUpdate); - } - - CDataMappingComponent::~CDataMappingComponent() - { } - - void CDataMappingComponent::readersInitialized(CWebDataReader *webReaders) - { - Q_ASSERT_X(webReaders, Q_FUNC_INFO, "Missing readers"); - if (this->m_webDataReader) { return; } - if (!this->m_webReaderSignalConnections.isEmpty()) { return; } - this->m_webDataReader = webReaders; - this->m_webReaderSignalConnections = this->m_webDataReader->connectSwiftDatabaseSignals( - this, // the object here must be the same as in the bind - std::bind(&CDataMappingComponent::ps_aircraftIcaoCodeRead, this, std::placeholders::_1), - std::bind(&CDataMappingComponent::ps_airlineIcaoCodeRead, this, std::placeholders::_1), - std::bind(&CDataMappingComponent::ps_liveriesRead, this, std::placeholders::_1), - std::bind(&CDataMappingComponent::ps_distributorsRead, this, std::placeholders::_1), - std::bind(&CDataMappingComponent::ps_modelsRead, this, std::placeholders::_1)); - } - - void CDataMappingComponent::ps_aircraftIcaoCodeRead(int number) - { - Q_UNUSED(number); - } - - void CDataMappingComponent::ps_airlineIcaoCodeRead(int number) - { - Q_UNUSED(number); - } - - void CDataMappingComponent::ps_liveriesRead(int number) - { - Q_ASSERT_X(this->m_webDataReader, Q_FUNC_INFO, "Missing reader"); - Q_UNUSED(number); - this->ui->tvp_Liveries->updateContainerMaybeAsync(this->m_webDataReader->getLiveries()); - } - - void CDataMappingComponent::ps_distributorsRead(int number) - { - Q_ASSERT_X(this->m_webDataReader, Q_FUNC_INFO, "Missing reader"); - Q_UNUSED(number); - this->ui->tvp_Distributors->updateContainerMaybeAsync(this->m_webDataReader->getDistributors()); - } - - void CDataMappingComponent::ps_modelsRead(int number) - { - Q_ASSERT_X(this->m_webDataReader, Q_FUNC_INFO, "Missing reader"); - Q_UNUSED(number); - this->ui->tvp_Models->updateContainerMaybeAsync(this->m_webDataReader->getModels()); - } - - void CDataMappingComponent::ps_requestModelDataUpdate() - { - Q_ASSERT_X(this->m_webDataReader, Q_FUNC_INFO, "Missing reader"); - this->m_webDataReader->readModelDataInBackground(); - } - - } // ns -} // ns diff --git a/src/blackgui/components/datamappingcomponent.h b/src/blackgui/components/datamappingcomponent.h deleted file mode 100644 index 1cb8f0e74..000000000 --- a/src/blackgui/components/datamappingcomponent.h +++ /dev/null @@ -1,68 +0,0 @@ -/* Copyright (C) 2015 - * swift project Community / Contributors - * - * This file is part of swift Project. It is subject to the license terms in the LICENSE file found in the top-level - * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, - * including this file, may be copied, modified, propagated, or distributed except according to the terms - * contained in the LICENSE file. - */ - -#ifndef BLACKGUI_DATAMAPPINGCOMPONENT_H -#define BLACKGUI_DATAMAPPINGCOMPONENT_H - -#include "blackgui/blackguiexport.h" -#include - -namespace Ui { class CDataMappingComponent; } -namespace BlackCore { class CWebDataReader; } - -namespace BlackGui -{ - namespace Components - { - /** - * Mappings from/for the database - */ - class BLACKGUI_EXPORT CDataMappingComponent : public QFrame - { - Q_OBJECT - - public: - //! Contructor - explicit CDataMappingComponent(QWidget *parent = nullptr); - - //! Destructor - ~CDataMappingComponent(); - - //! Readers have been initialized - void readersInitialized(BlackCore::CWebDataReader *webReaders); - - private slots: - //! Aircraft ICAO codes read - void ps_aircraftIcaoCodeRead(int number); - - //! Airline ICAO codes read - void ps_airlineIcaoCodeRead(int number); - - //! Liveries read - void ps_liveriesRead(int number); - - //! Distributors read - void ps_distributorsRead(int number); - - //! Models read - void ps_modelsRead(int number); - - //! Request distributor update - void ps_requestModelDataUpdate(); - - private: - QScopedPointer ui; - BlackCore::CWebDataReader *m_webDataReader = nullptr; - QList m_webReaderSignalConnections; - }; - - } // ns -} // ns - -#endif // guard diff --git a/src/blackgui/components/datamappingcomponent.ui b/src/blackgui/components/datamappingcomponent.ui deleted file mode 100644 index 270d3a2e9..000000000 --- a/src/blackgui/components/datamappingcomponent.ui +++ /dev/null @@ -1,159 +0,0 @@ - - - CDataMappingComponent - - - - 0 - 0 - 400 - 300 - - - - Frame - - - QFrame::StyledPanel - - - QFrame::Raised - - - - 0 - - - 0 - - - 0 - - - 0 - - - - - 0 - - - - Models - - - - 0 - - - 2 - - - 0 - - - 0 - - - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - false - - - - - - - - Liveries - - - - 0 - - - 2 - - - 0 - - - 0 - - - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - false - - - - - - - - Distributors - - - - 0 - - - 2 - - - 0 - - - 0 - - - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - false - - - - - - - - - - - - BlackGui::Views::CAircraftModelView - QTableView -
blackgui/views/aircraftmodelview.h
-
- - BlackGui::Views::CDistributorView - QTableView -
blackgui/views/distributorview.h
-
- - BlackGui::Views::CLiveryView - QTableView -
blackgui/views/liveryview.h
-
-
- - -