forked from qt-creator/qt-creator
Add some progress information.
This commit is contained in:
@@ -471,7 +471,8 @@ void S60DeviceRunControl::stop()
|
|||||||
{
|
{
|
||||||
m_makesis->kill();
|
m_makesis->kill();
|
||||||
m_signsis->kill();
|
m_signsis->kill();
|
||||||
m_adapter->terminate();
|
if (m_adapter)
|
||||||
|
m_adapter->terminate();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool S60DeviceRunControl::isRunning() const
|
bool S60DeviceRunControl::isRunning() const
|
||||||
@@ -535,6 +536,11 @@ void S60DeviceRunControl::signsisProcessFinished()
|
|||||||
}
|
}
|
||||||
m_adapter = new trk::Adapter;
|
m_adapter = new trk::Adapter;
|
||||||
connect(m_adapter, SIGNAL(finished()), this, SLOT(runFinished()));
|
connect(m_adapter, SIGNAL(finished()), this, SLOT(runFinished()));
|
||||||
|
connect(m_adapter, SIGNAL(copyingStarted()), this, SLOT(printCopyingNotice()));
|
||||||
|
connect(m_adapter, SIGNAL(installingStarted()), this, SLOT(printInstallingNotice()));
|
||||||
|
connect(m_adapter, SIGNAL(startingApplication()), this, SLOT(printStartingNotice()));
|
||||||
|
connect(m_adapter, SIGNAL(applicationRunning(uint)), this, SLOT(printRunNotice(uint)));
|
||||||
|
|
||||||
//TODO com selection, sisx destination and file path user definable
|
//TODO com selection, sisx destination and file path user definable
|
||||||
m_adapter->setTrkServerName("COM5");
|
m_adapter->setTrkServerName("COM5");
|
||||||
const QString copySrc(m_baseFileName + ".sisx");
|
const QString copySrc(m_baseFileName + ".sisx");
|
||||||
@@ -546,6 +552,26 @@ void S60DeviceRunControl::signsisProcessFinished()
|
|||||||
m_adapter->startServer();
|
m_adapter->startServer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void S60DeviceRunControl::printCopyingNotice()
|
||||||
|
{
|
||||||
|
emit addToOutputWindow(this, tr("Copying install file to device..."));
|
||||||
|
}
|
||||||
|
|
||||||
|
void S60DeviceRunControl::printInstallingNotice()
|
||||||
|
{
|
||||||
|
emit addToOutputWindow(this, tr("Installing application..."));
|
||||||
|
}
|
||||||
|
|
||||||
|
void S60DeviceRunControl::printStartingNotice()
|
||||||
|
{
|
||||||
|
emit addToOutputWindow(this, tr("Starting..."));
|
||||||
|
}
|
||||||
|
|
||||||
|
void S60DeviceRunControl::printRunNotice(uint pid)
|
||||||
|
{
|
||||||
|
emit addToOutputWindow(this, tr("Application started with pid %1.").arg(pid));
|
||||||
|
}
|
||||||
|
|
||||||
void S60DeviceRunControl::runFinished()
|
void S60DeviceRunControl::runFinished()
|
||||||
{
|
{
|
||||||
m_adapter->deleteLater();
|
m_adapter->deleteLater();
|
||||||
|
@@ -149,6 +149,10 @@ private slots:
|
|||||||
void makesisProcessFinished();
|
void makesisProcessFinished();
|
||||||
void signsisProcessFailed();
|
void signsisProcessFailed();
|
||||||
void signsisProcessFinished();
|
void signsisProcessFinished();
|
||||||
|
void printCopyingNotice();
|
||||||
|
void printInstallingNotice();
|
||||||
|
void printStartingNotice();
|
||||||
|
void printRunNotice(uint pid);
|
||||||
void runFinished();
|
void runFinished();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -109,7 +109,6 @@ void Adapter::installAndRun()
|
|||||||
{
|
{
|
||||||
if (!m_installFileName.isEmpty()) {
|
if (!m_installFileName.isEmpty()) {
|
||||||
installRemotePackageSilently(m_installFileName);
|
installRemotePackageSilently(m_installFileName);
|
||||||
startInferiorIfNeeded();
|
|
||||||
} else {
|
} else {
|
||||||
startInferiorIfNeeded();
|
startInferiorIfNeeded();
|
||||||
}
|
}
|
||||||
@@ -477,10 +476,11 @@ void Adapter::handleCreateProcess(const TrkResult &result)
|
|||||||
m_session.tid = extractInt(data + 5);
|
m_session.tid = extractInt(data + 5);
|
||||||
m_session.codeseg = extractInt(data + 9);
|
m_session.codeseg = extractInt(data + 9);
|
||||||
m_session.dataseg = extractInt(data + 13);
|
m_session.dataseg = extractInt(data + 13);
|
||||||
qDebug() << " READ PID: " << m_session.pid;
|
logMessage(QString(" READ PID: %1").arg(m_session.pid));
|
||||||
qDebug() << " READ TID: " << m_session.tid;
|
logMessage(QString(" READ TID: %1").arg(m_session.tid));
|
||||||
qDebug() << " READ CODE: " << m_session.codeseg;
|
logMessage(QString(" READ CODE: %1").arg(m_session.codeseg));
|
||||||
qDebug() << " READ DATA: " << m_session.dataseg;
|
logMessage(QString(" READ DATA: %1").arg(m_session.dataseg));
|
||||||
|
emit applicationRunning(m_session.pid);
|
||||||
QByteArray ba;
|
QByteArray ba;
|
||||||
appendInt(&ba, m_session.pid);
|
appendInt(&ba, m_session.pid);
|
||||||
appendInt(&ba, m_session.tid);
|
appendInt(&ba, m_session.tid);
|
||||||
@@ -564,7 +564,7 @@ void Adapter::cleanUp()
|
|||||||
|
|
||||||
void Adapter::copyFileToRemote()
|
void Adapter::copyFileToRemote()
|
||||||
{
|
{
|
||||||
qDebug("Copying file");
|
emit copyingStarted();
|
||||||
QByteArray ba;
|
QByteArray ba;
|
||||||
appendByte(&ba, 0x10);
|
appendByte(&ba, 0x10);
|
||||||
appendString(&ba, m_copyDstFileName.toLocal8Bit(), TargetByteOrder, false);
|
appendString(&ba, m_copyDstFileName.toLocal8Bit(), TargetByteOrder, false);
|
||||||
@@ -573,18 +573,23 @@ void Adapter::copyFileToRemote()
|
|||||||
|
|
||||||
void Adapter::installRemotePackageSilently(const QString &fileName)
|
void Adapter::installRemotePackageSilently(const QString &fileName)
|
||||||
{
|
{
|
||||||
qDebug("Installing file");
|
emit installingStarted();
|
||||||
QByteArray ba;
|
QByteArray ba;
|
||||||
appendByte(&ba, 'C');
|
appendByte(&ba, 'C');
|
||||||
appendString(&ba, fileName.toLocal8Bit(), TargetByteOrder, false);
|
appendString(&ba, fileName.toLocal8Bit(), TargetByteOrder, false);
|
||||||
sendTrkMessage(TrkInstallFile, 0, ba);
|
sendTrkMessage(TrkInstallFile, CB(handleInstallPackageFinished), ba);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Adapter::handleInstallPackageFinished(const TrkResult &)
|
||||||
|
{
|
||||||
|
startInferiorIfNeeded();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Adapter::startInferiorIfNeeded()
|
void Adapter::startInferiorIfNeeded()
|
||||||
{
|
{
|
||||||
qDebug("Starting");
|
emit startingApplication();
|
||||||
if (m_session.pid != 0) {
|
if (m_session.pid != 0) {
|
||||||
qDebug() << "Process already 'started'";
|
logMessage("Process already 'started'");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// It's not started yet
|
// It's not started yet
|
||||||
|
@@ -62,6 +62,10 @@ public:
|
|||||||
bool startServer();
|
bool startServer();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
void copyingStarted();
|
||||||
|
void installingStarted();
|
||||||
|
void startingApplication();
|
||||||
|
void applicationRunning(uint pid);
|
||||||
void finished();
|
void finished();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
@@ -106,6 +110,7 @@ private:
|
|||||||
|
|
||||||
void handleFileCreation(const TrkResult &result);
|
void handleFileCreation(const TrkResult &result);
|
||||||
void handleFileCreated(const TrkResult &result);
|
void handleFileCreated(const TrkResult &result);
|
||||||
|
void handleInstallPackageFinished(const TrkResult &result);
|
||||||
void handleCpuType(const TrkResult &result);
|
void handleCpuType(const TrkResult &result);
|
||||||
void handleCreateProcess(const TrkResult &result);
|
void handleCreateProcess(const TrkResult &result);
|
||||||
void handleWaitForFinished(const TrkResult &result);
|
void handleWaitForFinished(const TrkResult &result);
|
||||||
|
Reference in New Issue
Block a user