Commit d15d07b7 authored by Pawel Polanski's avatar Pawel Polanski
Browse files

Symbian: Finish CODA's RunControl when usb cable is unplugged

parent 64dd45f7
......@@ -48,6 +48,8 @@
#include <coreplugin/icore.h>
#include <utils/qtcassert.h>
#include <symbianutils/symbiandevicemanager.h>
#include <QtCore/QDir>
#include <QtCore/QFileInfo>
#include <QtCore/QScopedPointer>
......@@ -134,6 +136,8 @@ bool CodaRunControl::setupLauncher()
appendMessage(tr("Couldn't open serial device: %1").arg(serialDevice->errorString()), ErrorMessageFormat);
return false;
}
connect(SymbianUtils::SymbianDeviceManager::instance(), SIGNAL(deviceRemoved(const SymbianUtils::SymbianDevice)),
this, SLOT(deviceRemoved(SymbianUtils::SymbianDevice)));
m_state = StateConnecting;
m_tcfTrkDevice->sendSerialPing(false);
QTimer::singleShot(4000, this, SLOT(checkForTimeout()));
......@@ -356,3 +360,12 @@ void CodaRunControl::cancelConnection()
appendMessage(tr("Canceled."), ErrorMessageFormat);
emit finished();
}
void CodaRunControl::deviceRemoved(const SymbianUtils::SymbianDevice &device)
{
if (m_tcfTrkDevice && device.portName() == m_serialPort) {
QString msg = tr("The device '%1' has been disconnected").arg(device.friendlyName());
appendMessage(msg, ErrorMessageFormat);
finishRunControl();
}
}
......@@ -47,6 +47,10 @@ class TcfTrkDevice;
class TcfTrkEvent;
}
namespace SymbianUtils {
class SymbianDevice;
}
namespace Qt4ProjectManager {
namespace Internal {
......@@ -70,6 +74,7 @@ protected slots:
void finishRunControl();
void checkForTimeout();
void cancelConnection();
void deviceRemoved(const SymbianUtils::SymbianDevice &device);
private slots:
void slotError(const QString &error);
......
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