mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Use HTML overlay message in flightplan
This commit is contained in:
@@ -544,7 +544,8 @@ namespace BlackGui
|
||||
{
|
||||
if (!sGui || sGui->isShuttingDown() || !sGui->getIContextNetwork() || !sGui->getIContextNetwork()->isConnected())
|
||||
{
|
||||
CLogMessage(this).warning("Cannot load flight plan, network not connected");
|
||||
const CStatusMessage m = CLogMessage(this).validationWarning("Cannot load network flight plan, network not connected");
|
||||
this->showOverlayHTMLMessage(m, OverlayTimeoutMs);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -552,14 +553,15 @@ namespace BlackGui
|
||||
const CFlightPlan loadedPlan = sGui->getIContextNetwork()->loadFlightPlanFromNetwork(ownAircraft.getCallsign());
|
||||
if (loadedPlan.wasSentOrLoaded())
|
||||
{
|
||||
const int r = QMessageBox::warning(this, "Loaded FP", "Override current flight plan data?", QMessageBox::Yes | QMessageBox::No);
|
||||
const QMessageBox::StandardButton r = QMessageBox::warning(this, "Loaded FP", "Override current flight plan data?", QMessageBox::Yes | QMessageBox::No);
|
||||
if (r != QMessageBox::Yes) { return; }
|
||||
this->fillWithFlightPlanData(loadedPlan);
|
||||
CLogMessage(this).info("Updated with loaded flight plan");
|
||||
}
|
||||
else
|
||||
{
|
||||
CLogMessage(this).warning("No flight plan data");
|
||||
const CStatusMessage m = CLogMessage(this).warning("No flight plan data in loaded plan");
|
||||
this->showOverlayHTMLMessage(m, OverlayTimeoutMs);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@ namespace BlackGui
|
||||
static const BlackMisc::CLogCategoryList &getLogCategories();
|
||||
|
||||
private:
|
||||
static constexpr int OverlayTimeoutMs = 5000;
|
||||
QScopedPointer<Ui::CFlightPlanComponent> ui;
|
||||
CAltitudeDialog *m_altitudeDialog = nullptr;
|
||||
BlackMisc::Aviation::CFlightPlan m_sentFlightPlan; //!< My flight plan
|
||||
|
||||
Reference in New Issue
Block a user