mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +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/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<InfoArea>(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<InfoArea>(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();
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
#include "blackgui/blackguiexport.h"
|
||||
#include "blackgui/infoarea.h"
|
||||
#include "blackmisc/network/webdataservicesprovider.h"
|
||||
#include <QMainWindow>
|
||||
#include <QScopedPointer>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -2,6 +2,20 @@
|
||||
<ui version="4.0">
|
||||
<class>CDataMainInfoAreaComponent</class>
|
||||
<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">
|
||||
<size>
|
||||
<width>500</width>
|
||||
@@ -11,19 +25,98 @@
|
||||
<property name="windowTitle">
|
||||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="qw_centralEmptyWidget"/>
|
||||
<widget class="BlackGui::CDockWidgetInfoArea" name="dwp_Mapping">
|
||||
<widget class="QWidget" name="qw_centralEmptyWidgetUsedAsPadding">
|
||||
<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">
|
||||
<set>Qt::TopDockWidgetArea</set>
|
||||
</property>
|
||||
<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>
|
||||
<attribute name="dockWidgetArea">
|
||||
<number>4</number>
|
||||
</attribute>
|
||||
<widget class="QWidget" name="qw_MappingOuter">
|
||||
<layout class="QVBoxLayout" name="vl_MissingModelsOuter">
|
||||
<layout class="QVBoxLayout" name="vl_MappingOuter">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
@@ -47,7 +140,7 @@
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="vl_MissingModelsInner">
|
||||
<layout class="QVBoxLayout" name="vl_MappingInner">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
@@ -64,7 +157,141 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<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">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
@@ -167,9 +394,21 @@
|
||||
<container>1</container>
|
||||
</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>
|
||||
<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>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
|
||||
Reference in New Issue
Block a user