Commit 549000eb authored by Don Gagne's avatar Don Gagne

Remove QGCMessageBox usage

parent e3134f6a
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
/// @author Don Gagne <don@thegagnes.com /// @author Don Gagne <don@thegagnes.com
#include "RadioComponentController.h" #include "RadioComponentController.h"
#include "QGCMessageBox.h"
#include "AutoPilotPluginManager.h" #include "AutoPilotPluginManager.h"
#include "QGCApplication.h"
#include <QSettings> #include <QSettings>
......
...@@ -657,7 +657,6 @@ void ParameterLoader::_saveToEEPROM(void) ...@@ -657,7 +657,6 @@ void ParameterLoader::_saveToEEPROM(void)
QString ParameterLoader::readParametersFromStream(QTextStream& stream) QString ParameterLoader::readParametersFromStream(QTextStream& stream)
{ {
QString errors; QString errors;
bool userWarned = false;
while (!stream.atEnd()) { while (!stream.atEnd()) {
QString line = stream.readLine(); QString line = stream.readLine();
...@@ -665,16 +664,8 @@ QString ParameterLoader::readParametersFromStream(QTextStream& stream) ...@@ -665,16 +664,8 @@ QString ParameterLoader::readParametersFromStream(QTextStream& stream)
QStringList wpParams = line.split("\t"); QStringList wpParams = line.split("\t");
int lineMavId = wpParams.at(0).toInt(); int lineMavId = wpParams.at(0).toInt();
if (wpParams.size() == 5) { if (wpParams.size() == 5) {
if (!userWarned && (_vehicle->id() != lineMavId)) { if (_vehicle->id() != lineMavId) {
userWarned = true; return QString("The parameters in the stream have been saved from System Id %1, but the current vehicle has the System Id %2.").arg(lineMavId).arg(_vehicle->id());
QString msg("The parameters in the stream have been saved from System Id %1, but the current vehicle has the System Id %2.");
QGCMessageBox::StandardButton button = QGCMessageBox::warning("Parameter Load",
msg.arg(lineMavId).arg(_vehicle->id()),
QGCMessageBox::Ok | QGCMessageBox::Cancel,
QGCMessageBox::Cancel);
if (button == QGCMessageBox::Cancel) {
return QString();
}
} }
int componentId = wpParams.at(1).toInt(); int componentId = wpParams.at(1).toInt();
......
...@@ -455,9 +455,7 @@ bool QGCApplication::_initForNormalAppBoot(void) ...@@ -455,9 +455,7 @@ bool QGCApplication::_initForNormalAppBoot(void)
/// settings. /// settings.
QString savedFilesLocation = settings.value(_savedFilesLocationKey).toString(); QString savedFilesLocation = settings.value(_savedFilesLocationKey).toString();
if (savedFilesLocation.isEmpty()) { if (savedFilesLocation.isEmpty()) {
QGCMessageBox::warning( showMessage("The location to save files to is invalid, or cannot be written to. Please provide a new one.");
tr("Bad save location"),
tr("The location to save files to is invalid, or cannot be written to. Please provide a new one."));
mainWindow->showSettings(); mainWindow->showSettings();
} }
...@@ -705,10 +703,7 @@ void QGCApplication::_missingParamsDisplay(void) ...@@ -705,10 +703,7 @@ void QGCApplication::_missingParamsDisplay(void)
} }
_missingParams.clear(); _missingParams.clear();
QGCMessageBox::critical( showMessage(QString("Parameters missing from firmware: %1.\n\nYou should quit QGroundControl immediately and update your firmware.").arg(params));
"Missing Parameters",
QString("Parameters missing from firmware: %1.\n\n"
"You should quit QGroundControl immediately and update your firmware.").arg(params));
} }
void QGCApplication::showMessage(const QString& message) void QGCApplication::showMessage(const QString& message)
...@@ -717,6 +712,6 @@ void QGCApplication::showMessage(const QString& message) ...@@ -717,6 +712,6 @@ void QGCApplication::showMessage(const QString& message)
if (mainWindow) { if (mainWindow) {
mainWindow->showToolbarMessage(message); mainWindow->showToolbarMessage(message);
} else { } else {
QGCMessageBox::information("", message); qWarning() << "showMessage with no mainWindow" << message;
} }
} }
...@@ -60,7 +60,7 @@ bool QGCQuickWidget::setSource(const QUrl& qmlUrl) ...@@ -60,7 +60,7 @@ bool QGCQuickWidget::setSource(const QUrl& qmlUrl)
errorList += error.toString(); errorList += error.toString();
errorList += "\n"; errorList += "\n";
} }
QGCMessageBox::warning(tr("Qml Error"), tr("Source not ready: Status(%1)\nErrors:\n%2").arg(status()).arg(errorList)); qgcApp()->showMessage(QString("Source not ready: Status(%1)\nErrors:\n%2").arg(status()).arg(errorList));
return false; return false;
} }
......
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