forked from qt-creator/qt-creator
Use launcher class.
This commit is contained in:
@@ -18,4 +18,6 @@ SUPPORT_QT_S60 = $$(QTCREATOR_WITH_S60)
|
||||
$$PWD/s60devicerunconfiguration.h
|
||||
FORMS += $$PWD/s60devicespreferencepane.ui
|
||||
OTHER_FILES += $$PWD/qt-s60-todo.txt
|
||||
|
||||
include($$PWD/../../../../tests/manual/trk/trklauncher.pri) || error("could not include trklauncher.pri")
|
||||
}
|
||||
|
@@ -431,15 +431,6 @@ S60DeviceRunControl::S60DeviceRunControl(QSharedPointer<RunConfiguration> runCon
|
||||
this, SLOT(signsisProcessFailed()));
|
||||
connect(m_signsis, SIGNAL(finished(int,QProcess::ExitStatus)),
|
||||
this, SLOT(signsisProcessFinished()));
|
||||
m_run = new QProcess(this);
|
||||
connect(m_run, SIGNAL(readyReadStandardError()),
|
||||
this, SLOT(readStandardError()));
|
||||
connect(m_run, SIGNAL(readyReadStandardOutput()),
|
||||
this, SLOT(readStandardOutput()));
|
||||
connect(m_run, SIGNAL(error(QProcess::ProcessError)),
|
||||
this, SLOT(runProcessFailed()));
|
||||
connect(m_run, SIGNAL(finished(int,QProcess::ExitStatus)),
|
||||
this, SLOT(runProcessFinished()));
|
||||
}
|
||||
|
||||
void S60DeviceRunControl::start()
|
||||
@@ -480,7 +471,7 @@ void S60DeviceRunControl::stop()
|
||||
{
|
||||
m_makesis->kill();
|
||||
m_signsis->kill();
|
||||
m_run->kill();
|
||||
//m_adapter->terminate();
|
||||
}
|
||||
|
||||
bool S60DeviceRunControl::isRunning() const
|
||||
@@ -542,27 +533,22 @@ void S60DeviceRunControl::signsisProcessFinished()
|
||||
emit finished();
|
||||
return;
|
||||
}
|
||||
QString trklauncher = QApplication::applicationDirPath() + "/../tests/manual/trk/debug/trklauncher.exe";
|
||||
QStringList arguments;
|
||||
//TODO
|
||||
m_adapter = new trk::Adapter;
|
||||
connect(m_adapter, SIGNAL(finished()), this, SLOT(runFinished()));
|
||||
//TODO com selection, sisx destination and file path user definable
|
||||
arguments << "COM5" << "-I" << (m_baseFileName + ".sisx")
|
||||
<< QString("C:\\Data\\%1.sisx").arg(QFileInfo(m_baseFileName).fileName())
|
||||
<< QString("C:\\sys\\bin\\%1.exe").arg(m_targetName);
|
||||
emit addToOutputWindow(this, tr("%1 %2").arg(QDir::toNativeSeparators(trklauncher), arguments.join(tr(" "))));
|
||||
m_run->start(trklauncher, arguments, QIODevice::ReadOnly);
|
||||
m_adapter->setTrkServerName("COM5");
|
||||
const QString copySrc(m_baseFileName + ".sisx");
|
||||
const QString copyDst = QString("C:\\Data\\%1.sisx").arg(QFileInfo(m_baseFileName).fileName());
|
||||
const QString runFileName = QString("C:\\sys\\bin\\%1.exe").arg(m_targetName);
|
||||
m_adapter->setCopyFileName(copySrc, copyDst);
|
||||
m_adapter->setInstallFileName(copyDst);
|
||||
m_adapter->setFileName(runFileName);
|
||||
m_adapter->startServer();
|
||||
}
|
||||
|
||||
void S60DeviceRunControl::runProcessFailed()
|
||||
void S60DeviceRunControl::runFinished()
|
||||
{
|
||||
processFailed("trklauncher", m_run->error());
|
||||
error(this, tr("Did you compile the trklauncher application in tests\\manual\\trk ?"));
|
||||
}
|
||||
|
||||
void S60DeviceRunControl::runProcessFinished()
|
||||
{
|
||||
if (m_run->exitCode() != 0) {
|
||||
error(this, tr("An error occurred while starting the application."));
|
||||
}
|
||||
emit addToOutputWindow(this, tr("Finished."));
|
||||
emit finished();
|
||||
}
|
||||
|
@@ -30,6 +30,8 @@
|
||||
#ifndef S60DEVICERUNCONFIGURATION_H
|
||||
#define S60DEVICERUNCONFIGURATION_H
|
||||
|
||||
#include "launcher.h"
|
||||
|
||||
#include <projectexplorer/runconfiguration.h>
|
||||
|
||||
#include <QtCore/QProcess>
|
||||
@@ -147,8 +149,7 @@ private slots:
|
||||
void makesisProcessFinished();
|
||||
void signsisProcessFailed();
|
||||
void signsisProcessFinished();
|
||||
void runProcessFailed();
|
||||
void runProcessFinished();
|
||||
void runFinished();
|
||||
|
||||
private:
|
||||
void processFailed(const QString &program, QProcess::ProcessError errorCode);
|
||||
@@ -163,7 +164,7 @@ private:
|
||||
QString m_customKeyPath;
|
||||
QProcess *m_makesis;
|
||||
QProcess *m_signsis;
|
||||
QProcess *m_run;
|
||||
trk::Adapter *m_adapter;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
@@ -112,7 +112,7 @@ void Adapter::installAndRun()
|
||||
}
|
||||
void Adapter::logMessage(const QString &msg)
|
||||
{
|
||||
if (DEBUG)
|
||||
if (DEBUG_TRK)
|
||||
qDebug() << "ADAPTER: " << qPrintable(msg);
|
||||
}
|
||||
|
||||
|
@@ -1,5 +1,7 @@
|
||||
win32:DEFINES += USE_NATIVE
|
||||
SOURCES = $$PWD/launcher.cpp \
|
||||
DEFINES += DEBUG_TRK=0
|
||||
INCLUDEPATH *= $$PWD
|
||||
SOURCES += $$PWD/launcher.cpp \
|
||||
$$PWD/trkutils.cpp
|
||||
HEADERS = $$PWD/trkutils.h \
|
||||
HEADERS += $$PWD/trkutils.h \
|
||||
$$PWD/launcher.h
|
||||
|
@@ -3,6 +3,6 @@ QT = core \
|
||||
network
|
||||
QT -= gui
|
||||
include($$PWD/trklauncher.pri)
|
||||
DEFINES += DEBUG=0
|
||||
DEFINES += DEBUG_TRK=1
|
||||
win32:CONFIG += console
|
||||
SOURCES += main_launcher.cpp
|
||||
|
Reference in New Issue
Block a user