mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Splash screen messages for web data services
This commit is contained in:
committed by
Mat Sutcliffe
parent
8c3faa4ca9
commit
400a8fc2a8
@@ -250,6 +250,7 @@ namespace BlackCore
|
||||
m1 = CStatusMessage(this, CStatusMessage::SeverityError, "First bootstrap URL is empty");
|
||||
}
|
||||
|
||||
emit this->setupLoadingMessages(m1);
|
||||
|
||||
url = randomUrls.back();
|
||||
if (!url.isEmpty())
|
||||
|
||||
@@ -1430,10 +1430,11 @@ namespace BlackCore
|
||||
if (timeOut.isValid() && QDateTime::currentDateTimeUtc() > timeOut)
|
||||
{
|
||||
const QString timeOutString = timeOut.toString();
|
||||
CLogMessage(this).warning(u"Could not read '%1' info objects for '%2' from '%3', time out '%4'. Marking reader '%5' as failed and continue.")
|
||||
<< info << CEntityFlags::flagToString(entities)
|
||||
<< infoReader->getInfoObjectsUrl().toQString() << timeOutString
|
||||
<< infoReader->getName();
|
||||
const CStatusMessage m = CLogMessage(this).warning(u"Could not read '%1' info objects for '%2' from '%3', time out '%4'. Marking reader '%5' as failed and continue.")
|
||||
<< info << CEntityFlags::flagToString(entities)
|
||||
<< infoReader->getInfoObjectsUrl().toQString() << timeOutString
|
||||
<< infoReader->getName();
|
||||
emit this->databaseReaderMessages(m);
|
||||
|
||||
// continue here and read data without info objects
|
||||
infoReader->setMarkedAsFailed(true);
|
||||
@@ -1448,15 +1449,17 @@ namespace BlackCore
|
||||
{
|
||||
// ok, this means we are parsing
|
||||
this->readDeferredInBackground(entities, waitForInfoObjectsMs);
|
||||
CLogMessage(this).info(u"Parsing objects (%1) for '%2' from '%3'") << info << CEntityFlags::flagToString(entities) << infoReader->getInfoObjectsUrl().toQString();
|
||||
const CStatusMessage m = CLogMessage(this).info(u"Parsing objects (%1) for '%2' from '%3'") << info << CEntityFlags::flagToString(entities) << infoReader->getInfoObjectsUrl().toQString();
|
||||
emit this->databaseReaderMessages(m);
|
||||
return false; // wait
|
||||
}
|
||||
else
|
||||
{
|
||||
// we have a response, but a failure, means server is alive, but responded with error
|
||||
// such an error (access, ...) normally will not go away
|
||||
CLogMessage(this).error(u"Info objects (%1) loading for '%2' failed from '%3', '%4'") << info << CEntityFlags::flagToString(entities) << infoReader->getInfoObjectsUrl().toQString() << infoReader->getStatusMessage();
|
||||
const CStatusMessage m = CLogMessage(this).error(u"Info objects (%1) loading for '%2' failed from '%3', '%4'") << info << CEntityFlags::flagToString(entities) << infoReader->getInfoObjectsUrl().toQString() << infoReader->getStatusMessage();
|
||||
infoReader->setMarkedAsFailed(true);
|
||||
emit this->databaseReaderMessages(m);
|
||||
return true; // carry on, regardless of situation
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,6 +96,9 @@ namespace BlackGui
|
||||
// notify when app goes down
|
||||
connect(qGuiApp, &QGuiApplication::lastWindowClosed, this, &CGuiApplication::gracefulShutdown);
|
||||
|
||||
// follow up on web data services
|
||||
connect(this, &CApplication::webDataServicesStarted, this, &CGuiApplication::onWebDataServicesStarted);
|
||||
|
||||
if (!sGui)
|
||||
{
|
||||
CGuiApplication::registerMetadata();
|
||||
@@ -109,6 +112,8 @@ namespace BlackGui
|
||||
|
||||
connect(&m_styleSheetUtility, &CStyleSheetUtility::styleSheetsChanged, this, &CGuiApplication::onStyleSheetsChanged, Qt::QueuedConnection);
|
||||
connect(this, &CGuiApplication::startUpCompleted, this, &CGuiApplication::superviseWindowMinSizes, Qt::QueuedConnection);
|
||||
|
||||
// splash screen
|
||||
connect(this->getSetupReader(), &CSetupReader::setupLoadingMessages, this, &CGuiApplication::displaySplashMessages, Qt::QueuedConnection);
|
||||
}
|
||||
}
|
||||
@@ -1112,6 +1117,14 @@ namespace BlackGui
|
||||
m_fontPointSize = font.pointSize();
|
||||
}
|
||||
|
||||
void CGuiApplication::onWebDataServicesStarted(bool success)
|
||||
{
|
||||
if (success)
|
||||
{
|
||||
connect(this->getWebDataServices(), &CWebDataServices::databaseReaderMessages, this, &CGuiApplication::displaySplashMessages, Qt::QueuedConnection);
|
||||
}
|
||||
}
|
||||
|
||||
void CGuiApplication::superviseWindowMinSizes()
|
||||
{
|
||||
CGuiUtility::superviseMainWindowMinSizes();
|
||||
|
||||
@@ -344,6 +344,9 @@ namespace BlackGui
|
||||
//! Set current font values
|
||||
void setCurrentFontValues();
|
||||
|
||||
//! Web data services started
|
||||
void onWebDataServicesStarted(bool success);
|
||||
|
||||
//! \copydoc BlackGui::CGuiUtility::superviseMainWindowMinSizes
|
||||
void superviseWindowMinSizes();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user