forked from qt-creator/qt-creator
Progress bar for Launching for S60 sequence has been changed to behave like for other targets
Reviewed-by: Tobias Hunger
This commit is contained in:
@@ -660,13 +660,24 @@ bool S60DeviceRunControlBase::isRunning() const
|
|||||||
void S60DeviceRunControlBase::startLaunching()
|
void S60DeviceRunControlBase::startLaunching()
|
||||||
{
|
{
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
bool success = false;
|
if (setupLauncher(errorMessage)) {
|
||||||
do {
|
if (m_deployProgress)
|
||||||
|
m_deployProgress->setProgressValue(PROGRESS_MAX/2);
|
||||||
|
} else {
|
||||||
|
if (!errorMessage.isEmpty())
|
||||||
|
appendMessage(this, errorMessage, true);
|
||||||
|
stop();
|
||||||
|
emit finished();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool S60DeviceRunControlBase::setupLauncher(QString &errorMessage)
|
||||||
|
{
|
||||||
connect(SymbianUtils::SymbianDeviceManager::instance(), SIGNAL(deviceRemoved(const SymbianUtils::SymbianDevice)),
|
connect(SymbianUtils::SymbianDeviceManager::instance(), SIGNAL(deviceRemoved(const SymbianUtils::SymbianDevice)),
|
||||||
this, SLOT(deviceRemoved(SymbianUtils::SymbianDevice)));
|
this, SLOT(deviceRemoved(SymbianUtils::SymbianDevice)));
|
||||||
m_launcher = trk::Launcher::acquireFromDeviceManager(m_serialPortName, 0, &errorMessage);
|
m_launcher = trk::Launcher::acquireFromDeviceManager(m_serialPortName, 0, &errorMessage);
|
||||||
if (!m_launcher)
|
if (!m_launcher)
|
||||||
break;
|
return false;
|
||||||
|
|
||||||
connect(m_launcher, SIGNAL(finished()), this, SLOT(launcherFinished()));
|
connect(m_launcher, SIGNAL(finished()), this, SLOT(launcherFinished()));
|
||||||
connect(m_launcher, SIGNAL(canNotConnect(QString)), this, SLOT(printConnectFailed(QString)));
|
connect(m_launcher, SIGNAL(canNotConnect(QString)), this, SLOT(printConnectFailed(QString)));
|
||||||
@@ -676,27 +687,21 @@ void S60DeviceRunControlBase::startLaunching()
|
|||||||
|
|
||||||
if (!m_commandLineArguments.isEmpty())
|
if (!m_commandLineArguments.isEmpty())
|
||||||
m_launcher->setCommandLineArgs(m_commandLineArguments);
|
m_launcher->setCommandLineArgs(m_commandLineArguments);
|
||||||
|
|
||||||
const QString runFileName = QString::fromLatin1("%1:\\sys\\bin\\%2.exe").arg(m_installationDrive).arg(m_targetName);
|
const QString runFileName = QString::fromLatin1("%1:\\sys\\bin\\%2.exe").arg(m_installationDrive).arg(m_targetName);
|
||||||
initLauncher(runFileName, m_launcher);
|
initLauncher(runFileName, m_launcher);
|
||||||
const trk::PromptStartCommunicationResult src =
|
const trk::PromptStartCommunicationResult src =
|
||||||
S60RunConfigBluetoothStarter::startCommunication(m_launcher->trkDevice(),
|
S60RunConfigBluetoothStarter::startCommunication(m_launcher->trkDevice(),
|
||||||
0, &errorMessage);
|
0, &errorMessage);
|
||||||
if (src != trk::PromptStartCommunicationConnected)
|
if (src != trk::PromptStartCommunicationConnected)
|
||||||
break;
|
return false;
|
||||||
|
|
||||||
if (!m_launcher->startServer(&errorMessage)) {
|
if (!m_launcher->startServer(&errorMessage)) {
|
||||||
errorMessage = tr("Could not connect to phone on port '%1': %2\n"
|
errorMessage = tr("Could not connect to phone on port '%1': %2\n"
|
||||||
"Check if the phone is connected and App TRK is running.").arg(m_serialPortName, errorMessage);
|
"Check if the phone is connected and App TRK is running.").arg(m_serialPortName, errorMessage);
|
||||||
break;
|
return false;
|
||||||
}
|
|
||||||
success = true;
|
|
||||||
} while (false);
|
|
||||||
|
|
||||||
if (!success) {
|
|
||||||
if (!errorMessage.isEmpty())
|
|
||||||
appendMessage(this, errorMessage, true);
|
|
||||||
stop();
|
|
||||||
emit finished();
|
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void S60DeviceRunControlBase::printConnectFailed(const QString &errorMessage)
|
void S60DeviceRunControlBase::printConnectFailed(const QString &errorMessage)
|
||||||
@@ -799,8 +804,8 @@ S60DeviceRunControl::S60DeviceRunControl(ProjectExplorer::RunConfiguration *runC
|
|||||||
void S60DeviceRunControl::initLauncher(const QString &executable, trk::Launcher *launcher)
|
void S60DeviceRunControl::initLauncher(const QString &executable, trk::Launcher *launcher)
|
||||||
{
|
{
|
||||||
connect(launcher, SIGNAL(startingApplication()), this, SLOT(printStartingNotice()));
|
connect(launcher, SIGNAL(startingApplication()), this, SLOT(printStartingNotice()));
|
||||||
connect(launcher, SIGNAL(applicationRunning(uint)), this, SLOT(printRunNotice(uint)));
|
connect(launcher, SIGNAL(applicationRunning(uint)), this, SLOT(applicationRunNotice(uint)));
|
||||||
connect(launcher, SIGNAL(canNotRun(QString)), this, SLOT(printRunFailNotice(QString)));
|
connect(launcher, SIGNAL(canNotRun(QString)), this, SLOT(applicationRunFailedNotice(QString)));
|
||||||
connect(launcher, SIGNAL(applicationOutputReceived(QString)), this, SLOT(printApplicationOutput(QString)));
|
connect(launcher, SIGNAL(applicationOutputReceived(QString)), this, SLOT(printApplicationOutput(QString)));
|
||||||
launcher->addStartupActions(trk::Launcher::ActionRun);
|
launcher->addStartupActions(trk::Launcher::ActionRun);
|
||||||
launcher->setFileName(executable);
|
launcher->setFileName(executable);
|
||||||
@@ -817,12 +822,15 @@ void S60DeviceRunControl::printStartingNotice()
|
|||||||
emit appendMessage(this, tr("Starting application..."), false);
|
emit appendMessage(this, tr("Starting application..."), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void S60DeviceRunControl::printRunNotice(uint pid)
|
void S60DeviceRunControl::applicationRunNotice(uint pid)
|
||||||
{
|
{
|
||||||
emit appendMessage(this, tr("Application running with pid %1.").arg(pid), false);
|
emit appendMessage(this, tr("Application running with pid %1.").arg(pid), false);
|
||||||
|
if (m_deployProgress)
|
||||||
|
m_deployProgress->setProgressValue(PROGRESS_MAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
void S60DeviceRunControl::printRunFailNotice(const QString &errorMessage) {
|
void S60DeviceRunControl::applicationRunFailedNotice(const QString &errorMessage)
|
||||||
|
{
|
||||||
emit appendMessage(this, tr("Could not start application: %1").arg(errorMessage), true);
|
emit appendMessage(this, tr("Could not start application: %1").arg(errorMessage), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -183,6 +183,7 @@ protected slots:
|
|||||||
void printApplicationOutput(const QString &output, bool onStdErr);
|
void printApplicationOutput(const QString &output, bool onStdErr);
|
||||||
void printApplicationOutput(const QString &output);
|
void printApplicationOutput(const QString &output);
|
||||||
void deviceRemoved(const SymbianUtils::SymbianDevice &);
|
void deviceRemoved(const SymbianUtils::SymbianDevice &);
|
||||||
|
void reportDeployFinished();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void processStopped(uint pc, uint pid, uint tid, const QString& reason);
|
void processStopped(uint pc, uint pid, uint tid, const QString& reason);
|
||||||
@@ -190,10 +191,13 @@ private slots:
|
|||||||
void launcherFinished();
|
void launcherFinished();
|
||||||
void slotLauncherStateChanged(int);
|
void slotLauncherStateChanged(int);
|
||||||
void slotWaitingForTrkClosed();
|
void slotWaitingForTrkClosed();
|
||||||
void reportDeployFinished();
|
|
||||||
|
protected:
|
||||||
|
QFutureInterface<void> *m_deployProgress;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void startLaunching();
|
void startLaunching();
|
||||||
|
bool setupLauncher(QString &errorMessage);
|
||||||
|
|
||||||
ProjectExplorer::ToolChain::ToolChainType m_toolChain;
|
ProjectExplorer::ToolChain::ToolChainType m_toolChain;
|
||||||
QString m_serialPortName;
|
QString m_serialPortName;
|
||||||
@@ -205,7 +209,6 @@ private:
|
|||||||
QString m_qtBinPath;
|
QString m_qtBinPath;
|
||||||
bool m_releaseDeviceAfterLauncherFinish;
|
bool m_releaseDeviceAfterLauncherFinish;
|
||||||
bool m_handleDeviceRemoval;
|
bool m_handleDeviceRemoval;
|
||||||
QFutureInterface<void> *m_deployProgress;
|
|
||||||
trk::Launcher *m_launcher;
|
trk::Launcher *m_launcher;
|
||||||
char m_installationDrive;
|
char m_installationDrive;
|
||||||
};
|
};
|
||||||
@@ -223,8 +226,8 @@ protected:
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void printStartingNotice();
|
void printStartingNotice();
|
||||||
void printRunNotice(uint pid);
|
void applicationRunNotice(uint pid);
|
||||||
void printRunFailNotice(const QString &errorMessage);
|
void applicationRunFailedNotice(const QString &errorMessage);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user