swift
Loading...
Searching...
No Matches
interpolationcomponent.cpp
1// SPDX-FileCopyrightText: Copyright (C) 2018 swift Project Community / Contributors
2// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3
5
6#include "ui_interpolationcomponent.h"
7
11
12using namespace swift::misc;
13using namespace swift::misc::aviation;
14using namespace swift::gui::views;
15
17{
20 {
21 ui->setupUi(this);
22 ui->tw_InterpolationSetup->setCurrentIndex(0);
23
24 connect(ui->comp_CallsignCompleter, &CCallsignCompleter::validChangedCallsignEntered, this,
25 &CInterpolationComponent::displayInterpolationMessages);
26 connect(ui->pb_ReloadInterpolationMessages, &QPushButton::released, this,
27 &CInterpolationComponent::displayInterpolationMessages);
28 }
29
31
32 void CInterpolationComponent::displayInterpolationMessages()
33 {
34 if (!sGui || sGui->isShuttingDown() || !sGui->getIContextSimulator())
35 {
36 return;
37 }
38 const CCallsign cs = ui->comp_CallsignCompleter->getCallsign();
39 if (!cs.isValid())
40 {
41 return;
42 }
43
44 const CStatusMessageList messages = sGui->getIContextSimulator()->getInterpolationMessages(cs);
45 ui->tvp_InterpolationMessages->updateContainerMaybeAsync(messages);
46 }
47} // namespace swift::gui::components
void validChangedCallsignEntered()
Changed callsign entered.
CInterpolationComponent(QWidget *parent=nullptr)
Constructor.
Status messages, e.g. from Core -> GUI.
Value object encapsulating information of a callsign.
Definition callsign.h:30
bool isValid() const
Valid callsign?
Definition callsign.cpp:512
High level reusable GUI components.
Views, mainly QTableView.
Free functions in swift::misc.
QFrame(QWidget *parent, Qt::WindowFlags f)
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QObject * parent() const const
QWidget(QWidget *parent, Qt::WindowFlags f)