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