mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
Ref T131, use context prerequisites testing and XSwiftBus copy in UI
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
#include "blackgui/components/infobarstatuscomponent.h"
|
||||
#include "blackgui/components/logcomponent.h"
|
||||
#include "blackgui/components/settingscomponent.h"
|
||||
#include "blackgui/copyxswiftbusdialog.h"
|
||||
#include "blackgui/guiapplication.h"
|
||||
#include "blackgui/guiutility.h"
|
||||
#include "blackgui/overlaymessagesframe.h"
|
||||
@@ -396,14 +397,35 @@ void SwiftGuiStd::navigatorClosed()
|
||||
this->showNormal();
|
||||
}
|
||||
|
||||
void SwiftGuiStd::verifyModelSet()
|
||||
void SwiftGuiStd::verifyPrerequisites()
|
||||
{
|
||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||
const CSimulatorInfo sims = sGui->getIContextSimulator()->simulatorsWithInitializedModelSet();
|
||||
if (sims.isNoSimulator())
|
||||
|
||||
CStatusMessageList msgs;
|
||||
if (!sGui->supportsContexts() || !sGui->getIContextSimulator())
|
||||
{
|
||||
CLogMessage(this).error("No model set so far, you need at least one model set. Hint: You can create a model set in the mapping tool, or copy an existing set in the launcher.");
|
||||
msgs.push_back(CStatusMessage(this).error("No simulator context"));
|
||||
}
|
||||
else
|
||||
{
|
||||
msgs.push_back(sGui->getIContextSimulator()->verifyPrerequisites());
|
||||
}
|
||||
|
||||
if (msgs.hasWarningOrErrorMessages())
|
||||
{
|
||||
if (msgs.size() > 1)
|
||||
{
|
||||
this->displayInOverlayWindow(msgs);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->displayInOverlayWindow(msgs.front());
|
||||
}
|
||||
}
|
||||
|
||||
const QString xPlaneRootDir = ui->comp_MainInfoArea->getSettingsComponent()->getSimulatorSettings(CSimulatorInfo::XPLANE).getSimulatorDirectoryOrDefault();
|
||||
const int c = CCopyXSwiftBusDialog::displayDialogAndCopyBuildFiles(xPlaneRootDir, this);
|
||||
if (c > 0) { CLogMessage(this).info("Copied %1 files from build directory") << c; }
|
||||
}
|
||||
|
||||
void SwiftGuiStd::checkDbDataLoaded()
|
||||
|
||||
@@ -16,18 +16,18 @@
|
||||
#pragma push_macro("interface")
|
||||
#undef interface
|
||||
|
||||
#include "blackcore/actionbind.h"
|
||||
#include "blackcore/network.h"
|
||||
#include "blackgui/components/maininfoareacomponent.h"
|
||||
#include "blackgui/components/navigatordialog.h"
|
||||
#include "blackgui/enableforframelesswindow.h"
|
||||
#include "blackgui/mainwindowaccess.h"
|
||||
#include "blackgui/managedstatusbar.h"
|
||||
#include "blackgui/guiactionbind.h"
|
||||
#include "blackcore/actionbind.h"
|
||||
#include "blackcore/network.h"
|
||||
#include "blackmisc/simulation/simulatedaircraft.h"
|
||||
#include "blackmisc/audio/notificationsounds.h"
|
||||
#include "blackmisc/identifiable.h"
|
||||
#include "blackmisc/loghandler.h"
|
||||
#include "blackmisc/simulation/simulatedaircraft.h"
|
||||
#include "blackmisc/statusmessage.h"
|
||||
|
||||
#include <QMainWindow>
|
||||
@@ -251,7 +251,7 @@ private:
|
||||
void navigatorClosed();
|
||||
|
||||
//! Checks if model set is available
|
||||
void verifyModelSet();
|
||||
void verifyPrerequisites();
|
||||
|
||||
//! Ckeck if the DB data have been loaded
|
||||
void checkDbDataLoaded();
|
||||
|
||||
@@ -175,11 +175,7 @@ void SwiftGuiStd::init()
|
||||
emit sGui->startUpCompleted(true);
|
||||
m_init = true;
|
||||
|
||||
QTimer::singleShot(2500, this, &SwiftGuiStd::verifyModelSet);
|
||||
if (!sGui->isNetworkAccessible())
|
||||
{
|
||||
CLogMessage(this).error("No network interface, software will not work properly");
|
||||
}
|
||||
QTimer::singleShot(2500, this, &SwiftGuiStd::verifyPrerequisites);
|
||||
}
|
||||
|
||||
void SwiftGuiStd::initStyleSheet()
|
||||
|
||||
Reference in New Issue
Block a user