mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-17 10:55:32 +08:00
refactor: Use chrono instead of plain ints
This commit is contained in:
@@ -445,6 +445,7 @@ void SwiftGuiStd::verifyPrerequisites()
|
||||
void SwiftGuiStd::onValidatedModelSet(const CSimulatorInfo &simulator, const CAircraftModelList &valid,
|
||||
const CAircraftModelList &invalid, bool stopped, const CStatusMessageList &msgs)
|
||||
{
|
||||
using namespace std::chrono_literals;
|
||||
// will NOT be called if no errors and setting is "only on errors"
|
||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||
if (QApplication::activeModalWidget())
|
||||
@@ -455,7 +456,7 @@ void SwiftGuiStd::onValidatedModelSet(const CSimulatorInfo &simulator, const CAi
|
||||
CLogMessage(this).validationWarning(
|
||||
u"Model set validation has found %1 invalid models for '%2', check the model validation")
|
||||
<< invalid.size() << simulator.toQString(true);
|
||||
this->displayInOverlayWindow(m, 5000);
|
||||
this->displayInOverlayWindow(m, 5s);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -545,10 +546,10 @@ void SwiftGuiStd::displayDBusReconnectDialog()
|
||||
CLogMessage::preformatted(msg);
|
||||
}
|
||||
|
||||
void SwiftGuiStd::onShowOverlayVariant(const CVariant &variant, int durationMs)
|
||||
void SwiftGuiStd::onShowOverlayVariant(const CVariant &variant, std::chrono::milliseconds duration)
|
||||
{
|
||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||
ui->fr_CentralFrameInside->showOverlayVariant(variant, durationMs);
|
||||
ui->fr_CentralFrameInside->showOverlayVariant(variant, duration);
|
||||
}
|
||||
|
||||
void SwiftGuiStd::onShowOverlayInlineTextMessageTab(components::TextMessageTab tab)
|
||||
|
||||
@@ -331,7 +331,7 @@ private:
|
||||
|
||||
//! @{
|
||||
//! Request overlay inline text message
|
||||
void onShowOverlayVariant(const swift::misc::CVariant &variant, int durationMs);
|
||||
void onShowOverlayVariant(const swift::misc::CVariant &variant, std::chrono::milliseconds duration);
|
||||
void onShowOverlayInlineTextMessageTab(swift::gui::components::TextMessageTab tab);
|
||||
void onShowOverlayInlineTextMessageCallsign(const swift::misc::aviation::CCallsign &callsign);
|
||||
//! @}
|
||||
|
||||
@@ -37,6 +37,7 @@ using namespace swift::misc::simulation;
|
||||
|
||||
void SwiftGuiStd::onMenuClicked()
|
||||
{
|
||||
using namespace std::chrono_literals;
|
||||
QObject *sender = QObject::sender();
|
||||
if (sender == ui->menu_TestLocationsEDRY)
|
||||
{
|
||||
@@ -80,7 +81,7 @@ void SwiftGuiStd::onMenuClicked()
|
||||
{
|
||||
sGui->toggleIncognito();
|
||||
this->displayInOverlayWindow(QStringLiteral("Incognito mode is %1").arg(boolToOnOff(sGui->isIncognito())),
|
||||
5000);
|
||||
5s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user