runcontrols: use ProjectExplorrer::OutputFormat for format selection

This commit is contained in:
hjk
2011-01-07 14:52:18 +01:00
parent edf33c56e1
commit ef806894e8
18 changed files with 140 additions and 148 deletions

View File

@@ -543,19 +543,21 @@ void S60DeviceRunControl::start()
emit started();
if (m_serialPortName.isEmpty()) {
m_launchProgress->reportCanceled();
appendMessage(this, tr("No device is connected. Please connect a device and try again."), true);
QString msg = tr("No device is connected. Please connect a device and try again.");
appendMessage(this, msg, NormalMessageFormat);
emit finished();
return;
}
emit appendMessage(this, tr("Executable file: %1").arg(msgListFile(m_executableFileName)), false);
emit appendMessage(this, tr("Executable file: %1").arg(msgListFile(m_executableFileName)),
NormalMessageFormat);
QString errorMessage;
QString settingsCategory;
QString settingsPage;
if (!checkConfiguration(&errorMessage, &settingsCategory, &settingsPage)) {
m_launchProgress->reportCanceled();
appendMessage(this, errorMessage, true);
appendMessage(this, errorMessage, ErrorMessageFormat);
emit finished();
Core::ICore::instance()->showWarningWithOptions(tr("Debugger for Symbian Platform"),
errorMessage, QString(),
@@ -588,7 +590,7 @@ void S60DeviceRunControl::startLaunching()
m_launchProgress->setProgressValue(PROGRESS_MAX/2);
} else {
if (!errorMessage.isEmpty())
appendMessage(this, errorMessage, true);
appendMessage(this, errorMessage, ErrorMessageFormat);
stop();
emit finished();
}
@@ -629,7 +631,8 @@ bool S60DeviceRunControl::setupLauncher(QString &errorMessage)
void S60DeviceRunControl::printConnectFailed(const QString &errorMessage)
{
emit appendMessage(this, tr("Could not connect to App TRK on device: %1. Restarting App TRK might help.").arg(errorMessage), true);
emit appendMessage(this, tr("Could not connect to App TRK on device: %1. Restarting App TRK might help.").arg(errorMessage),
ErrorMessageFormat);
}
void S60DeviceRunControl::launcherFinished()
@@ -651,7 +654,7 @@ void S60DeviceRunControl::reportDeployFinished()
void S60DeviceRunControl::processStopped(uint pc, uint pid, uint tid, const QString &reason)
{
emit addToOutputWindow(this, trk::Launcher::msgStopped(pid, tid, pc, reason), false, false);
appendMessage(this, trk::Launcher::msgStopped(pid, tid, pc, reason), StdOutFormat);
m_launcher->terminate();
}
@@ -682,7 +685,7 @@ void S60DeviceRunControl::slotWaitingForTrkClosed()
{
if (m_launcher && m_launcher->state() == trk::Launcher::WaitingForTrk) {
stop();
appendMessage(this, tr("Canceled."), true);
appendMessage(this, tr("Canceled."), ErrorMessageFormat);
emit finished();
}
}
@@ -694,7 +697,7 @@ void S60DeviceRunControl::printApplicationOutput(const QString &output)
void S60DeviceRunControl::printApplicationOutput(const QString &output, bool onStdErr)
{
emit addToOutputWindow(this, output, onStdErr, true);
appendMessage(this, output, onStdErr ? StdErrFormat : StdOutFormat);
}
void S60DeviceRunControl::deviceRemoved(const SymbianUtils::SymbianDevice &d)
@@ -703,7 +706,8 @@ void S60DeviceRunControl::deviceRemoved(const SymbianUtils::SymbianDevice &d)
trk::Launcher::releaseToDeviceManager(m_launcher);
m_launcher->deleteLater();
m_launcher = 0;
appendMessage(this, tr("The device '%1' has been disconnected").arg(d.friendlyName()), true);
QString msg = tr("The device '%1' has been disconnected").arg(d.friendlyName());
appendMessage(this, msg, ErrorMessageFormat);
emit finished();
}
}
@@ -728,24 +732,24 @@ void S60DeviceRunControl::initLauncher(const QString &executable, trk::Launcher
void S60DeviceRunControl::handleLauncherFinished()
{
emit finished();
emit appendMessage(this, tr("Finished."), false);
emit appendMessage(this, tr("Finished."), NormalMessageFormat);
}
void S60DeviceRunControl::printStartingNotice()
{
emit appendMessage(this, tr("Starting application..."), false);
emit appendMessage(this, tr("Starting application..."), NormalMessageFormat);
}
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), NormalMessageFormat);
if (m_launchProgress)
m_launchProgress->setProgressValue(PROGRESS_MAX);
}
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), NormalMessageFormat);
}
// ======== S60DeviceDebugRunControl
@@ -810,7 +814,7 @@ S60DeviceDebugRunControl::S60DeviceDebugRunControl(S60DeviceRunConfiguration *rc
if (startParameters().symbolFileName.isEmpty()) {
const QString msg = tr("Warning: Cannot locate the symbol file belonging to %1.").
arg(localExecutable(rc));
emit appendMessage(this, msg, true);
emit appendMessage(this, msg, ErrorMessageFormat);
}
}
@@ -821,7 +825,7 @@ void S60DeviceDebugRunControl::start()
QString settingsPage;
if (!Debugger::DebuggerRunControl::checkDebugConfiguration(startParameters().toolChainType,
&errorMessage, &settingsCategory, &settingsPage)) {
appendMessage(this, errorMessage, true);
appendMessage(this, errorMessage, ErrorMessageFormat);
emit finished();
Core::ICore::instance()->showWarningWithOptions(tr("Debugger for Symbian Platform"),
errorMessage, QString(),
@@ -829,6 +833,6 @@ void S60DeviceDebugRunControl::start()
return;
}
emit appendMessage(this, tr("Launching debugger..."), false);
emit appendMessage(this, tr("Launching debugger..."), NormalMessageFormat);
Debugger::DebuggerRunControl::start();
}