connect(m_launcher, SIGNAL(canNotCreateFile(QString,QString)), this, SLOT(printCreateFileFailed(QString,QString)));
connect(m_launcher, SIGNAL(canNotWriteFile(QString,QString)), this, SLOT(printWriteFileFailed(QString,QString)));
connect(m_launcher, SIGNAL(installingStarted()), this, SLOT(printInstallingNotice()));
+ connect(m_launcher, SIGNAL(canNotInstall(QString,QString)), this, SLOT(printInstallFailed(QString,QString)));
connect(m_launcher, SIGNAL(copyProgress(int)), this, SLOT(printCopyProgress(int)));
//TODO sisx destination and file path user definable
emit addToOutputWindow(this, tr("Installing application..."));
}
+void S60DeviceRunControlBase::printInstallFailed(const QString &filename, const QString &errorMessage)
+{
+ emit addToOutputWindow(this, tr("Could not install from package %1 on device: %2").arg(filename, errorMessage));
+}
+
void S60DeviceRunControlBase::launcherFinished()
{
m_launcher->deleteLater();
void printWriteFileFailed(const QString &filename, const QString &errorMessage);
void printCopyProgress(int progress);
void printInstallingNotice();
+ void printInstallFailed(const QString &filename, const QString &errorMessage);
void launcherFinished();
private:
if (d->m_startupActions & ActionCopy)
copyFileToRemote();
else if (d->m_startupActions & ActionInstall)
- installRemotePackageSilently(d->m_installFileName);
+ installRemotePackageSilently();
else if (d->m_startupActions & ActionRun)
startInferiorIfNeeded();
return true;
{
Q_UNUSED(result)
if (d->m_startupActions & ActionInstall)
- installRemotePackageSilently(d->m_installFileName);
+ installRemotePackageSilently();
else if (d->m_startupActions & ActionRun)
startInferiorIfNeeded();
else
d->m_device.sendTrkMessage(TrkOpenFile, TrkCallback(this, &Launcher::handleFileCreation), ba);
}
-void Launcher::installRemotePackageSilently(const QString &fileName)
+void Launcher::installRemotePackageSilently()
{
emit installingStarted();
QByteArray ba;
appendByte(&ba, 'C');
- appendString(&ba, fileName.toLocal8Bit(), TargetByteOrder, false);
+ appendString(&ba, d->m_installFileName.toLocal8Bit(), TargetByteOrder, false);
d->m_device.sendTrkMessage(TrkInstallFile, TrkCallback(this, &Launcher::handleInstallPackageFinished), ba);
}
-void Launcher::handleInstallPackageFinished(const TrkResult &)
+void Launcher::handleInstallPackageFinished(const TrkResult &result)
{
- if (d->m_startupActions & ActionRun)
+ if (result.errorCode()) {
+ emit canNotInstall(d->m_installFileName, result.errorString());
+ emit finished();
+ } else if (d->m_startupActions & ActionRun) {
startInferiorIfNeeded();
- else
+ } else {
emit finished();
+ }
}
void Launcher::startInferiorIfNeeded()
void canNotCreateFile(const QString &filename, const QString &errorMessage);
void canNotWriteFile(const QString &filename, const QString &errorMessage);
void installingStarted();
+ void canNotInstall(const QString &packageFilename, const QString &errorMessage);
void startingApplication();
void applicationRunning(uint pid);
void canNotRun(const QString &errorMessage);
void waitForTrkFinished(const TrkResult &data);
void copyFileToRemote();
- void installRemotePackageSilently(const QString &filename);
+ void installRemotePackageSilently();
void startInferiorIfNeeded();
void logMessage(const QString &msg);