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

This commit is contained in:
Pawel Polanski
2011-02-07 09:45:54 +01:00
parent 64dd45f7b9
commit d15d07b7cf
2 changed files with 18 additions and 0 deletions

View File

@@ -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();
}
}