mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-05 17:55:45 +08:00
refs #452 the main info area for the mapping tool
This commit is contained in:
committed by
Mathew Sutcliffe
parent
89ed13276e
commit
b7d72d3499
@@ -8,8 +8,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "blackgui/components/logcomponent.h"
|
#include "blackgui/components/logcomponent.h"
|
||||||
#include "blackgui/components/datamappingcomponent.h"
|
|
||||||
#include "blackgui/components/datamaininfoareacomponent.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 "ui_datamaininfoareacomponent.h"
|
||||||
#include "blackmisc/icons.h"
|
#include "blackmisc/icons.h"
|
||||||
|
|
||||||
@@ -28,6 +30,9 @@ namespace BlackGui
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
initInfoArea(); // init base class
|
initInfoArea(); // init base class
|
||||||
this->setWindowIcon(CIcons::swiftDatabase24());
|
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()
|
CDataMainInfoAreaComponent::~CDataMainInfoAreaComponent()
|
||||||
@@ -38,18 +43,38 @@ namespace BlackGui
|
|||||||
return this->ui->comp_Log;
|
return this->ui->comp_Log;
|
||||||
}
|
}
|
||||||
|
|
||||||
CDataMappingComponent *CDataMainInfoAreaComponent::getMappingComponent() const
|
CDbMappingComponent *CDataMainInfoAreaComponent::getMappingComponent() const
|
||||||
{
|
{
|
||||||
return this->ui->comp_Mapping;
|
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
|
QSize CDataMainInfoAreaComponent::getPreferredSizeWhenFloating(int areaIndex) const
|
||||||
{
|
{
|
||||||
InfoArea area = static_cast<InfoArea>(areaIndex);
|
InfoArea area = static_cast<InfoArea>(areaIndex);
|
||||||
switch (area)
|
switch (area)
|
||||||
{
|
{
|
||||||
|
case InfoAreaData:
|
||||||
case InfoAreaMapping:
|
case InfoAreaMapping:
|
||||||
case InfoAreaSettings:
|
case InfoAreaSettings:
|
||||||
|
case InfoAreaStash:
|
||||||
case InfoAreaLog:
|
case InfoAreaLog:
|
||||||
default:
|
default:
|
||||||
return QSize(800, 600);
|
return QSize(800, 600);
|
||||||
@@ -61,12 +86,16 @@ namespace BlackGui
|
|||||||
InfoArea area = static_cast<InfoArea>(areaIndex);
|
InfoArea area = static_cast<InfoArea>(areaIndex);
|
||||||
switch (area)
|
switch (area)
|
||||||
{
|
{
|
||||||
|
case InfoAreaData:
|
||||||
|
return CIcons::appDatabase16();
|
||||||
case InfoAreaMapping:
|
case InfoAreaMapping:
|
||||||
return CIcons::appMappings16();
|
return CIcons::appMappings16();
|
||||||
case InfoAreaSettings:
|
case InfoAreaSettings:
|
||||||
return CIcons::appSettings16();
|
return CIcons::appSettings16();
|
||||||
case InfoAreaLog:
|
case InfoAreaLog:
|
||||||
return CIcons::appLog16();
|
return CIcons::appLog16();
|
||||||
|
case InfoAreaStash:
|
||||||
|
return CIcons::appDbStash16();
|
||||||
default:
|
default:
|
||||||
return CIcons::empty();
|
return CIcons::empty();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
#include "blackgui/blackguiexport.h"
|
#include "blackgui/blackguiexport.h"
|
||||||
#include "blackgui/infoarea.h"
|
#include "blackgui/infoarea.h"
|
||||||
|
#include "blackmisc/network/webdataservicesprovider.h"
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
#include <QScopedPointer>
|
#include <QScopedPointer>
|
||||||
|
|
||||||
@@ -24,12 +25,16 @@ namespace BlackGui
|
|||||||
namespace Components
|
namespace Components
|
||||||
{
|
{
|
||||||
class CLogComponent;
|
class CLogComponent;
|
||||||
class CDataMappingComponent;
|
class CDbMappingComponent;
|
||||||
|
class CDbStashComponent;
|
||||||
|
class CDataInfoAreaComponent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main info area for data entry tool
|
* 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
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -38,9 +43,11 @@ namespace BlackGui
|
|||||||
enum InfoArea
|
enum InfoArea
|
||||||
{
|
{
|
||||||
// index must match tab index!
|
// index must match tab index!
|
||||||
InfoAreaMapping = 0,
|
InfoAreaData = 0,
|
||||||
InfoAreaLog = 1,
|
InfoAreaMapping = 1,
|
||||||
InfoAreaSettings = 2,
|
InfoAreaStash = 2,
|
||||||
|
InfoAreaSettings = 3,
|
||||||
|
InfoAreaLog = 4,
|
||||||
InfoAreaNone = -1
|
InfoAreaNone = -1
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -51,10 +58,19 @@ namespace BlackGui
|
|||||||
~CDataMainInfoAreaComponent();
|
~CDataMainInfoAreaComponent();
|
||||||
|
|
||||||
//! Log component
|
//! Log component
|
||||||
BlackGui::Components::CLogComponent *getLogComponent() const;
|
CLogComponent *getLogComponent() const;
|
||||||
|
|
||||||
//! Model component
|
//! Mapping component
|
||||||
BlackGui::Components::CDataMappingComponent *getMappingComponent() const;
|
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:
|
protected:
|
||||||
//! \copydoc CInfoArea::getPreferredSizeWhenFloating
|
//! \copydoc CInfoArea::getPreferredSizeWhenFloating
|
||||||
|
|||||||
@@ -2,6 +2,20 @@
|
|||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>CDataMainInfoAreaComponent</class>
|
<class>CDataMainInfoAreaComponent</class>
|
||||||
<widget class="QMainWindow" name="CDataMainInfoAreaComponent">
|
<widget class="QMainWindow" name="CDataMainInfoAreaComponent">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>500</width>
|
||||||
|
<height>401</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>500</width>
|
<width>500</width>
|
||||||
@@ -11,19 +25,98 @@
|
|||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>MainWindow</string>
|
<string>MainWindow</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="qw_centralEmptyWidget"/>
|
<widget class="QWidget" name="qw_centralEmptyWidgetUsedAsPadding">
|
||||||
<widget class="BlackGui::CDockWidgetInfoArea" name="dwp_Mapping">
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="BlackGui::CDockWidgetInfoArea" name="dwp_DataInfoArea">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
<property name="allowedAreas">
|
<property name="allowedAreas">
|
||||||
<set>Qt::TopDockWidgetArea</set>
|
<set>Qt::TopDockWidgetArea</set>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Models</string>
|
<string>Database data</string>
|
||||||
|
</property>
|
||||||
|
<attribute name="dockWidgetArea">
|
||||||
|
<number>4</number>
|
||||||
|
</attribute>
|
||||||
|
<widget class="QWidget" name="qw_DataInfoAreaOuter">
|
||||||
|
<layout class="QVBoxLayout" name="vl_AircraftModelsOuter">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="fr_DataInfoAreaInner">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::NoFrame</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Plain</enum>
|
||||||
|
</property>
|
||||||
|
<property name="lineWidth">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="vl_AircraftModelsInner">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="BlackGui::Components::CDataInfoAreaComponent" name="comp_DataInfoArea" native="true"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<widget class="BlackGui::CDockWidgetInfoArea" name="dwp_Mapping">
|
||||||
|
<property name="floating">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="allowedAreas">
|
||||||
|
<set>Qt::TopDockWidgetArea</set>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Mapping editor</string>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="dockWidgetArea">
|
<attribute name="dockWidgetArea">
|
||||||
<number>4</number>
|
<number>4</number>
|
||||||
</attribute>
|
</attribute>
|
||||||
<widget class="QWidget" name="qw_MappingOuter">
|
<widget class="QWidget" name="qw_MappingOuter">
|
||||||
<layout class="QVBoxLayout" name="vl_MissingModelsOuter">
|
<layout class="QVBoxLayout" name="vl_MappingOuter">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
@@ -47,7 +140,7 @@
|
|||||||
<property name="frameShadow">
|
<property name="frameShadow">
|
||||||
<enum>QFrame::Raised</enum>
|
<enum>QFrame::Raised</enum>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="vl_MissingModelsInner">
|
<layout class="QVBoxLayout" name="vl_MappingInner">
|
||||||
<property name="spacing">
|
<property name="spacing">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
@@ -64,7 +157,141 @@
|
|||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="BlackGui::Components::CDataMappingComponent" name="comp_Mapping">
|
<widget class="BlackGui::Components::CDbMappingComponent" name="comp_Mapping">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<widget class="BlackGui::CDockWidgetInfoArea" name="dwp_Stash">
|
||||||
|
<property name="allowedAreas">
|
||||||
|
<set>Qt::TopDockWidgetArea</set>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Stash</string>
|
||||||
|
</property>
|
||||||
|
<attribute name="dockWidgetArea">
|
||||||
|
<number>4</number>
|
||||||
|
</attribute>
|
||||||
|
<widget class="QWidget" name="qw_StashOuter">
|
||||||
|
<layout class="QVBoxLayout" name="vl_StashOuter">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="fr_StashInner">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="vl_StashInner">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="BlackGui::Components::CDbStashComponent" name="comp_Stash">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<widget class="BlackGui::CDockWidgetInfoArea" name="dwp_Settings">
|
||||||
|
<property name="allowedAreas">
|
||||||
|
<set>Qt::TopDockWidgetArea</set>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Settings</string>
|
||||||
|
</property>
|
||||||
|
<attribute name="dockWidgetArea">
|
||||||
|
<number>4</number>
|
||||||
|
</attribute>
|
||||||
|
<widget class="QWidget" name="qw_SettingsOuter">
|
||||||
|
<layout class="QVBoxLayout" name="vl_SettingsOuter">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="fr_SettingsInner">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="vl_SettingsInner">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<widget class="QFrame" name="comp_Settings">
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::StyledPanel</enum>
|
<enum>QFrame::StyledPanel</enum>
|
||||||
</property>
|
</property>
|
||||||
@@ -167,9 +394,21 @@
|
|||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>BlackGui::Components::CDataMappingComponent</class>
|
<class>BlackGui::Components::CDataInfoAreaComponent</class>
|
||||||
|
<extends>QWidget</extends>
|
||||||
|
<header>blackgui/components/datainfoareacomponent.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>BlackGui::Components::CDbMappingComponent</class>
|
||||||
<extends>QFrame</extends>
|
<extends>QFrame</extends>
|
||||||
<header>blackgui/components/datamappingcomponent.h</header>
|
<header>blackgui/components/dbmappingcomponent.h</header>
|
||||||
|
<container>1</container>
|
||||||
|
</customwidget>
|
||||||
|
<customwidget>
|
||||||
|
<class>BlackGui::Components::CDbStashComponent</class>
|
||||||
|
<extends>QFrame</extends>
|
||||||
|
<header>blackgui/components/dbstashcomponent.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
|
|||||||
Reference in New Issue
Block a user