mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-24 07:55:35 +08:00
refs #910, display SimConnect info in settings
This commit is contained in:
committed by
Mathew Sutcliffe
parent
83c0dd6dfa
commit
61dc32e894
@@ -13,8 +13,8 @@
|
||||
#include "blackcore/context/contextapplication.h"
|
||||
#include "blackcore/context/contextsimulator.h"
|
||||
#include "blackmisc/network/networkutils.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/simulation/fsx/simconnectutilities.h"
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include <QFileInfo>
|
||||
#include <QDesktopServices>
|
||||
#include <QMessageBox>
|
||||
@@ -40,6 +40,8 @@ namespace BlackSimPlugin
|
||||
connect(ui->pb_SettingsFsxExistsSimconncetCfg, &QPushButton::clicked, this, &CSimConnectSettingsComponent::checkSimConnectCfgFile);
|
||||
connect(ui->pb_SettingsFsxSaveSimconnectCfg, &QPushButton::clicked, this, &CSimConnectSettingsComponent::saveSimConnectCfgFile);
|
||||
connect(ui->pb_SettingsFsxTestConnection, &QPushButton::clicked, this, &CSimConnectSettingsComponent::testSimConnectConnection);
|
||||
|
||||
this->setSimConnectInfo();
|
||||
}
|
||||
|
||||
CSimConnectSettingsComponent::~CSimConnectSettingsComponent()
|
||||
@@ -50,8 +52,7 @@ namespace BlackSimPlugin
|
||||
void CSimConnectSettingsComponent::openSimConnectCfgFile()
|
||||
{
|
||||
const QFileInfo info(CSimConnectUtilities::getLocalSimConnectCfgFilename());
|
||||
const QString path = QDir::toNativeSeparators(info.absolutePath());
|
||||
QDesktopServices::openUrl(QUrl(QStringLiteral("file:///") % path));
|
||||
QDesktopServices::openUrl(QUrl::fromLocalFile(info.absoluteFilePath()));
|
||||
}
|
||||
|
||||
void CSimConnectSettingsComponent::deleteSimConnectCfgFile()
|
||||
@@ -138,7 +139,7 @@ namespace BlackSimPlugin
|
||||
return;
|
||||
}
|
||||
|
||||
int p = port.toInt();
|
||||
const int p = port.toInt();
|
||||
QString fileName;
|
||||
|
||||
if (sGui->getIContextSimulator())
|
||||
@@ -171,5 +172,11 @@ namespace BlackSimPlugin
|
||||
tr("Failed writing '%1'!").arg(fileName));
|
||||
}
|
||||
}
|
||||
|
||||
void CSimConnectSettingsComponent::setSimConnectInfo()
|
||||
{
|
||||
const CWinDllUtils::DLLInfo simConnectInfo = CSimConnectUtilities::simConnectDllInfo();
|
||||
ui->lbl_SimConnectInfo->setText(simConnectInfo.summary());
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -52,6 +52,9 @@ namespace BlackSimPlugin
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CSimConnectSettingsComponent> ui;
|
||||
|
||||
//! Set the simconnect info
|
||||
void setSimConnectInfo();
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>159</height>
|
||||
<width>363</width>
|
||||
<height>179</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -32,14 +32,14 @@
|
||||
<property name="bottomMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<item row="0" column="0">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lbl_SettingsFsxAddress">
|
||||
<property name="text">
|
||||
<string>Address</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="le_SettingsFsxAddress">
|
||||
<property name="text">
|
||||
<string>127.0.0.1</string>
|
||||
@@ -52,14 +52,14 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="lbl_SettingsFsxPort">
|
||||
<property name="text">
|
||||
<string>Port</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="le_SettingsFsxPort">
|
||||
<property name="text">
|
||||
<string>500</string>
|
||||
@@ -69,7 +69,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="lbl_SettingsFsxExistsSimconncetCfg">
|
||||
<property name="toolTip">
|
||||
<string>is 'SimConnect.cfg' available?</string>
|
||||
@@ -79,7 +79,7 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<item row="3" column="1">
|
||||
<widget class="QWidget" name="wi_SettingsFsxExistsSimconncetCfg" native="true">
|
||||
<layout class="QHBoxLayout" name="hl_SettingsFsxExistsSimconncetCfg">
|
||||
<property name="spacing">
|
||||
@@ -129,7 +129,7 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<item row="4" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="hl_SettingsSimconnectCfgButtons">
|
||||
<property name="spacing">
|
||||
<number>3</number>
|
||||
@@ -227,6 +227,23 @@
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lbl_SimConnect">
|
||||
<property name="text">
|
||||
<string>SimConnect</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="lbl_SimConnectInfo">
|
||||
<property name="text">
|
||||
<string>info about version, ...</string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user