Commit c8e57f74 authored by Don Gagne's avatar Don Gagne

commit

parent bac63010
...@@ -63,6 +63,9 @@ QGCFlightGearLink::QGCFlightGearLink(UASInterface* mav, QString startupArguments ...@@ -63,6 +63,9 @@ QGCFlightGearLink::QGCFlightGearLink(UASInterface* mav, QString startupArguments
this->mav = mav; this->mav = mav;
this->name = tr("FlightGear 3.0+ Link (port:%1)").arg(port); this->name = tr("FlightGear 3.0+ Link (port:%1)").arg(port);
setRemoteHost(remoteHost); setRemoteHost(remoteHost);
// We need a mechanism so show error message from our FGLink thread on the UI thread. This signal connection will do that for us.
connect(this, SIGNAL(showCriticalMessageFromThread(const QString&, const QString&)), MainWindow::instance(), SLOT(showCriticalMessage(const QString&, const QString&)));
} }
QGCFlightGearLink::~QGCFlightGearLink() QGCFlightGearLink::~QGCFlightGearLink()
...@@ -158,23 +161,23 @@ void QGCFlightGearLink::processError(QProcess::ProcessError err) ...@@ -158,23 +161,23 @@ void QGCFlightGearLink::processError(QProcess::ProcessError err)
switch(err) switch(err)
{ {
case QProcess::FailedToStart: case QProcess::FailedToStart:
MainWindow::instance()->showCriticalMessage(tr("FlightGear Failed to Start"), tr("Please check if the path and command is correct")); emit showCriticalMessageFromThread(tr("FlightGear Failed to Start"), tr("Please check if the path and command is correct"));
break; break;
case QProcess::Crashed: case QProcess::Crashed:
MainWindow::instance()->showCriticalMessage(tr("FlightGear Crashed"), tr("This is a FlightGear-related problem. Please upgrade FlightGear")); emit showCriticalMessageFromThread(tr("FlightGear Crashed"), tr("This is a FlightGear-related problem. Please upgrade FlightGear"));
break; break;
case QProcess::Timedout: case QProcess::Timedout:
MainWindow::instance()->showCriticalMessage(tr("FlightGear Start Timed Out"), tr("Please check if the path and command is correct")); emit showCriticalMessageFromThread(tr("FlightGear Start Timed Out"), tr("Please check if the path and command is correct"));
break; break;
case QProcess::WriteError: case QProcess::WriteError:
MainWindow::instance()->showCriticalMessage(tr("Could not Communicate with FlightGear"), tr("Please check if the path and command is correct")); emit showCriticalMessageFromThread(tr("Could not Communicate with FlightGear"), tr("Please check if the path and command is correct"));
break; break;
case QProcess::ReadError: case QProcess::ReadError:
MainWindow::instance()->showCriticalMessage(tr("Could not Communicate with FlightGear"), tr("Please check if the path and command is correct")); emit showCriticalMessageFromThread(tr("Could not Communicate with FlightGear"), tr("Please check if the path and command is correct"));
break; break;
case QProcess::UnknownError: case QProcess::UnknownError:
default: default:
MainWindow::instance()->showCriticalMessage(tr("FlightGear Error"), tr("Please check if the path and command is correct.")); emit showCriticalMessageFromThread(tr("FlightGear Error"), tr("Please check if the path and command is correct."));
break; break;
} }
} }
......
...@@ -91,6 +91,9 @@ public: ...@@ -91,6 +91,9 @@ public:
static bool parseUIArguments(QString uiArgs, QStringList& argList); static bool parseUIArguments(QString uiArgs, QStringList& argList);
void run(); void run();
signals:
void showCriticalMessageFromThread(const QString& title, const QString& message);
public slots: public slots:
// void setAddress(QString address); // void setAddress(QString address);
......
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