mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
Ref T335, UI to enable/disable terrain probe
This commit is contained in:
@@ -25,7 +25,10 @@ namespace BlackSimPlugin
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->cb_TraceSimConnectCalls->setChecked(false);
|
||||
|
||||
connect(ui->cb_TraceSimConnectCalls, &QCheckBox::released, this, &CFsxSettingsComponent::onSimConnectTraceChanged);
|
||||
connect(ui->cb_EnableTerrainProbe, &QCheckBox::released, this, &CFsxSettingsComponent::onEnableTerrainProbeChanged);
|
||||
|
||||
const CSimulatorFsxCommon *fsx = this->getFsxSimulator();
|
||||
if (fsx)
|
||||
{
|
||||
@@ -43,9 +46,16 @@ namespace BlackSimPlugin
|
||||
fsx->setTractingSendId(ui->cb_TraceSimConnectCalls->isChecked());
|
||||
}
|
||||
|
||||
void CFsxSettingsComponent::onEnableTerrainProbeChanged()
|
||||
{
|
||||
CSimulatorFsxCommon *fsx = this->getFsxSimulator();
|
||||
if (!fsx) { return; }
|
||||
fsx->setUsingFsxTerrainProbe(ui->cb_EnableTerrainProbe->isChecked());
|
||||
}
|
||||
|
||||
CSimulatorFsxCommon *CFsxSettingsComponent::getFsxSimulator() const
|
||||
{
|
||||
if (!sGui || !sGui->getISimulator()) { return nullptr; }
|
||||
if (!sGui || !sGui->getISimulator() || sGui->isShuttingDown()) { return nullptr; }
|
||||
ISimulator *sim = sGui->getISimulator();
|
||||
if (!sim->getSimulatorInfo().isFsxP3DFamily()) { return nullptr; }
|
||||
if (sim->getSimulatorInfo() != m_simulator) { return nullptr; }
|
||||
|
||||
@@ -39,9 +39,12 @@ namespace BlackSimPlugin
|
||||
void setSimulator(const BlackMisc::Simulation::CSimulatorInfo &simulator) { m_simulator = simulator; }
|
||||
|
||||
private:
|
||||
//! Checkbox change
|
||||
//! Trace checkbox changed
|
||||
void onSimConnectTraceChanged();
|
||||
|
||||
//! Terrain probe checkbox changed
|
||||
void onEnableTerrainProbeChanged();
|
||||
|
||||
//! Access the concrete implementation
|
||||
CSimulatorFsxCommon *getFsxSimulator () const;
|
||||
|
||||
|
||||
@@ -6,22 +6,22 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>326</width>
|
||||
<height>47</height>
|
||||
<width>180</width>
|
||||
<height>64</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>FSX settings</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="hl_FsxSettingsComponent" stretch="0,1">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gl_FsxSettingsComponent">
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="cb_TraceSimConnectCalls">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="lbl_TraceSimConnectCalls">
|
||||
<property name="text">
|
||||
<string>Trace simConnect calls (this will trace sendId calls and provide further information)</string>
|
||||
@@ -31,6 +31,20 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="cb_EnableTerrainProbe">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="lbl_TraceTerrainProbe">
|
||||
<property name="text">
|
||||
<string>Use the terrain probe</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace BlackSimPlugin
|
||||
CSimulatorFsxConfig(QObject *parent = nullptr);
|
||||
|
||||
//! Dtor
|
||||
virtual ~CSimulatorFsxConfig() {}
|
||||
virtual ~CSimulatorFsxConfig() override {}
|
||||
|
||||
//! \copydoc BlackGui::IPluginConfig::createConfigWindow()
|
||||
BlackGui::CPluginConfigWindow *createConfigWindow(QWidget *parent) override;
|
||||
|
||||
Reference in New Issue
Block a user