mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +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())
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -552,14 +553,15 @@ namespace BlackGui
|
|||||||
const CFlightPlan loadedPlan = sGui->getIContextNetwork()->loadFlightPlanFromNetwork(ownAircraft.getCallsign());
|
const CFlightPlan loadedPlan = sGui->getIContextNetwork()->loadFlightPlanFromNetwork(ownAircraft.getCallsign());
|
||||||
if (loadedPlan.wasSentOrLoaded())
|
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; }
|
if (r != QMessageBox::Yes) { return; }
|
||||||
this->fillWithFlightPlanData(loadedPlan);
|
this->fillWithFlightPlanData(loadedPlan);
|
||||||
CLogMessage(this).info("Updated with loaded flight plan");
|
CLogMessage(this).info("Updated with loaded flight plan");
|
||||||
}
|
}
|
||||||
else
|
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();
|
static const BlackMisc::CLogCategoryList &getLogCategories();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
static constexpr int OverlayTimeoutMs = 5000;
|
||||||
QScopedPointer<Ui::CFlightPlanComponent> ui;
|
QScopedPointer<Ui::CFlightPlanComponent> ui;
|
||||||
CAltitudeDialog *m_altitudeDialog = nullptr;
|
CAltitudeDialog *m_altitudeDialog = nullptr;
|
||||||
BlackMisc::Aviation::CFlightPlan m_sentFlightPlan; //!< My flight plan
|
BlackMisc::Aviation::CFlightPlan m_sentFlightPlan; //!< My flight plan
|
||||||
|
|||||||
Reference in New Issue
Block a user