Commit e962bfc0 authored by Fawzi Mohamed's avatar Fawzi Mohamed
Browse files

ios: fix warning for failed run on device



avoid executing a runloop in a signal handler

Change-Id: I4822226d3ece93fbfb6b6107add3c1e32b6c973c
Reviewed-by: default avatarEike Ziller <eike.ziller@digia.com>
parent d3356354
......@@ -50,7 +50,7 @@ IosRunner::IosRunner(QObject *parent, IosRunConfiguration *runConfig, bool debug
: QObject(parent), m_toolHandler(0), m_bundleDir(runConfig->bundleDir().toString()),
m_arguments(runConfig->commandLineArguments()),
m_device(ProjectExplorer::DeviceKitInformation::device(runConfig->target()->kit())),
m_debuggingMode(debuggingMode), m_cleanExit(false)
m_debuggingMode(debuggingMode), m_cleanExit(false), m_didWarn(false)
{
}
......@@ -155,18 +155,25 @@ void IosRunner::handleAppOutput(IosToolHandler *handler, const QString &output)
emit appOutput(output);
}
void IosRunner::warnAboutRunFail()
{
if (m_didWarn)
return;
m_didWarn = true;
QMessageBox mBox;
mBox.setText(tr("Running on iOS device failed."));
mBox.setInformativeText(tr("The certificates in Xcode or the device might be outdated. Check the certificates in the organizer window of Xcode, and try again."));
mBox.setStandardButtons(QMessageBox::Ok);
mBox.setDefaultButton(QMessageBox::Ok);
mBox.setIcon(QMessageBox::Information);
mBox.exec();
}
void IosRunner::handleErrorMsg(IosToolHandler *handler, const QString &msg)
{
if (msg.contains(QLatin1String("AMDeviceStartService returned -402653150"))) {
QMessageBox mBox;
mBox.setText(tr("Running on iOS device failed."));
mBox.setInformativeText(tr("The certificates in Xcode or the device might be outdated. Check the certificates in the organizer window of Xcode, and try again."));
mBox.setStandardButtons(QMessageBox::Ok);
mBox.setDefaultButton(QMessageBox::Ok);
mBox.setIcon(QMessageBox::Information);
mBox.exec();
}
Q_UNUSED(handler);
if (msg.contains(QLatin1String("AMDeviceStartService returned -402653150")))
QTimer::singleShot(0, this, SLOT(warnAboutRunFail()));
emit errorMsg(msg);
}
......
......@@ -70,6 +70,7 @@ signals:
void errorMsg(const QString &msg);
void finished(bool cleanExit);
private slots:
void warnAboutRunFail();
void handleDidStartApp(Ios::IosToolHandler *handler, const QString &bundlePath,
const QString &deviceId, Ios::IosToolHandler::OpStatus status);
void handleGotGdbserverSocket(Ios::IosToolHandler *handler, const QString &bundlePath,
......@@ -87,6 +88,7 @@ private:
ProjectExplorer::IDevice::ConstPtr m_device;
bool m_debuggingMode;
bool m_cleanExit;
bool m_didWarn;
};
} // namespace Internal
......
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