mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-16 18:35:35 +08:00
Ref T485 Adjust CLogMessage and CStatusMessage call sites to use the new API.
This commit is contained in:
@@ -268,7 +268,7 @@ namespace BlackGui
|
||||
if (sender == ui->tvp_AtcStationsBooked)
|
||||
{
|
||||
// trigger new read, which takes some time. A signal will be received when this is done
|
||||
CLogMessage(this).info("Requested new bookings");
|
||||
CLogMessage(this).info(u"Requested new bookings");
|
||||
sGui->getIContextNetwork()->requestAtcBookingsUpdate();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace BlackGui
|
||||
const CSelcal selcal = ui->editor_Com->getSelcal();
|
||||
if (!selcal.isValid())
|
||||
{
|
||||
CLogMessage().validationWarning("Invalid SELCAL code");
|
||||
CLogMessage().validationWarning(u"Invalid SELCAL code");
|
||||
}
|
||||
else if (sGui->getIContextAudio())
|
||||
{
|
||||
@@ -132,7 +132,7 @@ namespace BlackGui
|
||||
}
|
||||
else
|
||||
{
|
||||
CLogMessage().validationWarning("No audio available");
|
||||
CLogMessage().validationWarning(u"No audio available");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -133,11 +133,11 @@ namespace BlackGui
|
||||
{
|
||||
if (!copied.isEmpty())
|
||||
{
|
||||
CLogMessage(this).info("Copied %1 files, list: '%2'") << copied.size() << copied.join(", ");
|
||||
CLogMessage(this).info(u"Copied %1 files, list: '%2'") << copied.size() << copied.join(", ");
|
||||
}
|
||||
if (!skipped.isEmpty())
|
||||
{
|
||||
CLogMessage(this).info("Skipped %1 files, list: '%2'") << skipped.size() << skipped.join(", ");
|
||||
CLogMessage(this).info(u"Skipped %1 files, list: '%2'") << skipped.size() << skipped.join(", ");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace BlackGui
|
||||
const QSet<CSimulatorInfo> simulators = selectedSimulators.asSingleSimulatorSet();
|
||||
if (simulators.isEmpty())
|
||||
{
|
||||
static const CStatusMessage m = CStatusMessage(this).validationError("No simulators selected");
|
||||
static const CStatusMessage m = CStatusMessage(this).validationError(u"No simulators selected");
|
||||
this->showOverlayMessage(m);
|
||||
return;
|
||||
}
|
||||
@@ -58,14 +58,14 @@ namespace BlackGui
|
||||
const bool cache = ui->cb_ModelCache->isChecked();
|
||||
if (!cache && !set)
|
||||
{
|
||||
static const CStatusMessage m = CStatusMessage(this).validationError("No simulators selected");
|
||||
static const CStatusMessage m = CStatusMessage(this).validationError(u"No simulators selected");
|
||||
this->showOverlayMessage(m);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ui->comp_OtherSwiftVersions->hasSelection())
|
||||
{
|
||||
static const CStatusMessage m = CStatusMessage(this).validationError("No other version selected");
|
||||
static const CStatusMessage m = CStatusMessage(this).validationError(u"No other version selected");
|
||||
this->showOverlayMessage(m);
|
||||
return;
|
||||
}
|
||||
@@ -116,7 +116,7 @@ namespace BlackGui
|
||||
|
||||
if (sets > 0 || caches > 0)
|
||||
{
|
||||
const CStatusMessage m = CStatusMessage(this).validationInfo("Copied %1 sets and %2 caches for '%3'") << sets << caches << selectedSimulators.toQString(true);
|
||||
const CStatusMessage m = CStatusMessage(this).validationInfo(u"Copied %1 sets and %2 caches for '%3'") << sets << caches << selectedSimulators.toQString(true);
|
||||
this->showOverlayHTMLMessage(m, 7500);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -400,7 +400,7 @@ namespace BlackGui
|
||||
|
||||
if (copied > 0)
|
||||
{
|
||||
const CStatusMessage m = CStatusMessage(this).validationInfo("Copied %1 settings") << copied;
|
||||
const CStatusMessage m = CStatusMessage(this).validationInfo(u"Copied %1 settings") << copied;
|
||||
this->showOverlayHTMLMessage(m);
|
||||
}
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace BlackGui
|
||||
{
|
||||
if (!sGui || !sGui->getWebDataServices()->hasSuccesfullyConnectedSwiftDb())
|
||||
{
|
||||
CLogMessage(this).warning("No connection to DB yet, no new data loaded which can be written");
|
||||
CLogMessage(this).warning(u"No connection to DB yet, no new data loaded which can be written");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -93,11 +93,11 @@ namespace BlackGui
|
||||
const bool s = sGui->getWebDataServices()->writeDbDataToDisk(CDirectoryUtils::staticDbFilesDirectory());
|
||||
if (s)
|
||||
{
|
||||
CLogMessage(this).info("Written DB data");
|
||||
CLogMessage(this).info(u"Written DB data");
|
||||
}
|
||||
else
|
||||
{
|
||||
CLogMessage(this).error("Cannot write DB data");
|
||||
CLogMessage(this).error(u"Cannot write DB data");
|
||||
}
|
||||
return s;
|
||||
}
|
||||
@@ -111,7 +111,7 @@ namespace BlackGui
|
||||
bool ok = false;
|
||||
if (msgs.isSuccess())
|
||||
{
|
||||
CLogMessage(this).info("Read DB data from directory: %1") << CDirectoryUtils::staticDbFilesDirectory();
|
||||
CLogMessage(this).info(u"Read DB data from directory: %1") << CDirectoryUtils::staticDbFilesDirectory();
|
||||
ui->comp_DbAircraftIcao->showLoadIndicator();
|
||||
ui->comp_DbAirlineIcao->showLoadIndicator();
|
||||
ui->comp_DbCountries->showLoadIndicator();
|
||||
|
||||
@@ -141,7 +141,7 @@ namespace BlackGui
|
||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||
if (user.isAuthenticated())
|
||||
{
|
||||
CLogMessage(this).info("User authenticated: %1") << user.toQString();
|
||||
CLogMessage(this).info(u"User authenticated: %1") << user.toQString();
|
||||
this->setModeLogin(false);
|
||||
ui->le_Name->setText(user.getRealNameAndId());
|
||||
ui->te_Roles->setPlainText(user.getRolesAsString());
|
||||
|
||||
@@ -181,7 +181,7 @@ namespace BlackGui
|
||||
const CAircraftModelList vPilotModels(m_vPilotReader.getAsModelsFromCache());
|
||||
ui->tvp_AircraftModelsForVPilot->updateContainerMaybeAsync(vPilotModels);
|
||||
const int noModels = vPilotModels.size();
|
||||
CLogMessage(this).info("%1 cached vPilot models loaded") << noModels;
|
||||
CLogMessage(this).info(u"%1 cached vPilot models loaded") << noModels;
|
||||
}
|
||||
ui->tab_VPilot->setEnabled(m_vPilotEnabled);
|
||||
ui->tab_VPilot->setVisible(m_vPilotEnabled);
|
||||
@@ -292,7 +292,7 @@ namespace BlackGui
|
||||
|
||||
if (updated)
|
||||
{
|
||||
CLogMessage(this).info("Updated editor data for '%1'") << modelString;
|
||||
CLogMessage(this).info(u"Updated editor data for '%1'") << modelString;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -512,12 +512,12 @@ namespace BlackGui
|
||||
{
|
||||
if (m_vPilotReader.readInBackground(true))
|
||||
{
|
||||
CLogMessage(this).info("Start loading vPilot rulesets");
|
||||
CLogMessage(this).info(u"Start loading vPilot rulesets");
|
||||
ui->tvp_AircraftModelsForVPilot->showLoadIndicator();
|
||||
}
|
||||
else
|
||||
{
|
||||
CLogMessage(this).warning("Loading vPilot rulesets already in progress");
|
||||
CLogMessage(this).warning(u"Loading vPilot rulesets already in progress");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -526,7 +526,7 @@ namespace BlackGui
|
||||
if (!m_vPilotEnabled) { return; }
|
||||
if (success)
|
||||
{
|
||||
CLogMessage(this).info("Loading vPilot ruleset completed");
|
||||
CLogMessage(this).info(u"Loading vPilot ruleset completed");
|
||||
const CAircraftModelList models(m_vPilotReader.getAsModels());
|
||||
if (ui->tvp_AircraftModelsForVPilot->displayAutomatically())
|
||||
{
|
||||
@@ -535,7 +535,7 @@ namespace BlackGui
|
||||
}
|
||||
else
|
||||
{
|
||||
CLogMessage(this).error("Loading vPilot ruleset failed");
|
||||
CLogMessage(this).error(u"Loading vPilot ruleset failed");
|
||||
}
|
||||
ui->tvp_AircraftModelsForVPilot->hideLoadIndicator();
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace BlackGui
|
||||
const bool success = this->initModelLoader(simulator, IAircraftModelLoader::CacheOnly);
|
||||
if (!success)
|
||||
{
|
||||
CLogMessage(this).error("Init of model loader failed in component");
|
||||
CLogMessage(this).error(u"Init of model loader failed in component");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -519,27 +519,27 @@ namespace BlackGui
|
||||
{
|
||||
if (m_modelLoader->supportsSimulator(simulator))
|
||||
{
|
||||
const CStatusMessage msg = CLogMessage(this).warning("Loading for '%1' already in progress, will NOT load.") << simulator.toQString();
|
||||
const CStatusMessage msg = CLogMessage(this).warning(u"Loading for '%1' already in progress, will NOT load.") << simulator.toQString();
|
||||
this->showOverlayMessage(msg);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
const CStatusMessage msg = CLogMessage(this).warning("Loading for another simulator '%1' already in progress. Loading might be slow.") << simulator.toQString();
|
||||
const CStatusMessage msg = CLogMessage(this).warning(u"Loading for another simulator '%1' already in progress. Loading might be slow.") << simulator.toQString();
|
||||
this->showOverlayMessage(msg);
|
||||
}
|
||||
}
|
||||
|
||||
if (!this->initModelLoader(simulator))
|
||||
{
|
||||
const CStatusMessage msg = CLogMessage(this).error("Cannot init model loader for %1") << simulator.toQString();
|
||||
const CStatusMessage msg = CLogMessage(this).error(u"Cannot init model loader for %1") << simulator.toQString();
|
||||
this->showOverlayMessage(msg);
|
||||
return;
|
||||
}
|
||||
|
||||
// Do not check for empty models die here, as depending on mode we could still load
|
||||
// will be checked in model loader
|
||||
CLogMessage(this).info("Starting loading for '%1' in mode '%2'") << simulator.toQString() << IAircraftModelLoader::enumToString(mode);
|
||||
CLogMessage(this).info(u"Starting loading for '%1' in mode '%2'") << simulator.toQString() << IAircraftModelLoader::enumToString(mode);
|
||||
ui->tvp_OwnAircraftModels->showLoadIndicator();
|
||||
Q_ASSERT_X(sGui && sGui->getWebDataServices(), Q_FUNC_INFO, "missing web data services");
|
||||
m_modelLoader->startLoading(mode, static_cast<int (*)(CAircraftModelList &, bool)>(&CDatabaseUtils::consolidateModelsWithDbData), modelDirectories);
|
||||
@@ -547,7 +547,7 @@ namespace BlackGui
|
||||
|
||||
void CDbOwnModelsComponent::onModelLoaderDiskLoadingStarted(const CSimulatorInfo &simulator, IAircraftModelLoader::LoadMode mode)
|
||||
{
|
||||
const CStatusMessage msg = CLogMessage(this).info("Started disk loading for '%1' in mode '%2'") << simulator.toQString(true) << IAircraftModelLoader::enumToString(mode);
|
||||
const CStatusMessage msg = CLogMessage(this).info(u"Started disk loading for '%1' in mode '%2'") << simulator.toQString(true) << IAircraftModelLoader::enumToString(mode);
|
||||
this->showOverlayMessage(msg, 5000);
|
||||
}
|
||||
|
||||
@@ -563,11 +563,11 @@ namespace BlackGui
|
||||
if (modelsLoaded < 1)
|
||||
{
|
||||
// loading ok, but no data
|
||||
m = CLogMessage(this).warning("Loading completed for simulator '%1', but no models") << simulator;
|
||||
m = CLogMessage(this).warning(u"Loading completed for simulator '%1', but no models") << simulator;
|
||||
}
|
||||
else
|
||||
{
|
||||
m = CLogMessage(this).info("Loading completed for simulator '%1' with %2 models") << simulator << modelsLoaded;
|
||||
m = CLogMessage(this).info(u"Loading completed for simulator '%1' with %2 models") << simulator << modelsLoaded;
|
||||
}
|
||||
|
||||
// overlay
|
||||
@@ -579,7 +579,7 @@ namespace BlackGui
|
||||
else
|
||||
{
|
||||
ui->tvp_OwnAircraftModels->clear();
|
||||
CLogMessage(this).error("Loading of models failed, simulator '%1'") << simulator.toQString();
|
||||
CLogMessage(this).error(u"Loading of models failed, simulator '%1'") << simulator.toQString();
|
||||
}
|
||||
|
||||
if (statusMessages.hasWarningOrErrorMessages())
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace BlackGui
|
||||
const int diff = models.size() - cleanModelList.size();
|
||||
if (diff > 0)
|
||||
{
|
||||
const CStatusMessage m = CStatusMessage(this).warning("Removed %1 models from set, because not matching %2") << diff << simulator.toQString(true);
|
||||
const CStatusMessage m = CStatusMessage(this).warning(u"Removed %1 models from set, because not matching %2") << diff << simulator.toQString(true);
|
||||
this->showMappingComponentOverlayHtmlMessage(m, 5000);
|
||||
}
|
||||
cleanModelList.resetOrder();
|
||||
@@ -133,7 +133,7 @@ namespace BlackGui
|
||||
const int diff = models.size() - cleanModelList.size();
|
||||
if (diff > 0)
|
||||
{
|
||||
const CStatusMessage m = CStatusMessage(this).warning("Removed %1 models from set, because not matching %2") << diff << simulator.toQString(true);
|
||||
const CStatusMessage m = CStatusMessage(this).warning(u"Removed %1 models from set, because not matching %2") << diff << simulator.toQString(true);
|
||||
this->showMappingComponentOverlayHtmlMessage(m, 5000);
|
||||
}
|
||||
if (cleanModelList.isEmpty()) { return 0; }
|
||||
@@ -350,7 +350,7 @@ namespace BlackGui
|
||||
CDbMappingComponent *mc = this->getMappingComponent();
|
||||
if (!mc)
|
||||
{
|
||||
CLogMessage(this).error("No mapping component available!");
|
||||
CLogMessage(this).error(u"No mapping component available!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -373,7 +373,7 @@ namespace BlackGui
|
||||
}
|
||||
else
|
||||
{
|
||||
const CStatusMessage m = CStatusMessage(this).error("No model data for %1") << simulator.toQString(true);
|
||||
const CStatusMessage m = CStatusMessage(this).error(u"No model data for %1") << simulator.toQString(true);
|
||||
mc->showOverlayMessage(m);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace BlackGui
|
||||
const int c = this->getMappingComponent()->getOwnModelsCount();
|
||||
if (c < 1)
|
||||
{
|
||||
const CStatusMessage m = CStatusMessage(this).error("No models for '%1'") << m_simulatorInfo.toQString(true);
|
||||
const CStatusMessage m = CStatusMessage(this).error(u"No models for '%1'") << m_simulatorInfo.toQString(true);
|
||||
ui->form_OwnModelSet->showOverlayMessage(m);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -85,14 +85,14 @@ namespace BlackGui
|
||||
|
||||
if (m_models.isEmpty())
|
||||
{
|
||||
const CStatusMessage m = CStatusMessage(this).validationError("No models");
|
||||
const CStatusMessage m = CStatusMessage(this).validationError(u"No models");
|
||||
ui->fr_Overlay->showOverlayHTMLMessage(m, 5000);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ui->le_Distributor->text().isEmpty())
|
||||
{
|
||||
const CStatusMessage m = CStatusMessage(this).validationError("No distributor");
|
||||
const CStatusMessage m = CStatusMessage(this).validationError(u"No distributor");
|
||||
ui->fr_Overlay->showOverlayHTMLMessage(m, 5000);
|
||||
return;
|
||||
}
|
||||
@@ -100,7 +100,7 @@ namespace BlackGui
|
||||
const CAircraftModelList keyDuplicates = m_models.findDuplicateModelStrings();
|
||||
if (!keyDuplicates.isEmpty())
|
||||
{
|
||||
const CStatusMessage m = CStatusMessage(this).validationError("Found %1 key duplicates") << keyDuplicates.size();
|
||||
const CStatusMessage m = CStatusMessage(this).validationError(u"Found %1 key duplicates") << keyDuplicates.size();
|
||||
ui->fr_Overlay->showOverlayHTMLMessage(m, 5000);
|
||||
return;
|
||||
}
|
||||
@@ -109,7 +109,7 @@ namespace BlackGui
|
||||
const CDistributor distributor = distributors.findByKeyOrAlias(ui->le_Distributor->text().trimmed().toUpper());
|
||||
if (!distributor.hasValidDbKey())
|
||||
{
|
||||
const CStatusMessage m = CStatusMessage(this).validationError("Invalid distributor");
|
||||
const CStatusMessage m = CStatusMessage(this).validationError(u"Invalid distributor");
|
||||
ui->fr_Overlay->showOverlayHTMLMessage(m, 5000);
|
||||
return;
|
||||
}
|
||||
@@ -149,8 +149,8 @@ namespace BlackGui
|
||||
|
||||
const QString distKeys = removeModels.getDistributors().dbKeysAsString(", ");
|
||||
const CStatusMessage msg = removeModels.isEmpty() ?
|
||||
CStatusMessage(this).info("No duplicates to be removed!") :
|
||||
CStatusMessage(this).info("You can remove %1 models of the following distributors: '%2'.") << removeModels.size() << distKeys;
|
||||
CStatusMessage(this).info(u"No duplicates to be removed!") :
|
||||
CStatusMessage(this).info(u"You can remove %1 models of the following distributors: '%2'.") << removeModels.size() << distKeys;
|
||||
ui->fr_Overlay->showOverlayHTMLMessage(msg, 5000);
|
||||
ui->bb_ReduceModelDuplicates->button(QDialogButtonBox::Ok)->setEnabled(true);
|
||||
}
|
||||
|
||||
@@ -452,7 +452,7 @@ namespace BlackGui
|
||||
const bool equal = sGui->getWebDataServices()->isDbModelEqualForPublishing(model, &modelMsgs);
|
||||
if (equal)
|
||||
{
|
||||
msgs.push_back(CStatusMessage(this).info("Model '%1' has no change values") << model.getModelStringAndDbKey());
|
||||
msgs.push_back(CStatusMessage(this).info(u"Model '%1' has no change values") << model.getModelStringAndDbKey());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace BlackGui
|
||||
const CDistributorList distributors(sGui->getWebDataServices()->getDistributors());
|
||||
if (distributors.isEmpty())
|
||||
{
|
||||
const CStatusMessage m = CStatusMessage(this).error("No distributors");
|
||||
const CStatusMessage m = CStatusMessage(this).error(u"No distributors");
|
||||
this->showOverlayMessage(m);
|
||||
return;
|
||||
}
|
||||
@@ -95,7 +95,7 @@ namespace BlackGui
|
||||
const CDistributorList distributors(sGui->getWebDataServices()->getDistributors().matchesSimulator(sim));
|
||||
if (distributors.isEmpty())
|
||||
{
|
||||
const CStatusMessage m = CStatusMessage(this).error("No distributors, or no distributors matching %1") << sim.toQString();
|
||||
const CStatusMessage m = CStatusMessage(this).error(u"No distributors, or no distributors matching %1") << sim.toQString();
|
||||
this->showOverlayMessage(m);
|
||||
return;
|
||||
}
|
||||
@@ -108,14 +108,14 @@ namespace BlackGui
|
||||
const CAircraftModelList models = CCentralMultiSimulatorModelSetCachesProvider::modelCachesInstance().getCachedModels(sim);
|
||||
if (models.isEmpty())
|
||||
{
|
||||
const CStatusMessage m = CStatusMessage(this).error("No data in model set %1") << sim.toQString();
|
||||
const CStatusMessage m = CStatusMessage(this).error(u"No data in model set %1") << sim.toQString();
|
||||
this->showOverlayMessage(m);
|
||||
return;
|
||||
}
|
||||
const CDistributorList distributors = models.getDistributors();
|
||||
if (distributors.isEmpty())
|
||||
{
|
||||
const CStatusMessage m = CStatusMessage(this).error("No distributors for model set %1") << sim.toQString();
|
||||
const CStatusMessage m = CStatusMessage(this).error(u"No distributors for model set %1") << sim.toQString();
|
||||
this->showOverlayMessage(m);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace BlackGui
|
||||
if (downloadDir.isEmpty()) { return; } // canceled
|
||||
if (!QDir(downloadDir).exists())
|
||||
{
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).warning("'%1' is not a valid download directory") << downloadDir;
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).warning(u"'%1' is not a valid download directory") << downloadDir;
|
||||
this->showOverlayMessage(msg, CDownloadComponent::OverlayMsgTimeoutMs);
|
||||
return;
|
||||
}
|
||||
@@ -172,7 +172,7 @@ namespace BlackGui
|
||||
if (!sGui || !sGui->hasWebDataServices() || sGui->isShuttingDown()) { return false; }
|
||||
if (!this->existsDownloadDir())
|
||||
{
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error("Invalid download directory");
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error(u"Invalid download directory");
|
||||
this->showOverlayMessage(msg, CDownloadComponent::OverlayMsgTimeoutMs);
|
||||
return false;
|
||||
}
|
||||
@@ -180,7 +180,7 @@ namespace BlackGui
|
||||
const CUrl download = remoteFile.getSmartUrl();
|
||||
if (download.isEmpty())
|
||||
{
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error("No download URL for file name '%1'") << remoteFile.getNameAndSize();
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error(u"No download URL for file name '%1'") << remoteFile.getNameAndSize();
|
||||
this->showOverlayMessage(msg, CDownloadComponent::OverlayMsgTimeoutMs);
|
||||
return false;
|
||||
}
|
||||
@@ -193,14 +193,14 @@ namespace BlackGui
|
||||
if (r)
|
||||
{
|
||||
// this->showLoading(10 * 1000);
|
||||
CLogMessage(this).info("Triggered downloading of file from '%1'") << download.getHost();
|
||||
CLogMessage(this).info(u"Triggered downloading of file from '%1'") << download.getHost();
|
||||
connect(r, &QNetworkReply::downloadProgress, this, &CDownloadComponent::downloadProgress);
|
||||
m_reply = r;
|
||||
success = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error("Starting download for '%1' failed") << download.getFullUrl();
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error(u"Starting download for '%1' failed") << download.getFullUrl();
|
||||
this->showOverlayMessage(msg, CDownloadComponent::OverlayMsgTimeoutMs);
|
||||
}
|
||||
return success;
|
||||
|
||||
@@ -221,7 +221,7 @@ namespace BlackGui
|
||||
const int modelsCount = this->modelLoader()->getCachedModelsCount(simulator);
|
||||
if (modelsCount < 1)
|
||||
{
|
||||
static const CStatusMessage msg = CStatusMessage(this).validationError("No models indexed so far. Try 'reload'!");
|
||||
static const CStatusMessage msg = CStatusMessage(this).validationError(u"No models indexed so far. Try 'reload'!");
|
||||
this->showOverlayMessage(msg, 4000);
|
||||
return;
|
||||
}
|
||||
@@ -236,7 +236,7 @@ namespace BlackGui
|
||||
}
|
||||
else
|
||||
{
|
||||
static const CStatusMessage msg = CStatusMessage(this).validationError("No distributors selected");
|
||||
static const CStatusMessage msg = CStatusMessage(this).validationError(u"No distributors selected");
|
||||
this->showOverlayMessage(msg, 4000);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ namespace BlackGui
|
||||
const bool strict = ui->cb_StrictCheck->isChecked();
|
||||
const bool vfr = this->isVfr();
|
||||
const CStatusMessage::StatusSeverity severity = strict ? CStatusMessage::SeverityError : CStatusMessage::SeverityWarning;
|
||||
messages.push_back(CStatusMessage(this).validationInfo(strict ? "Strict validation" : "Lenient validation"));
|
||||
messages.push_back(CStatusMessage(this).validationInfo(strict ? QStringLiteral("Strict validation") : QStringLiteral("Lenient validation")));
|
||||
|
||||
const CFlightPlan::FlightRules rule = ui->cb_FlightRule->currentText().startsWith("I") ? CFlightPlan::IFR : CFlightPlan::VFR;
|
||||
flightPlan.setFlightRule(rule);
|
||||
@@ -262,11 +262,11 @@ namespace BlackGui
|
||||
v = ui->le_Callsign->text().trimmed().toUpper();
|
||||
if (v.isEmpty())
|
||||
{
|
||||
// messages.push_back(CStatusMessage(this).validationError("Missing '%1'") << ui->lbl_Callsign->text());
|
||||
// messages.push_back(CStatusMessage(this).validationError(u"Missing '%1'") << ui->lbl_Callsign->text());
|
||||
}
|
||||
else if (!CCallsign::isValidAircraftCallsign(v))
|
||||
{
|
||||
messages.push_back(CStatusMessage(this).validationError("Invalid callsign '%1'") << v);
|
||||
messages.push_back(CStatusMessage(this).validationError(u"Invalid callsign '%1'") << v);
|
||||
}
|
||||
flightPlan.setCallsign(CCallsign(v));
|
||||
|
||||
@@ -274,15 +274,15 @@ namespace BlackGui
|
||||
v = ui->le_AircraftType->text().trimmed().toUpper();
|
||||
if (v.isEmpty())
|
||||
{
|
||||
messages.push_back(CStatusMessage(this).validationError("Missing '%1'") << ui->lbl_AircraftType->text());
|
||||
messages.push_back(CStatusMessage(this).validationError(u"Missing '%1'") << ui->lbl_AircraftType->text());
|
||||
}
|
||||
else if (!CAircraftIcaoCode::isValidDesignator(v))
|
||||
{
|
||||
messages.push_back(CStatusMessage(this).validationError("Invalid aircraft ICAO code '%1'") << v);
|
||||
messages.push_back(CStatusMessage(this).validationError(u"Invalid aircraft ICAO code '%1'") << v);
|
||||
}
|
||||
else if (sApp && sApp->hasWebDataServices() && sApp->getWebDataServices()->hasDbAircraftData() && !sApp->getWebDataServices()->containsAircraftIcaoDesignator(v))
|
||||
{
|
||||
messages.push_back(CStatusMessage(this).validationWarning("Are you sure '%1' is a valid type?") << v);
|
||||
messages.push_back(CStatusMessage(this).validationWarning(u"Are you sure '%1' is a valid type?") << v);
|
||||
}
|
||||
flightPlan.setAircraftIcao(this->getAircraftIcaoCode());
|
||||
|
||||
@@ -290,14 +290,14 @@ namespace BlackGui
|
||||
v = this->getPrefix();
|
||||
if (!v.isEmpty() && !CFlightPlan::prefixCodes().contains(v))
|
||||
{
|
||||
messages.push_back(CStatusMessage(this).validation(severity, "Invalid prefix"));
|
||||
messages.push_back(CStatusMessage(this).validation(severity, u"Invalid prefix"));
|
||||
}
|
||||
flightPlan.setPrefix(v);
|
||||
|
||||
v = this->getEquipmentSuffix();
|
||||
if (!v.isEmpty() && !CFlightPlan::equipmentCodes().contains(v))
|
||||
{
|
||||
messages.push_back(CStatusMessage(this).validation(severity, "Invalid equipment code"));
|
||||
messages.push_back(CStatusMessage(this).validation(severity, u"Invalid equipment code"));
|
||||
}
|
||||
flightPlan.setEquipmentSuffix(v);
|
||||
|
||||
@@ -308,11 +308,11 @@ namespace BlackGui
|
||||
messages.push_back(CStatusMessage(this).validation(
|
||||
vfr ?
|
||||
CStatusMessage::SeverityInfo :
|
||||
CStatusMessage::SeverityWarning, "Missing '%1'") << ui->lbl_Route->text());
|
||||
CStatusMessage::SeverityWarning, u"Missing '%1'") << ui->lbl_Route->text());
|
||||
}
|
||||
else if (v.length() > CFlightPlan::MaxRouteLength)
|
||||
{
|
||||
messages.push_back(CStatusMessage(this).validationError("Flight plan route length exceeded (%1 chars max.)") << CFlightPlan::MaxRouteLength);
|
||||
messages.push_back(CStatusMessage(this).validationError(u"Flight plan route length exceeded (%1 chars max.)") << CFlightPlan::MaxRouteLength);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -323,11 +323,11 @@ namespace BlackGui
|
||||
v = ui->pte_Remarks->toPlainText().trimmed();
|
||||
if (v.isEmpty())
|
||||
{
|
||||
messages.push_back(CStatusMessage(this).validationError("No '%1', voice capabilities are mandatory") << ui->lbl_Remarks->text());
|
||||
messages.push_back(CStatusMessage(this).validationError(u"No '%1', voice capabilities are mandatory") << ui->lbl_Remarks->text());
|
||||
}
|
||||
else if (v.length() > CFlightPlan::MaxRemarksLength)
|
||||
{
|
||||
messages.push_back(CStatusMessage(this).validationError("Flight plan remarks length exceeded (%1 chars max.)") << CFlightPlan::MaxRemarksLength);
|
||||
messages.push_back(CStatusMessage(this).validationError(u"Flight plan remarks length exceeded (%1 chars max.)") << CFlightPlan::MaxRemarksLength);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -338,7 +338,7 @@ namespace BlackGui
|
||||
v = ui->le_EstimatedTimeEnroute->text();
|
||||
if (v.isEmpty() || v == defaultTime())
|
||||
{
|
||||
messages.push_back(CStatusMessage(this).validation(severity, "Missing '%1'") << ui->lbl_EstimatedTimeEnroute->text());
|
||||
messages.push_back(CStatusMessage(this).validation(severity, u"Missing '%1'") << ui->lbl_EstimatedTimeEnroute->text());
|
||||
}
|
||||
flightPlan.setEnrouteTime(v);
|
||||
|
||||
@@ -346,7 +346,7 @@ namespace BlackGui
|
||||
v = ui->le_FuelOnBoard->text();
|
||||
if (v.isEmpty() || v == defaultTime())
|
||||
{
|
||||
messages.push_back(CStatusMessage(this).validation(severity, "Missing '%1'") << ui->lbl_FuelOnBoard->text());
|
||||
messages.push_back(CStatusMessage(this).validation(severity, u"Missing '%1'") << ui->lbl_FuelOnBoard->text());
|
||||
}
|
||||
flightPlan.setFuelTime(v);
|
||||
|
||||
@@ -354,7 +354,7 @@ namespace BlackGui
|
||||
v = ui->le_TakeOffTimePlanned->text();
|
||||
if (v.isEmpty() || v == defaultTime())
|
||||
{
|
||||
messages.push_back(CStatusMessage(this).validation(severity, "Missing '%1'") << ui->lbl_TakeOffTimePlanned->text());
|
||||
messages.push_back(CStatusMessage(this).validation(severity, u"Missing '%1'") << ui->lbl_TakeOffTimePlanned->text());
|
||||
}
|
||||
flightPlan.setTakeoffTimePlanned(v);
|
||||
|
||||
@@ -369,7 +369,7 @@ namespace BlackGui
|
||||
v = ui->le_DestinationAirport->text();
|
||||
if (v.isEmpty() || v.endsWith(defaultIcao(), Qt::CaseInsensitive))
|
||||
{
|
||||
messages.push_back(CStatusMessage(this).validationError("Missing '%1'") << ui->lbl_DestinationAirport->text());
|
||||
messages.push_back(CStatusMessage(this).validationError(u"Missing '%1'") << ui->lbl_DestinationAirport->text());
|
||||
flightPlan.setDestinationAirportIcao(QString());
|
||||
}
|
||||
else
|
||||
@@ -381,7 +381,7 @@ namespace BlackGui
|
||||
v = ui->le_OriginAirport->text();
|
||||
if (v.isEmpty() || v.endsWith(defaultIcao(), Qt::CaseInsensitive))
|
||||
{
|
||||
messages.push_back(CStatusMessage(this).validationError("Missing '%1'") << ui->lbl_OriginAirport->text());
|
||||
messages.push_back(CStatusMessage(this).validationError(u"Missing '%1'") << ui->lbl_OriginAirport->text());
|
||||
flightPlan.setOriginAirportIcao(defaultIcao());
|
||||
}
|
||||
else
|
||||
@@ -395,7 +395,7 @@ namespace BlackGui
|
||||
cruiseTAS.parseFromString(v, CPqString::SeparatorBestGuess);
|
||||
if (cruiseTAS.isNull())
|
||||
{
|
||||
messages.push_back(CStatusMessage(this).validationError("Wrong TAS, %1") << ui->lbl_CruiseTrueAirspeed->text());
|
||||
messages.push_back(CStatusMessage(this).validationError(u"Wrong TAS, %1") << ui->lbl_CruiseTrueAirspeed->text());
|
||||
flightPlan.setDestinationAirportIcao(defaultIcao());
|
||||
}
|
||||
else
|
||||
@@ -409,7 +409,7 @@ namespace BlackGui
|
||||
{
|
||||
if (!messages.hasWarningOrErrorMessages())
|
||||
{
|
||||
messages.push_back(CStatusMessage(this).validationInfo("Missing %1") << ui->lbl_AlternateAirport->text());
|
||||
messages.push_back(CStatusMessage(this).validationInfo(u"Missing %1") << ui->lbl_AlternateAirport->text());
|
||||
}
|
||||
flightPlan.setAlternateAirportIcao(QString());
|
||||
}
|
||||
@@ -421,7 +421,7 @@ namespace BlackGui
|
||||
// OK
|
||||
if (!messages.isFailure())
|
||||
{
|
||||
messages.push_back(CStatusMessage(this).validationInfo("Flight plan validation passed"));
|
||||
messages.push_back(CStatusMessage(this).validationInfo(u"Flight plan validation passed"));
|
||||
}
|
||||
return messages;
|
||||
}
|
||||
@@ -440,12 +440,12 @@ namespace BlackGui
|
||||
flightPlan.setWhenLastSentOrLoaded(QDateTime::currentDateTimeUtc());
|
||||
sGui->getIContextNetwork()->sendFlightPlan(flightPlan);
|
||||
lastSent = flightPlan.whenLastSentOrLoaded().toString();
|
||||
m = CStatusMessage(this).validationInfo("Sent flight plan");
|
||||
m = CStatusMessage(this).validationInfo(u"Sent flight plan");
|
||||
}
|
||||
else
|
||||
{
|
||||
flightPlan.setWhenLastSentOrLoaded(QDateTime()); // empty
|
||||
m = CStatusMessage(this).validationError("No errors, but not connected, cannot send flight plan");
|
||||
m = CStatusMessage(this).validationError(u"No errors, but not connected, cannot send flight plan");
|
||||
}
|
||||
ui->le_LastSent->setText(lastSent);
|
||||
this->showOverlayMessage(m, OverlayMessageMs);
|
||||
@@ -544,7 +544,7 @@ namespace BlackGui
|
||||
{
|
||||
if (!sGui || sGui->isShuttingDown() || !sGui->getIContextNetwork() || !sGui->getIContextNetwork()->isConnected())
|
||||
{
|
||||
const CStatusMessage m = CLogMessage(this).validationWarning("Cannot load network flight plan, network not connected");
|
||||
const CStatusMessage m = CLogMessage(this).validationWarning(u"Cannot load network flight plan, network not connected");
|
||||
this->showOverlayHTMLMessage(m, OverlayTimeoutMs);
|
||||
return;
|
||||
}
|
||||
@@ -556,11 +556,11 @@ namespace BlackGui
|
||||
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");
|
||||
CLogMessage(this).info(u"Updated with loaded flight plan");
|
||||
}
|
||||
else
|
||||
{
|
||||
const CStatusMessage m = CLogMessage(this).warning("No flight plan data in loaded plan");
|
||||
const CStatusMessage m = CLogMessage(this).warning(u"No flight plan data in loaded plan");
|
||||
this->showOverlayHTMLMessage(m, OverlayTimeoutMs);
|
||||
}
|
||||
}
|
||||
@@ -620,7 +620,7 @@ namespace BlackGui
|
||||
const QString generated = ui->pte_RemarksGenerated->toPlainText().trimmed();
|
||||
if (confirm && !this->overrideRemarks()) { return; }
|
||||
ui->pte_Remarks->setPlainText(generated);
|
||||
CLogMessage(this).info("Copied remarks");
|
||||
CLogMessage(this).info(u"Copied remarks");
|
||||
}
|
||||
|
||||
void CFlightPlanComponent::currentTabGenerator()
|
||||
@@ -752,11 +752,11 @@ namespace BlackGui
|
||||
if (vfr)
|
||||
{
|
||||
ui->cb_NoSidsStarts->setChecked(true);
|
||||
msgs.push_back(CStatusMessage(this).validationInfo("No SID/STARs"));
|
||||
msgs.push_back(CStatusMessage(this).validationInfo(u"No SID/STARs"));
|
||||
ui->cb_RequiredNavigationPerformance->setCurrentIndex(0);
|
||||
ui->cb_PerformanceCategory->setCurrentIndex(0);
|
||||
ui->cb_NavigationEquipment->setCurrentIndex(0);
|
||||
msgs.push_back(CStatusMessage(this).validationInfo("Set navigation and performance to VFR"));
|
||||
msgs.push_back(CStatusMessage(this).validationInfo(u"Set navigation and performance to VFR"));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -767,11 +767,11 @@ namespace BlackGui
|
||||
if (icao.getEnginesCount() >= 2 && icao.getEngineType() == "J")
|
||||
{
|
||||
// jet with >=2 engines
|
||||
msgs.push_back(CStatusMessage(this).validationInfo("Jet >=2 engines"));
|
||||
msgs.push_back(CStatusMessage(this).validationInfo("SID/STARs"));
|
||||
msgs.push_back(CStatusMessage(this).validationInfo(u"Jet >=2 engines"));
|
||||
msgs.push_back(CStatusMessage(this).validationInfo(u"SID/STARs"));
|
||||
ui->cb_NoSidsStarts->setChecked(false);
|
||||
ui->cb_NavigationEquipment->setCurrentText("GPS or FMC capable of SIDs/STARs");
|
||||
msgs.push_back(CStatusMessage(this).validationInfo("GPS or FMC capable of SIDs/STARs"));
|
||||
msgs.push_back(CStatusMessage(this).validationInfo(u"GPS or FMC capable of SIDs/STARs"));
|
||||
|
||||
// reset those values
|
||||
ui->cb_RequiredNavigationPerformance->setCurrentIndex(0);
|
||||
|
||||
@@ -205,19 +205,19 @@ namespace BlackGui
|
||||
{
|
||||
if (m_actionHotkey.getApplicableMachine().getMachineName().isEmpty())
|
||||
{
|
||||
CLogMessage().validationWarning("Missing hotkey '%1'") << ui->gb_Machine->title();
|
||||
CLogMessage().validationWarning(u"Missing hotkey '%1'") << ui->gb_Machine->title();
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_actionHotkey.getCombination().isEmpty())
|
||||
{
|
||||
CLogMessage().validationWarning("Missing hotkey '%1'") << ui->gb_Hotkey->title();
|
||||
CLogMessage().validationWarning(u"Missing hotkey '%1'") << ui->gb_Hotkey->title();
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_actionHotkey.getAction().isEmpty())
|
||||
{
|
||||
CLogMessage().validationWarning("Missing hotkey '%1'") << ui->gb_Action->title();
|
||||
CLogMessage().validationWarning(u"Missing hotkey '%1'") << ui->gb_Action->title();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace BlackGui
|
||||
if (xPlanePluginDir.isEmpty()) { return; } // canceled
|
||||
if (!QDir(xPlanePluginDir).exists())
|
||||
{
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).warning("'%1' is not a valid X-Plane plugin directory") << xPlanePluginDir;
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).warning(u"'%1' is not a valid X-Plane plugin directory") << xPlanePluginDir;
|
||||
this->showOverlayMessage(msg, CInstallXSwiftBusComponent::OverlayMsgTimeoutMs);
|
||||
return;
|
||||
}
|
||||
@@ -90,7 +90,7 @@ namespace BlackGui
|
||||
if (downloadDir.isEmpty()) { return; } // canceled
|
||||
if (!QDir(downloadDir).exists())
|
||||
{
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).warning("'%1' is not a valid download directory") << downloadDir;
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).warning(u"'%1' is not a valid download directory") << downloadDir;
|
||||
this->showOverlayMessage(msg, CInstallXSwiftBusComponent::OverlayMsgTimeoutMs);
|
||||
return;
|
||||
}
|
||||
@@ -104,7 +104,7 @@ namespace BlackGui
|
||||
QFile downloadFile(downloadFileName);
|
||||
if (!downloadFile.exists())
|
||||
{
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error("Cannot read downloaded file '%1'") << downloadFileName;
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error(u"Cannot read downloaded file '%1'") << downloadFileName;
|
||||
this->showOverlayMessage(msg, CInstallXSwiftBusComponent::OverlayMsgTimeoutMs);
|
||||
return;
|
||||
}
|
||||
@@ -112,7 +112,7 @@ namespace BlackGui
|
||||
const QString xSwiftBusDirectory = this->xSwiftBusDir();
|
||||
if (xSwiftBusDirectory.isEmpty())
|
||||
{
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error("No directory to install to'");
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error(u"No directory to install to'");
|
||||
this->showOverlayMessage(msg, CInstallXSwiftBusComponent::OverlayMsgTimeoutMs);
|
||||
return;
|
||||
}
|
||||
@@ -120,7 +120,7 @@ namespace BlackGui
|
||||
const QDir installDir(xSwiftBusDirectory);
|
||||
if (!installDir.exists())
|
||||
{
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error("Directory '%1' does not exist") << xSwiftBusDirectory;
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error(u"Directory '%1' does not exist") << xSwiftBusDirectory;
|
||||
this->showOverlayMessage(msg, CInstallXSwiftBusComponent::OverlayMsgTimeoutMs);
|
||||
return;
|
||||
}
|
||||
@@ -133,7 +133,7 @@ namespace BlackGui
|
||||
const bool removed = destFile.remove();
|
||||
if (!removed)
|
||||
{
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error("Cannot remove '%1'") << destFileName;
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error(u"Cannot remove '%1'") << destFileName;
|
||||
this->showOverlayMessage(msg, CInstallXSwiftBusComponent::OverlayMsgTimeoutMs);
|
||||
return;
|
||||
}
|
||||
@@ -143,7 +143,7 @@ namespace BlackGui
|
||||
const bool copied = QFile::copy(downloadFileName, destFileName);
|
||||
if (!copied)
|
||||
{
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error("Cannot copy '%1' to '%2'") << downloadFileName << destFileName;
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error(u"Cannot copy '%1' to '%2'") << downloadFileName << destFileName;
|
||||
this->showOverlayMessage(msg, CInstallXSwiftBusComponent::OverlayMsgTimeoutMs);
|
||||
return;
|
||||
}
|
||||
@@ -152,7 +152,7 @@ namespace BlackGui
|
||||
const QFileInfo destFile(destFileName);
|
||||
if (!destFile.exists())
|
||||
{
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error("XSwiftBus file '%1' does not exist") << destFileName;
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error(u"XSwiftBus file '%1' does not exist") << destFileName;
|
||||
this->showOverlayMessage(msg, CInstallXSwiftBusComponent::OverlayMsgTimeoutMs);
|
||||
return;
|
||||
}
|
||||
@@ -162,7 +162,7 @@ namespace BlackGui
|
||||
if (CCompressUtils::zip7Uncompress(destFile.absoluteFilePath(), xSwiftBusDirectory, &stdOutAndError))
|
||||
{
|
||||
// capture values by copy!
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).info("Uncompressed xSwiftBus in '%1'") << xSwiftBusDirectory;
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).info(u"Uncompressed xSwiftBus in '%1'") << xSwiftBusDirectory;
|
||||
this->showOverlayMessagesWithConfirmation(msg, false, "Delete downloaded file?", [ = ]
|
||||
{
|
||||
QFile downloadFile(downloadFileName);
|
||||
@@ -174,7 +174,7 @@ namespace BlackGui
|
||||
}
|
||||
else
|
||||
{
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).warning("Unzip failed: stdout '%1' stderr '%2'") << safeAt(stdOutAndError, 0) << safeAt(stdOutAndError, 1);
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).warning(u"Unzip failed: stdout '%1' stderr '%2'") << safeAt(stdOutAndError, 0) << safeAt(stdOutAndError, 1);
|
||||
this->showOverlayMessage(msg);
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ namespace BlackGui
|
||||
if (!sGui || !sGui->hasWebDataServices() || sGui->isShuttingDown()) { return; }
|
||||
if (!this->existsDownloadDir())
|
||||
{
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error("Invalid download directory");
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error(u"Invalid download directory");
|
||||
this->showOverlayMessage(msg, CInstallXSwiftBusComponent::OverlayMsgTimeoutMs);
|
||||
return;
|
||||
}
|
||||
@@ -204,7 +204,7 @@ namespace BlackGui
|
||||
const CUrl download = rf.getSmartUrl();
|
||||
if (download.isEmpty())
|
||||
{
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error("No download URL for file name '%1'") << rf.getNameAndSize();
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error(u"No download URL for file name '%1'") << rf.getNameAndSize();
|
||||
this->showOverlayMessage(msg, CInstallXSwiftBusComponent::OverlayMsgTimeoutMs);
|
||||
return;
|
||||
}
|
||||
@@ -220,7 +220,7 @@ namespace BlackGui
|
||||
if (reply == QMessageBox::Cancel) { return; }
|
||||
if (reply == QMessageBox::Yes)
|
||||
{
|
||||
const CStatusMessage msg = CStatusMessage(this).info("Using existing file '%1'") << saveAsFile;
|
||||
const CStatusMessage msg = CStatusMessage(this).info(u"Using existing file '%1'") << saveAsFile;
|
||||
const QPointer<CInstallXSwiftBusComponent> guard(this);
|
||||
QTimer::singleShot(100, this, [ = ]
|
||||
{
|
||||
@@ -234,12 +234,12 @@ namespace BlackGui
|
||||
const QNetworkReply *r = sGui->downloadFromNetwork(download, saveAsFile, { this, &CInstallXSwiftBusComponent::downloadedXSwiftBusFile});
|
||||
if (r)
|
||||
{
|
||||
CLogMessage(this).info("Triggered downloading of XSwiftBus file from '%1'") << download.getHost();
|
||||
CLogMessage(this).info(u"Triggered downloading of XSwiftBus file from '%1'") << download.getHost();
|
||||
this->showLoading(120 * 1000); // timeout in any case
|
||||
}
|
||||
else
|
||||
{
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error("Starting download for '%1' failed") << download.getFullUrl();
|
||||
const CStatusMessage msg = CStatusMessage(this, CLogCategory::validation()).error(u"Starting download for '%1' failed") << download.getFullUrl();
|
||||
this->showOverlayMessage(msg, CInstallXSwiftBusComponent::OverlayMsgTimeoutMs);
|
||||
}
|
||||
}
|
||||
@@ -255,7 +255,7 @@ namespace BlackGui
|
||||
}
|
||||
if (!this->existsXSwiftBusPluginDir())
|
||||
{
|
||||
const CStatusMessage msg = CStatusMessage(this).warning("No valid install directory, cannot continue.");
|
||||
const CStatusMessage msg = CStatusMessage(this).warning(u"No valid install directory, cannot continue.");
|
||||
this->showOverlayMessage(msg);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -106,20 +106,20 @@ namespace BlackGui
|
||||
Q_ASSERT(sGui->getIContextNetwork());
|
||||
if (!sGui->getIContextNetwork()->isConnected())
|
||||
{
|
||||
CLogMessage(this).validationError("Cannot send aircraft parts, network not connected");
|
||||
CLogMessage(this).validationError(u"Cannot send aircraft parts, network not connected");
|
||||
return;
|
||||
}
|
||||
const CCallsign callsign(ui->comp_RemoteAircraftSelector->getSelectedCallsign());
|
||||
if (callsign.isEmpty())
|
||||
{
|
||||
CLogMessage(this).validationError("No valid callsign selected");
|
||||
CLogMessage(this).validationError(u"No valid callsign selected");
|
||||
return;
|
||||
}
|
||||
|
||||
CClient client = sGui->getIContextNetwork()->getClientsForCallsigns(callsign).frontOrDefault();
|
||||
if (client.getCallsign().isEmpty() || client.getCallsign() != callsign)
|
||||
{
|
||||
CLogMessage(this).validationError("No valid client for '%1'") << callsign.asString();
|
||||
CLogMessage(this).validationError(u"No valid client for '%1'") << callsign.asString();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace BlackGui
|
||||
ui->tb_History->setToolTip("");
|
||||
const bool incremental = ui->cb_AircraftPartsIncremental->isChecked();
|
||||
sGui->getIContextNetwork()->testAddAircraftParts(callsign, parts, incremental);
|
||||
CLogMessage(this).info("Added parts for %1") << callsign.toQString();
|
||||
CLogMessage(this).info(u"Added parts for %1") << callsign.toQString();
|
||||
}
|
||||
|
||||
void CInternalsComponent::setCurrentParts()
|
||||
@@ -152,7 +152,7 @@ namespace BlackGui
|
||||
const CAircraftPartsList partsList = sGui->getIContextNetwork()->getRemoteAircraftParts(callsign);
|
||||
if (partsList.isEmpty())
|
||||
{
|
||||
CStatusMessage(this).info("No parts for '%1'") << callsign.asString();
|
||||
CStatusMessage(this).info(u"No parts for '%1'") << callsign.asString();
|
||||
return;
|
||||
}
|
||||
const CAircraftParts parts = partsList.latestObject();
|
||||
@@ -261,12 +261,12 @@ namespace BlackGui
|
||||
const CCallsign callsign(ui->comp_RemoteAircraftSelector->getSelectedCallsign());
|
||||
if (callsign.isEmpty())
|
||||
{
|
||||
CLogMessage(this).validationError("No valid callsign selected");
|
||||
CLogMessage(this).validationError(u"No valid callsign selected");
|
||||
return;
|
||||
}
|
||||
ui->pb_RequestFromNetwork->setEnabled(false);
|
||||
sGui->getIContextNetwork()->testRequestAircraftConfig(callsign);
|
||||
CLogMessage(this).info("Request aircraft config for '%1'") << callsign.asString();
|
||||
CLogMessage(this).info(u"Request aircraft config for '%1'") << callsign.asString();
|
||||
|
||||
// simple approach to update UI when parts are received
|
||||
const QPointer<CInternalsComponent> myself(this);
|
||||
@@ -290,7 +290,7 @@ namespace BlackGui
|
||||
const CCallsign callsign(ui->comp_RemoteAircraftSelector->getSelectedCallsign());
|
||||
if (callsign.isEmpty())
|
||||
{
|
||||
CLogMessage(this).validationError("No valid callsign selected");
|
||||
CLogMessage(this).validationError(u"No valid callsign selected");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -400,7 +400,7 @@ namespace BlackGui
|
||||
if (!sApp || sApp->isShuttingDown()) { break; } // stop and return
|
||||
if (m_callsign.isEmpty())
|
||||
{
|
||||
// static const CStatusMessage ms = CStatusMessage(this).validationError("No callsign for logging");
|
||||
// static const CStatusMessage ms = CStatusMessage(this).validationError(u"No callsign for logging");
|
||||
// m = ms;
|
||||
break;
|
||||
}
|
||||
@@ -408,14 +408,14 @@ namespace BlackGui
|
||||
const bool canUpdateLog = m_airspaceMonitor && m_simulator && m_simulator->isConnected() && !m_simulator->isShuttingDown();
|
||||
if (!canUpdateLog)
|
||||
{
|
||||
static const CStatusMessage ms = CStatusMessage(this).validationError("No airspace monitor or simulator or shutting down");
|
||||
static const CStatusMessage ms = CStatusMessage(this).validationError(u"No airspace monitor or simulator or shutting down");
|
||||
m = ms;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!m_simulator->isLogCallsign(m_callsign))
|
||||
{
|
||||
static const CStatusMessage ms = CStatusMessage(this).validationError("No longer logging callsign");
|
||||
static const CStatusMessage ms = CStatusMessage(this).validationError(u"No longer logging callsign");
|
||||
m = ms;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ namespace BlackGui
|
||||
gs.setBaseValues(setup);
|
||||
gs.setLogInterpolation(false); // that would globally log all values
|
||||
sGui->getIContextSimulator()->setInterpolationAndRenderingSetupGlobal(gs);
|
||||
CLogMessage(this).info("Set global setup: '%1'") << gs.toQString(true);
|
||||
CLogMessage(this).info(u"Set global setup: '%1'") << gs.toQString(true);
|
||||
|
||||
const QPointer<CInterpolationSetupComponent> myself(this);
|
||||
QTimer::singleShot(250, this, [ = ]
|
||||
@@ -154,7 +154,7 @@ namespace BlackGui
|
||||
const bool ignoreGlobal = ui->cb_IgnoreGlobal->isChecked();
|
||||
if (ignoreGlobal && setup.isEqualToGlobal(gs))
|
||||
{
|
||||
static const CStatusMessage m = CStatusMessage(this).validationWarning("Same as global setup");
|
||||
static const CStatusMessage m = CStatusMessage(this).validationWarning(u"Same as global setup");
|
||||
this->showOverlayMessage(m);
|
||||
return;
|
||||
}
|
||||
@@ -222,7 +222,7 @@ namespace BlackGui
|
||||
{
|
||||
if (showOverlay)
|
||||
{
|
||||
const CStatusMessage m = CStatusMessage(this).validationError("No context");
|
||||
const CStatusMessage m = CStatusMessage(this).validationError(u"No context");
|
||||
this->showOverlayMessage(m);
|
||||
}
|
||||
return false;
|
||||
@@ -231,7 +231,7 @@ namespace BlackGui
|
||||
{
|
||||
if (showOverlay)
|
||||
{
|
||||
const CStatusMessage m = CStatusMessage(this).validationError("No simulator available");
|
||||
const CStatusMessage m = CStatusMessage(this).validationError(u"No simulator available");
|
||||
this->showOverlayMessage(m);
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace BlackGui
|
||||
bool CLegalInfoComponent::validateAgreement()
|
||||
{
|
||||
if (this->isAgreedTo()) { return true; }
|
||||
static const CStatusMessage m = CStatusMessage(this).validationError("You need to agree with the swift license");
|
||||
static const CStatusMessage m = CStatusMessage(this).validationError(u"You need to agree with the swift license");
|
||||
this->showOverlayMessage(m);
|
||||
return false;
|
||||
}
|
||||
@@ -77,7 +77,7 @@ namespace BlackGui
|
||||
void CLegalInfoComponent::showCrashDumpHint()
|
||||
{
|
||||
if (ui->cb_CrashDumps->isChecked()) { return; }
|
||||
const CStatusMessage m = CStatusMessage(this).info("We recommend to enable crash dump uploads");
|
||||
const CStatusMessage m = CStatusMessage(this).info(u"We recommend to enable crash dump uploads");
|
||||
this->showOverlayHTMLMessage(m, 7500);
|
||||
}
|
||||
|
||||
|
||||
@@ -253,14 +253,14 @@ namespace BlackGui
|
||||
{
|
||||
if (!this->validateAircraftValues())
|
||||
{
|
||||
this->showOverlayHTMLMessage(CStatusMessage(this).validationWarning("Invalid aircraft data, login not possible"), OverlayMessageMs);
|
||||
this->showOverlayHTMLMessage(CStatusMessage(this).validationWarning(u"Invalid aircraft data, login not possible"), OverlayMessageMs);
|
||||
return;
|
||||
}
|
||||
|
||||
const CStatusMessageList pilotMsgs = ui->form_Pilot->validate();
|
||||
if (pilotMsgs.isFailure())
|
||||
{
|
||||
this->showOverlayHTMLMessage(CStatusMessage(this).validationWarning("Invalid pilot data, login not possible"), OverlayMessageMs);
|
||||
this->showOverlayHTMLMessage(CStatusMessage(this).validationWarning(u"Invalid pilot data, login not possible"), OverlayMessageMs);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -272,8 +272,8 @@ namespace BlackGui
|
||||
const INetwork::LoginMode mode = ui->frp_LoginMode->getLoginMode();
|
||||
switch (mode)
|
||||
{
|
||||
case INetwork::LoginStealth: CLogMessage(this).info("login in stealth mode"); break;
|
||||
case INetwork::LoginAsObserver: CLogMessage(this).info("login in observer mode"); break;
|
||||
case INetwork::LoginStealth: CLogMessage(this).info(u"login in stealth mode"); break;
|
||||
case INetwork::LoginAsObserver: CLogMessage(this).info(u"login in observer mode"); break;
|
||||
default: break; // INetwork::LoginNormal
|
||||
}
|
||||
|
||||
@@ -685,8 +685,8 @@ namespace BlackGui
|
||||
const QString modelStr(model.hasModelString() ? model.getModelString() : "<unknown>");
|
||||
if (!model.hasModelString())
|
||||
{
|
||||
CLogMessage(this).validationInfo("Invalid lookup for '%1' successful: %2") << modelStr << model.toQString();
|
||||
CLogMessage(this).validationInfo("Hint: Are you using the emulated driver? Set a model if so!");
|
||||
CLogMessage(this).validationInfo(u"Invalid lookup for '%1' successful: %2") << modelStr << model.toQString();
|
||||
CLogMessage(this).validationInfo(u"Hint: Are you using the emulated driver? Set a model if so!");
|
||||
return;
|
||||
}
|
||||
this->setOwnModelAndIcaoValues();
|
||||
|
||||
@@ -204,7 +204,7 @@ namespace BlackGui
|
||||
}
|
||||
else
|
||||
{
|
||||
CLogMessage(this).info("Model set loaded ('%1'), you can update the model view") << simulator.toQString(true);
|
||||
CLogMessage(this).info(u"Model set loaded ('%1'), you can update the model view") << simulator.toQString(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ namespace BlackGui
|
||||
if (!saFromBackend.hasValidCallsign()) { return; } // obviously deleted
|
||||
const bool nowEnabled = sa.isEnabled();
|
||||
if (saFromBackend.isEnabled() == nowEnabled) { return; } // already same value
|
||||
CLogMessage(this).info("Request to %1 aircraft '%2'") << (nowEnabled ? "enable" : "disable") << saFromBackend.getCallsign().toQString();
|
||||
CLogMessage(this).info(u"Request to %1 aircraft '%2'") << (nowEnabled ? "enable" : "disable") << saFromBackend.getCallsign().toQString();
|
||||
sGui->getIContextNetwork()->updateAircraftEnabled(saFromBackend.getCallsign(), nowEnabled);
|
||||
}
|
||||
|
||||
@@ -272,7 +272,7 @@ namespace BlackGui
|
||||
const QString cs = ui->le_Callsign->text().trimmed();
|
||||
if (!CCallsign::isValidAircraftCallsign(cs))
|
||||
{
|
||||
this->showOverlayMessage(CStatusMessage(this).validationError("Invalid callsign for mapping"), OverlayMessageMs);
|
||||
this->showOverlayMessage(CStatusMessage(this).validationError(u"Invalid callsign for mapping"), OverlayMessageMs);
|
||||
return CCallsign();
|
||||
}
|
||||
|
||||
@@ -280,7 +280,7 @@ namespace BlackGui
|
||||
const bool hasCallsign = ui->tvp_RenderedAircraft->container().containsCallsign(callsign);
|
||||
if (!hasCallsign)
|
||||
{
|
||||
const CStatusMessage msg = CStatusMessage(this).validationError("Unmapped callsign '%1' for mapping") << callsign.asString();
|
||||
const CStatusMessage msg = CStatusMessage(this).validationError(u"Unmapped callsign '%1' for mapping") << callsign.asString();
|
||||
this->showOverlayMessage(msg);
|
||||
return CCallsign();
|
||||
}
|
||||
@@ -316,7 +316,7 @@ namespace BlackGui
|
||||
{
|
||||
if (!sGui || !sGui->getIContextSimulator() || !sGui->getISimulator() || !sGui->getISimulator()->isConnected()) { return; }
|
||||
const int reMatchedNo = sGui->getIContextSimulator()->doMatchingsAgain();
|
||||
CLogMessage(this).info("Triggered re-apping of %1 aircraft") << reMatchedNo;
|
||||
CLogMessage(this).info(u"Triggered re-apping of %1 aircraft") << reMatchedNo;
|
||||
}
|
||||
|
||||
void CMappingComponent::onSaveAircraft()
|
||||
@@ -327,7 +327,7 @@ namespace BlackGui
|
||||
const QString modelString = ui->completer_ModelStrings->getModelString();
|
||||
if (modelString.isEmpty())
|
||||
{
|
||||
this->showOverlayMessage(CStatusMessage(this).validationError("Missing model for mapping"), OverlayMessageMs);
|
||||
this->showOverlayMessage(CStatusMessage(this).validationError(u"Missing model for mapping"), OverlayMessageMs);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -340,7 +340,7 @@ namespace BlackGui
|
||||
|
||||
if (!hasModel)
|
||||
{
|
||||
this->showOverlayMessage(CStatusMessage(this).validationError("Invalid model for mapping, reloading model set"), OverlayMessageMs);
|
||||
this->showOverlayMessage(CStatusMessage(this).validationError(u"Invalid model for mapping, reloading model set"), OverlayMessageMs);
|
||||
if (ui->tvp_AircraftModels->isEmpty())
|
||||
{
|
||||
this->onModelsUpdateRequested();
|
||||
@@ -358,7 +358,7 @@ namespace BlackGui
|
||||
const CAircraftModelList models = sGui->getIContextSimulator()->getModelSetModelsStartingWith(modelString);
|
||||
if (models.isEmpty())
|
||||
{
|
||||
const CStatusMessage msg = CStatusMessage(this).validationError("No model for title: '%1'") << modelString;
|
||||
const CStatusMessage msg = CStatusMessage(this).validationError(u"No model for title: '%1'") << modelString;
|
||||
this->showOverlayMessage(msg, OverlayMessageMs);
|
||||
return;
|
||||
}
|
||||
@@ -372,12 +372,12 @@ namespace BlackGui
|
||||
}
|
||||
else
|
||||
{
|
||||
const CStatusMessage msg = CStatusMessage(this).validationInfo("Ambigious title: '%1', using '%2'") << modelString << model.getModelString();
|
||||
const CStatusMessage msg = CStatusMessage(this).validationInfo(u"Ambigious title: '%1', using '%2'") << modelString << model.getModelString();
|
||||
this->showOverlayMessage(msg, OverlayMessageMs);
|
||||
}
|
||||
}
|
||||
model.setModelType(CAircraftModel::TypeManuallySet);
|
||||
CLogMessage(this).info("Requesting changes for '%1'") << callsign.asString();
|
||||
CLogMessage(this).info(u"Requesting changes for '%1'") << callsign.asString();
|
||||
changed = sGui->getIContextNetwork()->updateAircraftModel(aircraftFromBackend.getCallsign(), model, identifier());
|
||||
}
|
||||
if (aircraftFromBackend.isEnabled() != enabled)
|
||||
@@ -387,7 +387,7 @@ namespace BlackGui
|
||||
|
||||
if (!changed)
|
||||
{
|
||||
this->showOverlayMessage(CLogMessage(this).info("Model mapping, nothing to change"), OverlayMessageMs);
|
||||
this->showOverlayMessage(CLogMessage(this).info(u"Model mapping, nothing to change"), OverlayMessageMs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -398,8 +398,8 @@ namespace BlackGui
|
||||
if (callsign.isEmpty()) { return; }
|
||||
const bool reset = sGui->getIContextSimulator()->resetToModelMatchingAircraft(callsign);
|
||||
const CStatusMessage msg = reset ?
|
||||
CStatusMessage(this).info("Model reset for '%1'") << callsign.toQString() :
|
||||
CStatusMessage(this).info("Reset failed for '%1'") << callsign.toQString();
|
||||
CStatusMessage(this).info(u"Model reset for '%1'") << callsign.toQString() :
|
||||
CStatusMessage(this).info(u"Reset failed for '%1'") << callsign.toQString();
|
||||
this->showOverlayMessage(msg, 3000);
|
||||
}
|
||||
|
||||
|
||||
@@ -98,11 +98,11 @@ namespace BlackGui
|
||||
const bool ok = sGui->updateFont(m_qss);
|
||||
if (ok)
|
||||
{
|
||||
CLogMessage(this).info("Updated font style");
|
||||
CLogMessage(this).info(u"Updated font style");
|
||||
}
|
||||
else
|
||||
{
|
||||
CLogMessage(this).warning("Updating style failed");
|
||||
CLogMessage(this).warning(u"Updating style failed");
|
||||
}
|
||||
}
|
||||
emit this->accept();
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace BlackGui
|
||||
if (sGui->getIContextNetwork() && sGui->getIContextNetwork()->isConnected())
|
||||
{
|
||||
// Style changes freeze the GUI, must not be done in flight mode
|
||||
CLogMessage(this).validationError("Cannot change style while connected to network");
|
||||
CLogMessage(this).validationError(u"Cannot change style while connected to network");
|
||||
ui->cb_SettingsGuiWidgetStyle->setCurrentText(settings.getWidgetStyle());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace BlackGui
|
||||
{
|
||||
if (!sGui || !sGui->getISimulator() || !sGui->getISimulator()->isConnected()) { return; }
|
||||
const int reMatchedNo = sGui->getIContextSimulator()->doMatchingsAgain();
|
||||
CLogMessage(this).info("Triggered re-apping of %1 aircraft") << reMatchedNo;
|
||||
CLogMessage(this).info(u"Triggered re-apping of %1 aircraft") << reMatchedNo;
|
||||
}
|
||||
|
||||
void CSettingsMatchingComponent::onSetupChanged()
|
||||
|
||||
@@ -198,7 +198,7 @@ namespace BlackGui
|
||||
ui->pte_ExcludeDirectories->clear();
|
||||
this->displayDefaultValuesAsPlaceholder(simulator);
|
||||
|
||||
CLogMessage(this).info("Reset values for settings of %1") << simulator.toQString(true);
|
||||
CLogMessage(this).info(u"Reset values for settings of %1") << simulator.toQString(true);
|
||||
}
|
||||
|
||||
void CSettingsSimulatorBasicsComponent::onSimulatorChanged()
|
||||
|
||||
@@ -156,7 +156,7 @@ namespace BlackGui
|
||||
const CSimulatorPluginInfo selected = simDrivers.findByIdentifier(identifier);
|
||||
if (selected.isUnspecified())
|
||||
{
|
||||
CLogMessage(this).error("Simulator plugin does not exist: '%1'") << identifier;
|
||||
CLogMessage(this).error(u"Simulator plugin does not exist: '%1'") << identifier;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -198,11 +198,11 @@ namespace BlackGui
|
||||
const int noRendered = setup.getMaxRenderedAircraft();
|
||||
if (noRequested == noRendered)
|
||||
{
|
||||
CLogMessage(this).info("Max.rendered aircraft: %1") << noRendered;
|
||||
CLogMessage(this).info(u"Max.rendered aircraft: %1") << noRendered;
|
||||
}
|
||||
else
|
||||
{
|
||||
CLogMessage(this).info("Max.rendered aircraft: %1, requested: %2") << noRendered << noRequested;
|
||||
CLogMessage(this).info(u"Max.rendered aircraft: %1, requested: %2") << noRendered << noRequested;
|
||||
ui->le_MaxAircraft->setText(QString::number(noRendered));
|
||||
}
|
||||
this->setGuiValues();
|
||||
@@ -225,7 +225,7 @@ namespace BlackGui
|
||||
}
|
||||
else
|
||||
{
|
||||
CLogMessage(this).info("Max.distance requested: %1") << newDistance.valueRoundedWithUnit(2, true);
|
||||
CLogMessage(this).info(u"Max.distance requested: %1") << newDistance.valueRoundedWithUnit(2, true);
|
||||
setup.setMaxRenderedDistance(newDistance);
|
||||
sGui->getIContextSimulator()->setInterpolationAndRenderingSetupGlobal(setup);
|
||||
this->setGuiValues();
|
||||
@@ -251,7 +251,7 @@ namespace BlackGui
|
||||
}
|
||||
if (ost.isNull())
|
||||
{
|
||||
CLogMessage().validationWarning("Invalid offset time");
|
||||
CLogMessage().validationWarning(u"Invalid offset time");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -92,14 +92,14 @@ namespace BlackGui
|
||||
for (const CUrl &url : bootstrapUrls)
|
||||
{
|
||||
const CStatusMessage msg = CNetworkUtils::canConnect(url) ?
|
||||
CStatusMessage(this).info("Can connect to '%1'") << url.getFullUrl() : CStatusMessage(this).warning("Cannot connect to '%1'") << url.getFullUrl();
|
||||
CStatusMessage(this).info(u"Can connect to '%1'") << url.getFullUrl() : CStatusMessage(this).warning(u"Cannot connect to '%1'") << url.getFullUrl();
|
||||
ui->comp_Messages->appendStatusMessageToList(msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
const CStatusMessage msg = CStatusMessage(this).warning("No loaded bootstrap setup available, skipping URL test");
|
||||
const CStatusMessage msg = CStatusMessage(this).warning(u"No loaded bootstrap setup available, skipping URL test");
|
||||
ui->comp_Messages->appendStatusMessageToList(msg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ namespace BlackGui
|
||||
|
||||
void CSimulatorComponent::onAddingRemoteModelFailed(const CSimulatedAircraft &aircraft, bool disabled, const CStatusMessage &message)
|
||||
{
|
||||
ui->comp_StatusMessages->appendStatusMessageToList(CStatusMessage(this).warning("Adding model failed, disabled: %1: '%2'") << boolToYesNo(disabled) << aircraft.toQString(true));
|
||||
ui->comp_StatusMessages->appendStatusMessageToList(CStatusMessage(this).warning(u"Adding model failed, disabled: %1: '%2'") << boolToYesNo(disabled) << aircraft.toQString(true));
|
||||
ui->comp_StatusMessages->appendStatusMessageToList(message);
|
||||
}
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ namespace BlackGui
|
||||
|
||||
if (msgSettings.popupSelcalMessages())
|
||||
{
|
||||
emit this->displayInInfoWindow(CLogMessage(this).info("SELCAL received"), 3 * 1000);
|
||||
emit this->displayInInfoWindow(CLogMessage(this).info(u"SELCAL received"), 3 * 1000);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@@ -538,7 +538,7 @@ namespace BlackGui
|
||||
QString cmd(".msg ");
|
||||
if (index < 0 || index == ui->tw_TextMessages->indexOf(ui->tb_TextMessagesAll))
|
||||
{
|
||||
CLogMessage(this).validationError("Incorrect message channel");
|
||||
CLogMessage(this).validationError(u"Incorrect message channel");
|
||||
return {};
|
||||
}
|
||||
else
|
||||
@@ -609,7 +609,7 @@ namespace BlackGui
|
||||
{
|
||||
if (callsign.isEmpty())
|
||||
{
|
||||
CLogMessage(this).warning("No callsign to display text message");
|
||||
CLogMessage(this).warning(u"No callsign to display text message");
|
||||
return;
|
||||
}
|
||||
QWidget *w = this->findTextMessageTabByCallsign(callsign, true);
|
||||
|
||||
@@ -72,14 +72,14 @@ namespace BlackGui
|
||||
CAircraftParts parts;
|
||||
if (jsonParts.isEmpty())
|
||||
{
|
||||
CLogMessage(this).validationError("No JSON content");
|
||||
CLogMessage(this).validationError(u"No JSON content");
|
||||
return parts;
|
||||
}
|
||||
QJsonParseError jsonError;
|
||||
QJsonDocument jsonDoc(QJsonDocument::fromJson(jsonParts.toUtf8(), &jsonError));
|
||||
if (jsonError.error != QJsonParseError::NoError)
|
||||
{
|
||||
CLogMessage(this).validationError("Parse error: %1") << jsonError.errorString();
|
||||
CLogMessage(this).validationError(u"Parse error: %1") << jsonError.errorString();
|
||||
return parts;
|
||||
}
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ namespace BlackGui
|
||||
}
|
||||
else
|
||||
{
|
||||
CLogMessage(this).validationWarning("Wrong transponder code, reset");
|
||||
CLogMessage(this).validationWarning(u"Wrong transponder code, reset");
|
||||
ui->sbp_ComPanelTransponder->setValue(transponder.getTransponderCode());
|
||||
}
|
||||
transponder.setTransponderMode(ui->cbp_ComPanelTransponderMode->getSelectedTransponderMode());
|
||||
|
||||
@@ -121,19 +121,19 @@ namespace BlackGui
|
||||
const CUser user(this->getUser());
|
||||
const bool validId = m_vatsim ? user.hasValidVatsimId() : user.hasId();
|
||||
ui->lblp_Id->setTicked(validId);
|
||||
if (!validId) { msgs.push_back(CStatusMessage(this).validationError("Invalid id")); }
|
||||
if (!validId) { msgs.push_back(CStatusMessage(this).validationError(u"Invalid id")); }
|
||||
|
||||
const bool validHomeAirport = user.hasValidHomeBase();
|
||||
ui->lblp_HomeAirport->setTicked(validHomeAirport);
|
||||
if (!validHomeAirport) { msgs.push_back(CStatusMessage(this).validationError("Wromg home airport")); }
|
||||
if (!validHomeAirport) { msgs.push_back(CStatusMessage(this).validationError(u"Wromg home airport")); }
|
||||
|
||||
const bool validCredentials = user.hasCredentials();
|
||||
ui->lblp_Password->setTicked(validCredentials);
|
||||
if (!validCredentials) { msgs.push_back(CStatusMessage(this).validationError("Invalid credentials")); }
|
||||
if (!validCredentials) { msgs.push_back(CStatusMessage(this).validationError(u"Invalid credentials")); }
|
||||
|
||||
const bool validRealName = user.hasRealName();
|
||||
ui->lblp_RealName->setTicked(validRealName);
|
||||
if (!validRealName) { msgs.push_back(CStatusMessage(this).validationError("Invalid real name")); }
|
||||
if (!validRealName) { msgs.push_back(CStatusMessage(this).validationError(u"Invalid real name")); }
|
||||
|
||||
return msgs;
|
||||
}
|
||||
|
||||
@@ -368,7 +368,7 @@ namespace BlackGui
|
||||
window->restoreGeometry(g);
|
||||
window->restoreState(s);
|
||||
const QString location = settings.fileName();
|
||||
CLogMessage(this).info("GUI settings are here: '%1'") << location;
|
||||
CLogMessage(this).info(u"GUI settings are here: '%1'") << location;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -714,7 +714,7 @@ namespace BlackGui
|
||||
{
|
||||
if (!sGui || sGui->isShuttingDown()) { return; }
|
||||
this->displayTextInConsole(this->getWebDataServices()->getReadersLog());
|
||||
CLogMessage(this).info("Displayed services log.");
|
||||
CLogMessage(this).info(u"Displayed services log.");
|
||||
});
|
||||
Q_ASSERT_X(c, Q_FUNC_INFO, "Connect failed");
|
||||
}
|
||||
@@ -811,7 +811,7 @@ namespace BlackGui
|
||||
const CUrl helpPage = gs.getHelpPageUrl(context);
|
||||
if (helpPage.isEmpty())
|
||||
{
|
||||
CLogMessage(this).warning("No help page");
|
||||
CLogMessage(this).warning(u"No help page");
|
||||
return;
|
||||
}
|
||||
QDesktopServices::openUrl(helpPage);
|
||||
@@ -1067,7 +1067,7 @@ namespace BlackGui
|
||||
// changing style freezes the application, so it must not be done in flight mode
|
||||
if (this->getIContextNetwork() && this->getIContextNetwork()->isConnected())
|
||||
{
|
||||
CLogMessage(this).validationError("Cannot change style while connected to network");
|
||||
CLogMessage(this).validationError(u"Cannot change style while connected to network");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -772,7 +772,7 @@ namespace BlackGui
|
||||
{
|
||||
if (m_lockTabBar)
|
||||
{
|
||||
CLogMessage(this).info("Locked, double click will not cause floating");
|
||||
CLogMessage(this).info(u"Locked, double click will not cause floating");
|
||||
return;
|
||||
}
|
||||
CDockWidgetInfoArea *dw = this->getDockWidgetInfoAreaByTabBarIndex(tabBarIndex);
|
||||
|
||||
@@ -200,12 +200,12 @@ namespace BlackGui
|
||||
const CAircraftModelList dbModels(sGui->getWebDataServices()->getModels());
|
||||
if (dbModels.isEmpty())
|
||||
{
|
||||
CLogMessage(this).warning("No DB models to consolidate with");
|
||||
CLogMessage(this).warning(u"No DB models to consolidate with");
|
||||
return;
|
||||
}
|
||||
if (!this->modelsTargetSetable())
|
||||
{
|
||||
CLogMessage(this).warning("No setable target");
|
||||
CLogMessage(this).warning(u"No setable target");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -219,17 +219,17 @@ namespace BlackGui
|
||||
if (filtered)
|
||||
{
|
||||
this->modelsTargetUpdatable()->updateModels(models);
|
||||
CLogMessage(this).info("Consolidated %1/%2 filtered models with DB") << c << models.size();
|
||||
CLogMessage(this).info(u"Consolidated %1/%2 filtered models with DB") << c << models.size();
|
||||
}
|
||||
else
|
||||
{
|
||||
this->modelsTargetSetable()->setModels(models);
|
||||
CLogMessage(this).info("Consolidated %1/%2 models with DB") << c << models.size();
|
||||
CLogMessage(this).info(u"Consolidated %1/%2 models with DB") << c << models.size();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
CLogMessage(this).info("No data consolidated with DB");
|
||||
CLogMessage(this).info(u"No data consolidated with DB");
|
||||
this->modelView()->hideLoadIndicator();
|
||||
}
|
||||
}
|
||||
@@ -243,7 +243,7 @@ namespace BlackGui
|
||||
if (models.isEmpty()) { return; }
|
||||
if (!this->modelsTargetUpdatable())
|
||||
{
|
||||
CLogMessage(this).warning("No updatable target");
|
||||
CLogMessage(this).warning(u"No updatable target");
|
||||
return;
|
||||
}
|
||||
const int c = CDatabaseUtils::consolidateModelsWithDbDataAllowsGuiRefresh(models, true, true);
|
||||
@@ -317,7 +317,7 @@ namespace BlackGui
|
||||
{
|
||||
if (!this->modelsTargetUpdatable())
|
||||
{
|
||||
CLogMessage(this).warning("No updatable target");
|
||||
CLogMessage(this).warning(u"No updatable target");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -327,7 +327,7 @@ namespace BlackGui
|
||||
this->modelView()->hideLoadIndicator(i);
|
||||
if (!removedModelStrings.isEmpty() && this->getMappingComponent())
|
||||
{
|
||||
const CStatusMessage m = CStatusMessage(this).info("Removed %1 model(s)") << removedModelStrings.size();
|
||||
const CStatusMessage m = CStatusMessage(this).info(u"Removed %1 model(s)") << removedModelStrings.size();
|
||||
this->getMappingComponent()->showOverlayMessage(m, 5000);
|
||||
}
|
||||
}
|
||||
@@ -339,7 +339,7 @@ namespace BlackGui
|
||||
if (models.isEmpty()) { return; }
|
||||
if (!this->modelsTargetUpdatable())
|
||||
{
|
||||
CLogMessage(this).warning("No updatable target");
|
||||
CLogMessage(this).warning(u"No updatable target");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -352,7 +352,7 @@ namespace BlackGui
|
||||
this->modelView()->hideLoadIndicator(i);
|
||||
if (!removedModelStrings.isEmpty() && this->getMappingComponent())
|
||||
{
|
||||
const CStatusMessage m = CStatusMessage(this).info("Removed %1 model(s)") << removedModelStrings.size();
|
||||
const CStatusMessage m = CStatusMessage(this).info(u"Removed %1 model(s)") << removedModelStrings.size();
|
||||
this->getMappingComponent()->showOverlayMessage(m, 5000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -691,19 +691,19 @@ namespace BlackGui
|
||||
{
|
||||
if (fileName.isEmpty())
|
||||
{
|
||||
m = CStatusMessage(this).error("Load canceled, no file name");
|
||||
m = CStatusMessage(this).error(u"Load canceled, no file name");
|
||||
break;
|
||||
}
|
||||
|
||||
const QString json(CFileUtils::readFileToString(fileName));
|
||||
if (json.isEmpty())
|
||||
{
|
||||
m = CStatusMessage(this).warning("Reading '%1' yields no data") << fileName;
|
||||
m = CStatusMessage(this).warning(u"Reading '%1' yields no data") << fileName;
|
||||
break;
|
||||
}
|
||||
if (!Json::looksLikeSwiftJson(json))
|
||||
{
|
||||
m = CStatusMessage(this).warning("No swift JSON '%1'") << fileName;
|
||||
m = CStatusMessage(this).warning(u"No swift JSON '%1'") << fileName;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -713,7 +713,7 @@ namespace BlackGui
|
||||
const QJsonObject jsonObject = Json::jsonObjectFromString(json, allowCacheFormat);
|
||||
if (jsonObject.isEmpty())
|
||||
{
|
||||
m = CStatusMessage(this).warning("No valid swift JSON '%1'") << fileName;
|
||||
m = CStatusMessage(this).warning(u"No valid swift JSON '%1'") << fileName;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -726,7 +726,7 @@ namespace BlackGui
|
||||
containerVariant.convertFromJson(jsonObject);
|
||||
if (!containerVariant.canConvert<ContainerType>())
|
||||
{
|
||||
m = CStatusMessage(this).warning("No valid swift JSON '%1'") << fileName;
|
||||
m = CStatusMessage(this).warning(u"No valid swift JSON '%1'") << fileName;
|
||||
break;
|
||||
}
|
||||
container = containerVariant.value<ContainerType>();
|
||||
|
||||
Reference in New Issue
Block a user