mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +08:00
[P3D] Adjustments for P3D v5
* guess version * added new version selection
This commit is contained in:
committed by
Mat Sutcliffe
parent
828b57f5a2
commit
8278a7d5e6
@@ -148,6 +148,7 @@ namespace BlackGui
|
|||||||
ui->pb_DisableRendering->setEnabled(m_pluginLoaded);
|
ui->pb_DisableRendering->setEnabled(m_pluginLoaded);
|
||||||
ui->pb_Check->setEnabled(!m_pluginLoaded);
|
ui->pb_Check->setEnabled(!m_pluginLoaded);
|
||||||
ui->pb_ApplyCGSource->setEnabled(m_pluginLoaded);
|
ui->pb_ApplyCGSource->setEnabled(m_pluginLoaded);
|
||||||
|
ui->pb_Reload->setEnabled(m_pluginLoaded);
|
||||||
|
|
||||||
if (m_pluginLoaded)
|
if (m_pluginLoaded)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -65,15 +65,7 @@
|
|||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="wi_Settings">
|
<widget class="QWidget" name="wi_Settings">
|
||||||
<property name="geometry">
|
<layout class="QGridLayout" name="gl_SimulatorSettings" columnstretch="1,3,0">
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>427</width>
|
|
||||||
<height>328</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="gl_SimulatorSettings" columnstretch="0,0,0">
|
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
<number>4</number>
|
<number>4</number>
|
||||||
</property>
|
</property>
|
||||||
@@ -102,6 +94,12 @@
|
|||||||
</item>
|
</item>
|
||||||
<item row="8" column="2">
|
<item row="8" column="2">
|
||||||
<widget class="QPushButton" name="pb_ApplyMaxAircraft">
|
<widget class="QPushButton" name="pb_ApplyMaxAircraft">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>125</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>apply</string>
|
<string>apply</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -109,6 +107,12 @@
|
|||||||
</item>
|
</item>
|
||||||
<item row="3" column="2">
|
<item row="3" column="2">
|
||||||
<widget class="QPushButton" name="pb_ApplyRecordOwnAircraftGnd">
|
<widget class="QPushButton" name="pb_ApplyRecordOwnAircraftGnd">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>125</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>apply</string>
|
<string>apply</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -192,6 +196,12 @@
|
|||||||
</item>
|
</item>
|
||||||
<item row="0" column="2">
|
<item row="0" column="2">
|
||||||
<widget class="QPushButton" name="pb_ApplyTimeSync">
|
<widget class="QPushButton" name="pb_ApplyTimeSync">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>125</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>apply</string>
|
<string>apply</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -199,6 +209,12 @@
|
|||||||
</item>
|
</item>
|
||||||
<item row="6" column="2">
|
<item row="6" column="2">
|
||||||
<widget class="QPushButton" name="pb_ClearRestrictedRendering">
|
<widget class="QPushButton" name="pb_ClearRestrictedRendering">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>125</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>clear</string>
|
<string>clear</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -213,6 +229,12 @@
|
|||||||
</item>
|
</item>
|
||||||
<item row="1" column="2">
|
<item row="1" column="2">
|
||||||
<widget class="QPushButton" name="pb_ApplyCGSource">
|
<widget class="QPushButton" name="pb_ApplyCGSource">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>125</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>apply</string>
|
<string>apply</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -220,6 +242,12 @@
|
|||||||
</item>
|
</item>
|
||||||
<item row="4" column="2">
|
<item row="4" column="2">
|
||||||
<widget class="QPushButton" name="pb_DisableRendering">
|
<widget class="QPushButton" name="pb_DisableRendering">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>125</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>disable all rendering</string>
|
<string>disable all rendering</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -264,6 +292,12 @@
|
|||||||
</item>
|
</item>
|
||||||
<item row="11" column="2">
|
<item row="11" column="2">
|
||||||
<widget class="QPushButton" name="pb_ApplyMaxDistance">
|
<widget class="QPushButton" name="pb_ApplyMaxDistance">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>125</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>apply</string>
|
<string>apply</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -391,6 +425,12 @@
|
|||||||
</item>
|
</item>
|
||||||
<item row="2" column="2">
|
<item row="2" column="2">
|
||||||
<widget class="QPushButton" name="pb_ApplyComSync">
|
<widget class="QPushButton" name="pb_ApplyComSync">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>125</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>apply</string>
|
<string>apply</string>
|
||||||
</property>
|
</property>
|
||||||
@@ -408,6 +448,12 @@
|
|||||||
</item>
|
</item>
|
||||||
<item row="12" column="2">
|
<item row="12" column="2">
|
||||||
<widget class="QPushButton" name="pb_Reload">
|
<widget class="QPushButton" name="pb_Reload">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>125</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>reload</string>
|
<string>reload</string>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
@@ -256,6 +256,18 @@ namespace BlackMisc
|
|||||||
return allPaths;
|
return allPaths;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString CFsCommonUtil::guessP3DVersion(const QString &candidate)
|
||||||
|
{
|
||||||
|
if (candidate.isEmpty()) { return "v4"; }
|
||||||
|
if (candidate.contains("v5", Qt::CaseInsensitive)) { return QStringLiteral("v5"); }
|
||||||
|
if (candidate.contains("v4", Qt::CaseInsensitive)) { return QStringLiteral("v4"); }
|
||||||
|
|
||||||
|
if (candidate.contains("5", Qt::CaseInsensitive)) { return QStringLiteral("v5"); }
|
||||||
|
if (candidate.contains("4", Qt::CaseInsensitive)) { return QStringLiteral("v4"); }
|
||||||
|
|
||||||
|
return "v5"; // that is the future (in 2020)
|
||||||
|
}
|
||||||
|
|
||||||
QString CFsCommonUtil::p3dSimObjectsDirFromSimDir(const QString &simDir)
|
QString CFsCommonUtil::p3dSimObjectsDirFromSimDir(const QString &simDir)
|
||||||
{
|
{
|
||||||
if (simDir.isEmpty()) { return {}; }
|
if (simDir.isEmpty()) { return {}; }
|
||||||
|
|||||||
@@ -57,7 +57,10 @@ namespace BlackMisc
|
|||||||
static QStringList fsxSimObjectsDirPlusAddOnXmlSimObjectsPaths(const QString &simObjectsDir = "");
|
static QStringList fsxSimObjectsDirPlusAddOnXmlSimObjectsPaths(const QString &simObjectsDir = "");
|
||||||
|
|
||||||
//! P3D's simObject dir and the add on dirs
|
//! P3D's simObject dir and the add on dirs
|
||||||
static QStringList p3dSimObjectsDirPlusAddOnXmlSimObjectsPaths(const QString &simObjectsDir = "", const QString &versionHint = "v4");
|
static QStringList p3dSimObjectsDirPlusAddOnXmlSimObjectsPaths(const QString &simObjectsDir, const QString &versionHint);
|
||||||
|
|
||||||
|
//! Guess the P3D version such as v4, v5
|
||||||
|
static QString guessP3DVersion(const QString &candidate);
|
||||||
|
|
||||||
//! P3D directory obtained from registry
|
//! P3D directory obtained from registry
|
||||||
static const QString &p3dDirFromRegistry();
|
static const QString &p3dDirFromRegistry();
|
||||||
|
|||||||
@@ -588,12 +588,15 @@ namespace BlackMisc
|
|||||||
switch (m_simulator.getSimulator())
|
switch (m_simulator.getSimulator())
|
||||||
{
|
{
|
||||||
case CSimulatorInfo::FG: dirs = QStringList(CFlightgearUtil::modelDirectoriesFromSimDir(s)); break;
|
case CSimulatorInfo::FG: dirs = QStringList(CFlightgearUtil::modelDirectoriesFromSimDir(s)); break;
|
||||||
case CSimulatorInfo::FS9: dirs = QStringList({CFsCommonUtil::fs9AircraftDirFromSimDir(s)}); break;
|
case CSimulatorInfo::FS9: dirs = QStringList({ CFsCommonUtil::fs9AircraftDirFromSimDir(s) }); break;
|
||||||
case CSimulatorInfo::FSX:
|
case CSimulatorInfo::FSX:
|
||||||
dirs = CFsCommonUtil::fsxSimObjectsDirPlusAddOnXmlSimObjectsPaths(CFsCommonUtil::fsxSimObjectsDirFromSimDir(s));
|
dirs = CFsCommonUtil::fsxSimObjectsDirPlusAddOnXmlSimObjectsPaths(CFsCommonUtil::fsxSimObjectsDirFromSimDir(s));
|
||||||
break;
|
break;
|
||||||
case CSimulatorInfo::P3D:
|
case CSimulatorInfo::P3D:
|
||||||
dirs = CFsCommonUtil::p3dSimObjectsDirPlusAddOnXmlSimObjectsPaths(CFsCommonUtil::p3dSimObjectsDirFromSimDir(s));
|
{
|
||||||
|
const QString versionHint = CFsCommonUtil::guessP3DVersion(s);
|
||||||
|
dirs = CFsCommonUtil::p3dSimObjectsDirPlusAddOnXmlSimObjectsPaths(CFsCommonUtil::p3dSimObjectsDirFromSimDir(s), versionHint);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case CSimulatorInfo::XPLANE: dirs = QStringList({CXPlaneUtil::modelDirectoriesFromSimDir(s)}); break;
|
case CSimulatorInfo::XPLANE: dirs = QStringList({CXPlaneUtil::modelDirectoriesFromSimDir(s)}); break;
|
||||||
default: break;
|
default: break;
|
||||||
@@ -678,8 +681,10 @@ namespace BlackMisc
|
|||||||
}
|
}
|
||||||
case CSimulatorInfo::P3D:
|
case CSimulatorInfo::P3D:
|
||||||
{
|
{
|
||||||
if (CFsCommonUtil::p3dSimObjectsDir().isEmpty()) { return e; }
|
static const QString p3d = CFsCommonUtil::p3dSimObjectsDir();
|
||||||
static const QStringList md = CFsCommonUtil::p3dSimObjectsDirPlusAddOnXmlSimObjectsPaths();
|
if (p3d.isEmpty()) { return e; }
|
||||||
|
static const QString versionHint = CFsCommonUtil::guessP3DVersion(p3d);
|
||||||
|
static const QStringList md = CFsCommonUtil::p3dSimObjectsDirPlusAddOnXmlSimObjectsPaths(p3d, versionHint);
|
||||||
return md;
|
return md;
|
||||||
}
|
}
|
||||||
case CSimulatorInfo::XPLANE:
|
case CSimulatorInfo::XPLANE:
|
||||||
|
|||||||
@@ -252,7 +252,7 @@ namespace BlackSimPlugin
|
|||||||
ui->cb_P3DVersion->setCurrentText(found ? v : "");
|
ui->cb_P3DVersion->setCurrentText(found ? v : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
void BlackSimPlugin::FsxCommon::CSimConnectSettingsComponent::onP3DVersionChanged(const QString &version)
|
void CSimConnectSettingsComponent::onP3DVersionChanged(const QString &version)
|
||||||
{
|
{
|
||||||
if (m_p3dVersion.get() == version) { return; }
|
if (m_p3dVersion.get() == version) { return; }
|
||||||
const CStatusMessage saveMsg = m_p3dVersion.setAndSave(version);
|
const CStatusMessage saveMsg = m_p3dVersion.setAndSave(version);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>410</width>
|
<width>410</width>
|
||||||
<height>466</height>
|
<height>481</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
@@ -156,11 +156,31 @@ console=1
|
|||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QComboBox" name="cb_P3DVersion">
|
<widget class="QComboBox" name="cb_P3DVersion">
|
||||||
<property name="currentText">
|
<property name="currentText">
|
||||||
<string>4.5 64bit</string>
|
<string>6.0 64bit</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>6.0 64bit</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>5.2 64bit</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>5.1 64bit</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>5.0 64bit</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>4.5 64bit</string>
|
<string>4.5 64bit</string>
|
||||||
|
|||||||
@@ -191,6 +191,11 @@ P3DSimConnectVersion stringToP3DVersion(const QString &p3d)
|
|||||||
if (p.contains("43")) { return P3DSimConnectv43; }
|
if (p.contains("43")) { return P3DSimConnectv43; }
|
||||||
if (p.contains("44")) { return P3DSimConnectv44; }
|
if (p.contains("44")) { return P3DSimConnectv44; }
|
||||||
if (p.contains("45")) { return P3DSimConnectv45; }
|
if (p.contains("45")) { return P3DSimConnectv45; }
|
||||||
|
|
||||||
|
if (p.contains("50")) { return P3DSimConnectv45; }
|
||||||
|
if (p.contains("51")) { return P3DSimConnectv45; }
|
||||||
|
if (p.contains("52")) { return P3DSimConnectv45; }
|
||||||
|
|
||||||
}
|
}
|
||||||
return P3DSimConnectv44; // default
|
return P3DSimConnectv44; // default
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -664,9 +664,10 @@ void CSwiftLauncher::showSimulatorConfigDirs()
|
|||||||
|
|
||||||
if (s == ui->pb_P3DConfigDirs)
|
if (s == ui->pb_P3DConfigDirs)
|
||||||
{
|
{
|
||||||
dirs = CFsCommonUtil::p3dSimObjectsDirPlusAddOnXmlSimObjectsPaths();
|
|
||||||
simDir = CFsCommonUtil::p3dDir();
|
simDir = CFsCommonUtil::p3dDir();
|
||||||
simObjDir = CFsCommonUtil::p3dSimObjectsDir();
|
simObjDir = CFsCommonUtil::p3dSimObjectsDir();
|
||||||
|
const QString versionHint = CFsCommonUtil::guessP3DVersion(simDir);
|
||||||
|
dirs = CFsCommonUtil::p3dSimObjectsDirPlusAddOnXmlSimObjectsPaths(simObjDir, versionHint);
|
||||||
}
|
}
|
||||||
else if (s == ui->pb_FSXConfigDirs)
|
else if (s == ui->pb_FSXConfigDirs)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user