mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
Ref T421, UI for the interpolation log.messages
This commit is contained in:
@@ -10,6 +10,14 @@
|
||||
#include "interpolationcomponent.h"
|
||||
#include "ui_interpolationcomponent.h"
|
||||
|
||||
#include "blackgui/guiapplication.h"
|
||||
#include "blackgui/views/statusmessageview.h"
|
||||
#include "blackcore/context/contextsimulator.h"
|
||||
|
||||
using namespace BlackMisc;
|
||||
using namespace BlackMisc::Aviation;
|
||||
using namespace BlackGui::Views;
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Components
|
||||
@@ -22,9 +30,21 @@ namespace BlackGui
|
||||
ui->tw_InterpolationSetup->setCurrentIndex(0);
|
||||
|
||||
connect(ui->comp_InterpolationSetup, &CInterpolationSetupComponent::requestRenderingRestrictionsWidget, this, &CInterpolationComponent::requestRenderingRestrictionsWidget);
|
||||
connect(ui->comp_CallsignCompleter, &CCallsignCompleter::validCallsignEntered, this, &CInterpolationComponent::displayInterpolationMessages);
|
||||
connect(ui->pb_ReloadInterpolationMessages, &QPushButton::released, this, &CInterpolationComponent::displayInterpolationMessages);
|
||||
}
|
||||
|
||||
CInterpolationComponent::~CInterpolationComponent()
|
||||
{ }
|
||||
|
||||
void CInterpolationComponent::displayInterpolationMessages()
|
||||
{
|
||||
if (!sGui || sGui->isShuttingDown() || !sGui->getIContextSimulator()) { return; }
|
||||
const CCallsign cs = ui->comp_CallsignCompleter->getCallsign();
|
||||
if (!cs.isValid()) { return; }
|
||||
|
||||
const CStatusMessageList messages = sGui->getIContextSimulator()->getInterpolationMessages(cs);
|
||||
ui->tvp_InterpolationMessages->updateContainerMaybeAsync(messages);
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#ifndef BLACKGUI_COMPONENTS_INTERPOLATIONCOMPONENT_H
|
||||
#define BLACKGUI_COMPONENTS_INTERPOLATIONCOMPONENT_H
|
||||
|
||||
#include "blackmisc/aviation/callsign.h"
|
||||
#include <QFrame>
|
||||
#include <QScopedPointer>
|
||||
#include "blackgui/blackguiexport.h"
|
||||
@@ -39,6 +40,9 @@ namespace BlackGui
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CInterpolationComponent> ui;
|
||||
|
||||
//! Display log messages
|
||||
void displayInterpolationMessages();
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Frame</string>
|
||||
<string>Interpolation component</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="vl_InterpolationComponent">
|
||||
<property name="leftMargin">
|
||||
@@ -71,7 +71,50 @@
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="BlackGui::Components::CAircraftPartsHistory" name="PartsHistory"/>
|
||||
<widget class="BlackGui::Components::CAircraftPartsHistory" name="comp_PartsHistory"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tb_InterpolationLog">
|
||||
<attribute name="title">
|
||||
<string>Interpolation log.</string>
|
||||
</attribute>
|
||||
<layout class="QVBoxLayout" name="vl_InterpolationLog">
|
||||
<property name="leftMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="BlackGui::Components::CCallsignCompleter" name="comp_CallsignCompleter">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="BlackGui::Views::CStatusMessageView" name="tvp_InterpolationMessages">
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item alignment="Qt::AlignRight">
|
||||
<widget class="QPushButton" name="pb_ReloadInterpolationMessages">
|
||||
<property name="text">
|
||||
<string>reload</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
@@ -92,6 +135,17 @@
|
||||
<header>blackgui/components/interpolationsetupcomponent.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>BlackGui::Components::CCallsignCompleter</class>
|
||||
<extends>QFrame</extends>
|
||||
<header>blackgui/components/callsigncompleter.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>BlackGui::Views::CStatusMessageView</class>
|
||||
<extends>QTableView</extends>
|
||||
<header>blackgui/views/statusmessageview.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
||||
@@ -20,16 +20,13 @@
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class QWidget;
|
||||
|
||||
namespace BlackGui
|
||||
{
|
||||
namespace Filters { class CStatusMessageFilterDialog; }
|
||||
namespace Views
|
||||
{
|
||||
//! Status message view
|
||||
class BLACKGUI_EXPORT CStatusMessageView :
|
||||
public CViewBase<Models::CStatusMessageListModel, BlackMisc::CStatusMessageList, BlackMisc::CStatusMessage>
|
||||
class BLACKGUI_EXPORT CStatusMessageView : public CViewBase<Models::CStatusMessageListModel, BlackMisc::CStatusMessageList, BlackMisc::CStatusMessage>
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
Reference in New Issue
Block a user