From b7d72d3499c064571b2d078c622471b454200809 Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Thu, 24 Sep 2015 01:14:58 +0200 Subject: [PATCH] refs #452 the main info area for the mapping tool --- .../components/datamaininfoareacomponent.cpp | 33 ++- .../components/datamaininfoareacomponent.h | 32 ++- .../components/datamaininfoareacomponent.ui | 255 +++++++++++++++++- 3 files changed, 302 insertions(+), 18 deletions(-) diff --git a/src/blackgui/components/datamaininfoareacomponent.cpp b/src/blackgui/components/datamaininfoareacomponent.cpp index 83a10aad7..015aca15b 100644 --- a/src/blackgui/components/datamaininfoareacomponent.cpp +++ b/src/blackgui/components/datamaininfoareacomponent.cpp @@ -8,8 +8,10 @@ */ #include "blackgui/components/logcomponent.h" -#include "blackgui/components/datamappingcomponent.h" #include "blackgui/components/datamaininfoareacomponent.h" +#include "blackgui/components/dbliverycomponent.h" +#include "blackgui/components/dbaircrafticaocomponent.h" +#include "blackgui/components/dbstashcomponent.h" #include "ui_datamaininfoareacomponent.h" #include "blackmisc/icons.h" @@ -28,6 +30,9 @@ namespace BlackGui ui->setupUi(this); initInfoArea(); // init base class this->setWindowIcon(CIcons::swiftDatabase24()); + + connect(ui->comp_Mapping, &CDbMappingComponent::filterByLivery, ui->comp_DataInfoArea->getLiveryComponent(), &CDbLiveryComponent::filter); + connect(ui->comp_Mapping, &CDbMappingComponent::filterByAircraftIcao, ui->comp_DataInfoArea->getAircraftComponent(), &CDbAircraftIcaoComponent::filter); } CDataMainInfoAreaComponent::~CDataMainInfoAreaComponent() @@ -38,18 +43,38 @@ namespace BlackGui return this->ui->comp_Log; } - CDataMappingComponent *CDataMainInfoAreaComponent::getMappingComponent() const + CDbMappingComponent *CDataMainInfoAreaComponent::getMappingComponent() const { return this->ui->comp_Mapping; } + CDataInfoAreaComponent *CDataMainInfoAreaComponent::getDataInfoAreaComponent() const + { + return this->ui->comp_DataInfoArea; + } + + CDbStashComponent *CDataMainInfoAreaComponent::getStashComponent() const + { + return this->ui->comp_Stash; + } + + void CDataMainInfoAreaComponent::setProvider(BlackMisc::Network::IWebDataServicesProvider *provider) + { + Q_ASSERT_X(provider, Q_FUNC_INFO, "Missing provider"); + this->ui->comp_DataInfoArea->setProvider(provider); + this->ui->comp_Mapping->setProvider(provider); + this->ui->comp_Stash->setProvider(provider); + } + QSize CDataMainInfoAreaComponent::getPreferredSizeWhenFloating(int areaIndex) const { InfoArea area = static_cast(areaIndex); switch (area) { + case InfoAreaData: case InfoAreaMapping: case InfoAreaSettings: + case InfoAreaStash: case InfoAreaLog: default: return QSize(800, 600); @@ -61,12 +86,16 @@ namespace BlackGui InfoArea area = static_cast(areaIndex); switch (area) { + case InfoAreaData: + return CIcons::appDatabase16(); case InfoAreaMapping: return CIcons::appMappings16(); case InfoAreaSettings: return CIcons::appSettings16(); case InfoAreaLog: return CIcons::appLog16(); + case InfoAreaStash: + return CIcons::appDbStash16(); default: return CIcons::empty(); } diff --git a/src/blackgui/components/datamaininfoareacomponent.h b/src/blackgui/components/datamaininfoareacomponent.h index 9ec3fbb74..3913b98b3 100644 --- a/src/blackgui/components/datamaininfoareacomponent.h +++ b/src/blackgui/components/datamaininfoareacomponent.h @@ -14,6 +14,7 @@ #include "blackgui/blackguiexport.h" #include "blackgui/infoarea.h" +#include "blackmisc/network/webdataservicesprovider.h" #include #include @@ -24,12 +25,16 @@ namespace BlackGui namespace Components { class CLogComponent; - class CDataMappingComponent; + class CDbMappingComponent; + class CDbStashComponent; + class CDataInfoAreaComponent; /** * Main info area for data entry tool */ - class BLACKGUI_EXPORT CDataMainInfoAreaComponent : public BlackGui::CInfoArea + class BLACKGUI_EXPORT CDataMainInfoAreaComponent : + public BlackGui::CInfoArea, + public BlackMisc::Network::CWebDataServicesAware { Q_OBJECT @@ -38,9 +43,11 @@ namespace BlackGui enum InfoArea { // index must match tab index! - InfoAreaMapping = 0, - InfoAreaLog = 1, - InfoAreaSettings = 2, + InfoAreaData = 0, + InfoAreaMapping = 1, + InfoAreaStash = 2, + InfoAreaSettings = 3, + InfoAreaLog = 4, InfoAreaNone = -1 }; @@ -51,10 +58,19 @@ namespace BlackGui ~CDataMainInfoAreaComponent(); //! Log component - BlackGui::Components::CLogComponent *getLogComponent() const; + CLogComponent *getLogComponent() const; - //! Model component - BlackGui::Components::CDataMappingComponent *getMappingComponent() const; + //! Mapping component + CDbMappingComponent *getMappingComponent() const; + + //! Mapping component + CDataInfoAreaComponent *getDataInfoAreaComponent() const; + + //! Stash component + CDbStashComponent *getStashComponent() const; + + //! Set data reader + virtual void setProvider(BlackMisc::Network::IWebDataServicesProvider *provider) override; protected: //! \copydoc CInfoArea::getPreferredSizeWhenFloating diff --git a/src/blackgui/components/datamaininfoareacomponent.ui b/src/blackgui/components/datamaininfoareacomponent.ui index 6c1a9b3af..60ca3f99e 100644 --- a/src/blackgui/components/datamaininfoareacomponent.ui +++ b/src/blackgui/components/datamaininfoareacomponent.ui @@ -2,6 +2,20 @@ CDataMainInfoAreaComponent + + + 0 + 0 + 500 + 401 + + + + + 0 + 0 + + 500 @@ -11,19 +25,98 @@ MainWindow - - + + + + 0 + 0 + + + + + + + 0 + 0 + + Qt::TopDockWidgetArea - Models + Database data + + + 4 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + QFrame::NoFrame + + + QFrame::Plain + + + 0 + + + + 0 + + + 0 + + + 2 + + + 0 + + + 0 + + + + + + + + + + + + + false + + + Qt::TopDockWidgetArea + + + Mapping editor 4 - + 0 @@ -47,7 +140,7 @@ QFrame::Raised - + 0 @@ -64,7 +157,141 @@ 0 - + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + + + + + + Qt::TopDockWidgetArea + + + Stash + + + 4 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 0 + + + 0 + + + 2 + + + 0 + + + 0 + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + + + + + + Qt::TopDockWidgetArea + + + Settings + + + 4 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 0 + + + 0 + + + 2 + + + 0 + + + 0 + + + QFrame::StyledPanel @@ -167,9 +394,21 @@ 1 - BlackGui::Components::CDataMappingComponent + BlackGui::Components::CDataInfoAreaComponent + QWidget +
blackgui/components/datainfoareacomponent.h
+ 1 +
+ + BlackGui::Components::CDbMappingComponent QFrame -
blackgui/components/datamappingcomponent.h
+
blackgui/components/dbmappingcomponent.h
+ 1 +
+ + BlackGui::Components::CDbStashComponent + QFrame +
blackgui/components/dbstashcomponent.h
1