Commit f1196e14 authored by Don Gagne's avatar Don Gagne

Show vehicle errors after parameter load

parent fa12589e
...@@ -758,20 +758,25 @@ void ParameterLoader::_checkInitialLoadComplete(void) ...@@ -758,20 +758,25 @@ void ParameterLoader::_checkInitialLoadComplete(void)
UASMessageHandler* msgHandler = UASMessageHandler::instance(); UASMessageHandler* msgHandler = UASMessageHandler::instance();
if (msgHandler->getErrorCountTotal()) { if (msgHandler->getErrorCountTotal()) {
QString errors; QString errors;
bool firstError = true;
msgHandler->lockAccess(); msgHandler->lockAccess();
foreach (UASMessage* msg, msgHandler->messages()) { foreach (UASMessage* msg, msgHandler->messages()) {
if (msg->severityIsError()) { if (msg->severityIsError()) {
errors += msg->getText(); if (!firstError) {
errors += "\n"; errors += "\n";
} }
errors += " - ";
errors += msg->getText();
firstError = false;
}
} }
msgHandler->unlockAccess(); msgHandler->unlockAccess();
QGCMessageBox::critical("Vehicle startup errors", if (!firstError) {
QString("Errors were detected during vehicle startup:\n" QString errorMsg = QString("Errors were detected during vehicle startup. You should resolve these prior to flight.\n%1").arg(errors);
"%1" qgcApp()->showToolBarMessage(errorMsg);
"You should resolve these prior to flight.").arg(errors)); }
} }
// Warn of parameter load failure // Warn of parameter load failure
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment