mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
refactor: Use chrono instead of plain ints
This commit is contained in:
@@ -324,12 +324,14 @@ namespace swift::gui::components
|
||||
|
||||
void CMappingComponent::doMatchingsAgain()
|
||||
{
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
if (!sGui || sGui->isShuttingDown() || !sGui->getIContextSimulator()) { return; }
|
||||
if (!sGui->getIContextSimulator()->isSimulatorAvailable()) { return; }
|
||||
const int rematchedNumber = sGui->getIContextSimulator()->doMatchingsAgain();
|
||||
|
||||
const QString info = QStringLiteral("Triggered re-matching of %1 aircraft").arg(rematchedNumber);
|
||||
this->showOverlayHTMLMessage(info, 5000);
|
||||
this->showOverlayHTMLMessage(info, 5s);
|
||||
CLogMessage(this).info(info);
|
||||
}
|
||||
|
||||
@@ -417,6 +419,8 @@ namespace swift::gui::components
|
||||
|
||||
void CMappingComponent::onResetAircraft()
|
||||
{
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
if (!sGui || !sGui->getIContextSimulator() || !sGui->getIContextSimulator()->isSimulatorSimulating())
|
||||
{
|
||||
return;
|
||||
@@ -426,7 +430,7 @@ namespace swift::gui::components
|
||||
const bool reset = sGui->getIContextSimulator()->resetToModelMatchingAircraft(callsign);
|
||||
const CStatusMessage msg = reset ? CStatusMessage(this).info(u"Model reset for '%1'") << callsign.toQString() :
|
||||
CStatusMessage(this).info(u"Reset failed for '%1'") << callsign.toQString();
|
||||
this->showOverlayHTMLMessage(msg, 3000);
|
||||
this->showOverlayHTMLMessage(msg, 3s);
|
||||
}
|
||||
|
||||
void CMappingComponent::onModelPreviewChanged(int state)
|
||||
|
||||
Reference in New Issue
Block a user