6 #include <QDesktopServices>
10 #include <QMessageBox>
11 #include <QStringBuilder>
13 #include "ui_simconnectsettingscomponent.h"
23 using namespace swift::config;
25 using namespace swift::misc::simulation;
26 using namespace swift::misc::simulation::fsx;
27 using namespace swift::misc::network;
30 namespace swift::simplugin::fsxcommon
32 CSimConnectSettingsComponent::CSimConnectSettingsComponent(QWidget *parent)
37 this->setSimConnectInfo();
41 connect(ui->cb_P3DVersion, &QComboBox::currentTextChanged,
this,
42 &CSimConnectSettingsComponent::onP3DVersionChanged);
51 void CSimConnectSettingsComponent::setSimConnectInfo()
53 if (CBuildConfig::isCompiledWithP3DSupport() && CBuildConfig::buildWordSize() == 64)
55 ui->pte_SimConnectInfo->setPlainText(
"Static linking P3Dv4 x64");
59 const QString v = m_p3dVersion.
get();
65 ui->pte_SimConnectInfo->setPlainText(SimConnectInfo.
summary());
70 ui->lbl_P3DVersion->setVisible(m_p3d64bit);
71 ui->cb_P3DVersion->setVisible(m_p3d64bit);
74 void CSimConnectSettingsComponent::setComboBox(
const QString &value)
78 for (
int index = 0; index < ui->cb_P3DVersion->count(); index++)
80 v = ui->cb_P3DVersion->itemText(index);
81 if (v.contains(value, Qt::CaseInsensitive))
87 ui->cb_P3DVersion->setCurrentText(found ? v :
"");
90 void CSimConnectSettingsComponent::onP3DVersionChanged(
const QString &version)
92 if (m_p3dVersion.
get() == version) {
return; }
98 u
"Changed P3D version to '%1'. Requires a new start of swift to become effective!")
bool showOverlayMessage(const swift::misc::CStatusMessage &message, std::chrono::milliseconds timeout=std::chrono::milliseconds(0))
Show single message.
Using this class provides a QFrame with the overlay functionality already integrated.
CStatusMessage setAndSave(const T &value, qint64 timestamp=0)
Write and save in the same step. Must be called from the thread in which the owner lives.
T get() const
Get a copy of the current value.
Derived & info(const char16_t(&format)[N])
Set the severity to info, providing a format string.
Streamable status message, e.g.
bool isSuccess() const
Operation considered successful.
Simple hardcoded info about the corresponding simulator.
A component that gathers all SimConnect related settings.
virtual ~CSimConnectSettingsComponent()
Dtor.
Free functions in swift::misc.
QString summary() const
Summary.