mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-23 13:55:36 +08:00
Check for minimum mapping version
* check functions in gui application/application * check for instance mapping wizard * check on mapping tool's stashing component
This commit is contained in:
@@ -457,6 +457,11 @@ namespace BlackCore
|
|||||||
return m_setupReader->asyncLoad();
|
return m_setupReader->asyncLoad();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CApplication::hasMinimumMappingVersion() const
|
||||||
|
{
|
||||||
|
return (this->getGlobalSetup().isSwiftVersionMinimumMappingVersion());
|
||||||
|
}
|
||||||
|
|
||||||
bool CApplication::hasWebDataServices() const
|
bool CApplication::hasWebDataServices() const
|
||||||
{
|
{
|
||||||
if (this->isShuttingDown()) { return false; } // service will not survive for long
|
if (this->isShuttingDown()) { return false; } // service will not survive for long
|
||||||
|
|||||||
@@ -382,6 +382,9 @@ namespace BlackCore
|
|||||||
//! Reload setup and version
|
//! Reload setup and version
|
||||||
BlackMisc::CStatusMessageList requestReloadOfSetupAndVersion();
|
BlackMisc::CStatusMessageList requestReloadOfSetupAndVersion();
|
||||||
|
|
||||||
|
//! Minimum mapping version check
|
||||||
|
virtual bool hasMinimumMappingVersion() const;
|
||||||
|
|
||||||
//! Read and wait for setup
|
//! Read and wait for setup
|
||||||
//! \sa waitForSetup
|
//! \sa waitForSetup
|
||||||
BlackMisc::CStatusMessageList synchronizeSetup(int timeoutMs = BlackMisc::Network::CNetworkUtils::getLongTimeoutMs());
|
BlackMisc::CStatusMessageList synchronizeSetup(int timeoutMs = BlackMisc::Network::CNetworkUtils::getLongTimeoutMs());
|
||||||
|
|||||||
@@ -269,6 +269,7 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
if (!sGui || sGui->isShuttingDown() || !sGui->hasWebDataServices()) { return; }
|
if (!sGui || sGui->isShuttingDown() || !sGui->hasWebDataServices()) { return; }
|
||||||
if (ui->tvp_StashAircraftModels->isEmpty()) { return; }
|
if (ui->tvp_StashAircraftModels->isEmpty()) { return; }
|
||||||
|
if (!sGui->hasMinimumMappingVersion()) { return; }
|
||||||
|
|
||||||
// get models right here, because later steps might affect selection
|
// get models right here, because later steps might affect selection
|
||||||
const CAircraftModelList models(getSelectedOrAllModels());
|
const CAircraftModelList models(getSelectedOrAllModels());
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
#include "blackconfig/buildconfig.h"
|
#include "blackconfig/buildconfig.h"
|
||||||
|
|
||||||
#include <QDialogButtonBox>
|
#include <QDialogButtonBox>
|
||||||
|
#include <QMessageBox>
|
||||||
#include <QGroupBox>
|
#include <QGroupBox>
|
||||||
#include <QIntValidator>
|
#include <QIntValidator>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
@@ -693,6 +694,8 @@ namespace BlackGui
|
|||||||
void CLoginComponent::mappingWizard()
|
void CLoginComponent::mappingWizard()
|
||||||
{
|
{
|
||||||
if (!sGui || !sGui->getIContextOwnAircraft() || sGui->isShuttingDown()) { return; }
|
if (!sGui || !sGui->getIContextOwnAircraft() || sGui->isShuttingDown()) { return; }
|
||||||
|
if (!sGui->hasMinimumMappingVersion()) { return; }
|
||||||
|
|
||||||
if (!m_mappingWizard)
|
if (!m_mappingWizard)
|
||||||
{
|
{
|
||||||
m_mappingWizard.reset(new CDbQuickMappingWizard(this));
|
m_mappingWizard.reset(new CDbQuickMappingWizard(this));
|
||||||
|
|||||||
@@ -378,6 +378,9 @@
|
|||||||
<height>50</height>
|
<height>50</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="focusPolicy">
|
||||||
|
<enum>Qt::StrongFocus</enum>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
@@ -845,6 +848,11 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
|
<customwidget>
|
||||||
|
<class>BlackGui::CTickLabel</class>
|
||||||
|
<extends>QLabel</extends>
|
||||||
|
<header>blackgui/ticklabel.h</header>
|
||||||
|
</customwidget>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>BlackGui::Editors::CServerForm</class>
|
<class>BlackGui::Editors::CServerForm</class>
|
||||||
<extends>QFrame</extends>
|
<extends>QFrame</extends>
|
||||||
@@ -869,11 +877,6 @@
|
|||||||
<header>blackgui/components/modelmatcherlogenable.h</header>
|
<header>blackgui/components/modelmatcherlogenable.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
<customwidget>
|
|
||||||
<class>BlackGui::CTickLabel</class>
|
|
||||||
<extends>QLabel</extends>
|
|
||||||
<header>blackgui/ticklabel.h</header>
|
|
||||||
</customwidget>
|
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>BlackGui::Components::CDbAircraftIcaoSelectorComponent</class>
|
<class>BlackGui::Components::CDbAircraftIcaoSelectorComponent</class>
|
||||||
<extends>QFrame</extends>
|
<extends>QFrame</extends>
|
||||||
@@ -908,10 +911,8 @@
|
|||||||
<tabstop>tw_Network</tabstop>
|
<tabstop>tw_Network</tabstop>
|
||||||
<tabstop>comp_VatsimServers</tabstop>
|
<tabstop>comp_VatsimServers</tabstop>
|
||||||
<tabstop>pb_OverrideCredentialsVatsim</tabstop>
|
<tabstop>pb_OverrideCredentialsVatsim</tabstop>
|
||||||
<tabstop>comp_OtherServers</tabstop>
|
<tabstop>tw_Details</tabstop>
|
||||||
<tabstop>pb_OtherServersGotoSettings</tabstop>
|
<tabstop>form_Pilot</tabstop>
|
||||||
<tabstop>pb_OverrideCredentialsOtherServers</tabstop>
|
|
||||||
<tabstop>sa_FsdDetails</tabstop>
|
|
||||||
<tabstop>le_SimulatorModel</tabstop>
|
<tabstop>le_SimulatorModel</tabstop>
|
||||||
<tabstop>tb_SimulatorIcaoReverseLookup</tabstop>
|
<tabstop>tb_SimulatorIcaoReverseLookup</tabstop>
|
||||||
<tabstop>tb_MappingWizard</tabstop>
|
<tabstop>tb_MappingWizard</tabstop>
|
||||||
@@ -920,11 +921,17 @@
|
|||||||
<tabstop>le_AircraftCombinedType</tabstop>
|
<tabstop>le_AircraftCombinedType</tabstop>
|
||||||
<tabstop>selector_AirlineIcao</tabstop>
|
<tabstop>selector_AirlineIcao</tabstop>
|
||||||
<tabstop>le_LoginCallsign</tabstop>
|
<tabstop>le_LoginCallsign</tabstop>
|
||||||
|
<tabstop>le_LoginHomeBase</tabstop>
|
||||||
<tabstop>le_LoginAsAircaft</tabstop>
|
<tabstop>le_LoginAsAircaft</tabstop>
|
||||||
<tabstop>le_LoginSince</tabstop>
|
<tabstop>le_LoginSince</tabstop>
|
||||||
<tabstop>tb_Timeout</tabstop>
|
<tabstop>tb_Timeout</tabstop>
|
||||||
|
<tabstop>cb_AutoLogoff</tabstop>
|
||||||
<tabstop>pb_Ok</tabstop>
|
<tabstop>pb_Ok</tabstop>
|
||||||
<tabstop>pb_Cancel</tabstop>
|
<tabstop>pb_Cancel</tabstop>
|
||||||
|
<tabstop>comp_OtherServers</tabstop>
|
||||||
|
<tabstop>pb_OtherServersGotoSettings</tabstop>
|
||||||
|
<tabstop>pb_OverrideCredentialsOtherServers</tabstop>
|
||||||
|
<tabstop>sa_FsdDetails</tabstop>
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources>
|
<resources>
|
||||||
<include location="../../blackmisc/blackmisc.qrc"/>
|
<include location="../../blackmisc/blackmisc.qrc"/>
|
||||||
|
|||||||
@@ -49,6 +49,7 @@
|
|||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QSplashScreen>
|
#include <QSplashScreen>
|
||||||
|
#include <QMessageBox>
|
||||||
#include <QStyleFactory>
|
#include <QStyleFactory>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QStyle>
|
#include <QStyle>
|
||||||
@@ -205,6 +206,15 @@ namespace BlackGui
|
|||||||
CGuiUtility::registerMainApplicationWidget(mainWidget);
|
CGuiUtility::registerMainApplicationWidget(mainWidget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CGuiApplication::hasMinimumMappingVersion() const
|
||||||
|
{
|
||||||
|
if (this->getGlobalSetup().isSwiftVersionMinimumMappingVersion()) { return true; }
|
||||||
|
|
||||||
|
const QString msg = QStringLiteral("Your are using swift version: '%1'.\nCreating mappings requires at least '%2'.").arg(CBuildConfig::getVersionString(), this->getGlobalSetup().getMappingMinimumVersionString());
|
||||||
|
QMessageBox::warning(this->mainApplicationWindow(), "Version check", msg, QMessageBox::Close);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
QMainWindow *CGuiApplication::mainApplicationWindow()
|
QMainWindow *CGuiApplication::mainApplicationWindow()
|
||||||
{
|
{
|
||||||
return qobject_cast<QMainWindow *>(CGuiApplication::mainApplicationWidget());
|
return qobject_cast<QMainWindow *>(CGuiApplication::mainApplicationWidget());
|
||||||
|
|||||||
@@ -229,6 +229,9 @@ namespace BlackGui
|
|||||||
//! \copydoc BlackGui::CGuiUtility::registerMainApplicationWidget
|
//! \copydoc BlackGui::CGuiUtility::registerMainApplicationWidget
|
||||||
void registerMainApplicationWidget(QWidget *mainWidget);
|
void registerMainApplicationWidget(QWidget *mainWidget);
|
||||||
|
|
||||||
|
//! \copydoc BlackCore::CApplication::hasMinimumMappingVersion
|
||||||
|
virtual bool hasMinimumMappingVersion() const override;
|
||||||
|
|
||||||
//! Main application window
|
//! Main application window
|
||||||
static QMainWindow *mainApplicationWindow();
|
static QMainWindow *mainApplicationWindow();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user