diff options
author | Erik Verbruggen <erik.verbruggen@nokia.com> | 2010-04-19 14:21:33 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@nokia.com> | 2010-04-19 14:21:48 +0200 |
commit | e3bceff3ee46af6e11cd15e635cabe4eb01f1a1d (patch) | |
tree | 4877fa3c050700e86b7545ed0b9035986c8d0357 /src/plugins | |
parent | 53425816af45809b4a23216ed49fc1e022206a52 (diff) | |
download | qt-creator-e3bceff3ee46af6e11cd15e635cabe4eb01f1a1d.tar.gz |
Separated child-process stdout/stderr, and seperated "our" output/errors.
So now the "Applciation Output" can distinguish between these four, and
handle them appropriately.
Diffstat (limited to 'src/plugins')
32 files changed, 205 insertions, 171 deletions
diff --git a/src/plugins/debugger/cdb/cdbdebugengine.cpp b/src/plugins/debugger/cdb/cdbdebugengine.cpp index 493c78b331..d5a72cf454 100644 --- a/src/plugins/debugger/cdb/cdbdebugengine.cpp +++ b/src/plugins/debugger/cdb/cdbdebugengine.cpp @@ -221,8 +221,8 @@ CdbDebugEngine::CdbDebugEngine(DebuggerManager *manager, const QSharedPointer<Cd m_d(new CdbDebugEnginePrivate(manager, options, this)) { m_d->m_consoleStubProc.setMode(Utils::ConsoleProcess::Suspend); - connect(&m_d->m_consoleStubProc, SIGNAL(processError(QString)), - this, SLOT(slotConsoleStubError(QString))); + connect(&m_d->m_consoleStubProc, SIGNAL(processMessage(QString,bool)), + this, SLOT(slotConsoleStubMessage(QString, bool))); connect(&m_d->m_consoleStubProc, SIGNAL(processStarted()), this, SLOT(slotConsoleStubStarted())); connect(&m_d->m_consoleStubProc, SIGNAL(wrapperStopped()), @@ -1232,7 +1232,7 @@ void CdbDebugEngine::slotConsoleStubStarted() } } -void CdbDebugEngine::slotConsoleStubError(const QString &msg) +void CdbDebugEngine::slotConsoleStubMessage(const QString &msg, bool) { QMessageBox::critical(DebuggerUISwitcher::instance()->mainWindow(), tr("Debugger Error"), msg); } diff --git a/src/plugins/debugger/cdb/cdbdebugengine.h b/src/plugins/debugger/cdb/cdbdebugengine.h index d413e86953..e15d5e93e1 100644 --- a/src/plugins/debugger/cdb/cdbdebugengine.h +++ b/src/plugins/debugger/cdb/cdbdebugengine.h @@ -106,7 +106,7 @@ public slots: private slots: void slotConsoleStubStarted(); - void slotConsoleStubError(const QString &msg); + void slotConsoleStubMessage(const QString &msg, bool); void slotConsoleStubTerminated(); void slotBreakAttachToCrashed(); void warning(const QString &w); diff --git a/src/plugins/debugger/debuggermanager.cpp b/src/plugins/debugger/debuggermanager.cpp index 76a60d09a0..fb25b1a824 100644 --- a/src/plugins/debugger/debuggermanager.cpp +++ b/src/plugins/debugger/debuggermanager.cpp @@ -821,9 +821,9 @@ void DebuggerManager::notifyInferiorPidChanged(qint64 pid) } } -void DebuggerManager::showApplicationOutput(const QString &str) +void DebuggerManager::showApplicationOutput(const QString &str, bool onStdErr) { - emit applicationOutputAvailable(str); + emit applicationOutputAvailable(str, onStdErr); } void DebuggerManager::shutdown() diff --git a/src/plugins/debugger/debuggermanager.h b/src/plugins/debugger/debuggermanager.h index 4e4657a748..bd7fa15550 100644 --- a/src/plugins/debugger/debuggermanager.h +++ b/src/plugins/debugger/debuggermanager.h @@ -264,7 +264,7 @@ public slots: // FIXME //private slots: // FIXME void showDebuggerOutput(int channel, const QString &msg); void showDebuggerInput(int channel, const QString &msg); - void showApplicationOutput(const QString &data); + void showApplicationOutput(const QString &data, bool onStdErr); void reloadSourceFiles(); void sourceFilesDockToggled(bool on); @@ -329,7 +329,8 @@ signals: void inferiorPidChanged(qint64 pid); void stateChanged(int newstatus); void statusMessageRequested(const QString &msg, int timeout); // -1 for 'forever' - void applicationOutputAvailable(const QString &output); + void applicationOutputAvailable(const QString &output, bool onStdErr); + void messageAvailable(const QString &output, bool isError); void emitShowOutput(int channel, const QString &output); void emitShowInput(int channel, const QString &input); diff --git a/src/plugins/debugger/debuggerrunner.cpp b/src/plugins/debugger/debuggerrunner.cpp index bf2eb5874e..c69b32aca7 100644 --- a/src/plugins/debugger/debuggerrunner.cpp +++ b/src/plugins/debugger/debuggerrunner.cpp @@ -179,9 +179,11 @@ void DebuggerRunControl::init() connect(m_manager, SIGNAL(debuggingFinished()), this, SLOT(debuggingFinished()), Qt::QueuedConnection); - connect(m_manager, SIGNAL(applicationOutputAvailable(QString)), - this, SLOT(slotAddToOutputWindowInline(QString)), + connect(m_manager, SIGNAL(applicationOutputAvailable(QString, bool)), + this, SLOT(slotAddToOutputWindowInline(QString, bool)), Qt::QueuedConnection); + connect(m_manager, SIGNAL(messageAvailable(QString, bool)), + this, SLOT(slotMessageAvailable(QString, bool))); connect(m_manager, SIGNAL(inferiorPidChanged(qint64)), this, SLOT(bringApplicationToForeground(qint64)), Qt::QueuedConnection); @@ -200,7 +202,7 @@ void DebuggerRunControl::start() m_manager->startNewDebugger(m_startParameters); emit started(); } else { - error(this, errorMessage); + appendMessage(this, errorMessage, true); emit finished(); Core::ICore::instance()->showWarningWithOptions(tr("Debugger"), errorMessage, QString(), @@ -208,9 +210,15 @@ void DebuggerRunControl::start() } } -void DebuggerRunControl::slotAddToOutputWindowInline(const QString &data) +void DebuggerRunControl::slotAddToOutputWindowInline(const QString &data, + bool onStdErr) { - emit addToOutputWindowInline(this, data); + emit addToOutputWindowInline(this, data, onStdErr); +} + +void DebuggerRunControl::slotMessageAvailable(const QString &data, bool isError) +{ + emit appendMessage(this, data, isError); } void DebuggerRunControl::stop() diff --git a/src/plugins/debugger/debuggerrunner.h b/src/plugins/debugger/debuggerrunner.h index d12e70938f..41b4166c0d 100644 --- a/src/plugins/debugger/debuggerrunner.h +++ b/src/plugins/debugger/debuggerrunner.h @@ -87,7 +87,8 @@ signals: void stopRequested(); private slots: - void slotAddToOutputWindowInline(const QString &output); + void slotAddToOutputWindowInline(const QString &output, bool onStdErr); + void slotMessageAvailable(const QString &data, bool isError); private: void init(); diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index fec4766adc..ef7d837aba 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -329,8 +329,8 @@ static void dump(const char *first, const char *middle, const QString & to) void GdbEngine::readDebugeeOutput(const QByteArray &data) { - m_manager->showApplicationOutput(m_outputCodec->toUnicode( - data.constData(), data.length(), &m_outputCodecState)); + m_manager->messageAvailable(m_outputCodec->toUnicode( + data.constData(), data.length(), &m_outputCodecState), true); } void GdbEngine::debugMessage(const QString &msg) @@ -541,7 +541,7 @@ void GdbEngine::handleResponse(const QByteArray &buff) // On Windows, the contents seem to depend on the debugger // version and/or OS version used. if (data.startsWith("warning:")) - manager()->showApplicationOutput(_(data.mid(9))); // cut "warning: " + manager()->messageAvailable(_(data.mid(9)), true); // cut "warning: " break; } diff --git a/src/plugins/debugger/gdb/termgdbadapter.cpp b/src/plugins/debugger/gdb/termgdbadapter.cpp index 8093b4b8f4..ddb95c5559 100644 --- a/src/plugins/debugger/gdb/termgdbadapter.cpp +++ b/src/plugins/debugger/gdb/termgdbadapter.cpp @@ -59,7 +59,7 @@ TermGdbAdapter::TermGdbAdapter(GdbEngine *engine, QObject *parent) m_stubProc.setSettings(Core::ICore::instance()->settings()); #endif - connect(&m_stubProc, SIGNAL(processError(QString)), SLOT(stubError(QString))); + connect(&m_stubProc, SIGNAL(processMessage(QString, bool)), SLOT(stubMessage(QString, bool))); connect(&m_stubProc, SIGNAL(processStarted()), SLOT(handleInferiorStarted())); connect(&m_stubProc, SIGNAL(wrapperStopped()), SLOT(stubExited())); } @@ -165,7 +165,7 @@ void TermGdbAdapter::interruptInferior() debugMessage(_("CANNOT INTERRUPT %1").arg(attachedPID)); } -void TermGdbAdapter::stubError(const QString &msg) +void TermGdbAdapter::stubMessage(const QString &msg, bool) { showMessageBox(QMessageBox::Critical, tr("Debugger Error"), msg); } diff --git a/src/plugins/debugger/gdb/termgdbadapter.h b/src/plugins/debugger/gdb/termgdbadapter.h index 88792dd554..1e05cbdd0b 100644 --- a/src/plugins/debugger/gdb/termgdbadapter.h +++ b/src/plugins/debugger/gdb/termgdbadapter.h @@ -66,7 +66,7 @@ private: Q_SLOT void handleInferiorStarted(); Q_SLOT void stubExited(); - Q_SLOT void stubError(const QString &msg); + Q_SLOT void stubMessage(const QString &msg, bool isError); Utils::ConsoleProcess m_stubProc; }; diff --git a/src/plugins/projectexplorer/applicationlauncher.h b/src/plugins/projectexplorer/applicationlauncher.h index da69425500..4cf82eeba7 100644 --- a/src/plugins/projectexplorer/applicationlauncher.h +++ b/src/plugins/projectexplorer/applicationlauncher.h @@ -70,19 +70,20 @@ public: qint64 applicationPID() const; signals: - void applicationError(const QString &error); - void appendOutput(const QString &line); + void appendMessage(const QString &message, bool isError); + void appendOutput(const QString &line, bool onStdErr); void processExited(int exitCode); void bringToForegroundRequested(qint64 pid); private slots: void processStopped(); #ifdef Q_OS_WIN - void readWinDebugOutput(const QString &output); + void readWinDebugOutput(const QString &output, bool onStdErr); void processFinished(int exitCode); #else void guiProcessError(); void readStandardOutput(); + void readStandardError(); void processDone(int, QProcess::ExitStatus); #endif diff --git a/src/plugins/projectexplorer/applicationlauncher_win.cpp b/src/plugins/projectexplorer/applicationlauncher_win.cpp index 6ad6f56075..cd08212893 100644 --- a/src/plugins/projectexplorer/applicationlauncher_win.cpp +++ b/src/plugins/projectexplorer/applicationlauncher_win.cpp @@ -43,16 +43,16 @@ ApplicationLauncher::ApplicationLauncher(QObject *parent) m_currentMode = Gui; m_consoleProcess = new ConsoleProcess(this); - connect(m_consoleProcess, SIGNAL(processError(const QString&)), - this, SIGNAL(applicationError(const QString&))); + connect(m_consoleProcess, SIGNAL(processMessage(const QString&, bool)), + this, SIGNAL(appendMessage(QString,bool))); connect(m_consoleProcess, SIGNAL(processStopped()), this, SLOT(processStopped())); m_winGuiProcess = new WinGuiProcess(this); - connect(m_winGuiProcess, SIGNAL(processError(const QString&)), - this, SIGNAL(applicationError(const QString&))); - connect(m_winGuiProcess, SIGNAL(receivedDebugOutput(const QString&)), - this, SLOT(readWinDebugOutput(const QString&))); + connect(m_winGuiProcess, SIGNAL(processMessage(const QString &, bool)), + this, SIGNAL(appendMessage(QString,bool))); + connect(m_winGuiProcess, SIGNAL(receivedDebugOutput(const QString&, bool)), + this, SLOT(readWinDebugOutput(const QString&, bool))); connect(m_winGuiProcess, SIGNAL(processFinished(int)), this, SLOT(processFinished(int))); @@ -111,9 +111,10 @@ qint64 ApplicationLauncher::applicationPID() const return result; } -void ApplicationLauncher::readWinDebugOutput(const QString &output) +void ApplicationLauncher::readWinDebugOutput(const QString &output, + bool onStdErr) { - emit appendOutput(output); + emit appendOutput(output, onStdErr); } void ApplicationLauncher::processStopped() diff --git a/src/plugins/projectexplorer/applicationlauncher_x11.cpp b/src/plugins/projectexplorer/applicationlauncher_x11.cpp index 0f41423f2f..cf15d0c3b2 100644 --- a/src/plugins/projectexplorer/applicationlauncher_x11.cpp +++ b/src/plugins/projectexplorer/applicationlauncher_x11.cpp @@ -43,11 +43,13 @@ ApplicationLauncher::ApplicationLauncher(QObject *parent) m_outputCodec = QTextCodec::codecForLocale(); m_currentMode = Gui; m_guiProcess = new QProcess(this); - m_guiProcess->setReadChannelMode(QProcess::MergedChannels); + m_guiProcess->setReadChannelMode(QProcess::SeparateChannels); connect(m_guiProcess, SIGNAL(error(QProcess::ProcessError)), this, SLOT(guiProcessError())); connect(m_guiProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(readStandardOutput())); + connect(m_guiProcess, SIGNAL(readyReadStandardError()), + this, SLOT(readStandardError())); connect(m_guiProcess, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(processDone(int, QProcess::ExitStatus))); connect(m_guiProcess, SIGNAL(started()), @@ -55,8 +57,8 @@ ApplicationLauncher::ApplicationLauncher(QObject *parent) m_consoleProcess = new ConsoleProcess(this); m_consoleProcess->setSettings(Core::ICore::instance()->settings()); - connect(m_consoleProcess, SIGNAL(processError(const QString&)), - this, SIGNAL(applicationError(const QString&))); + connect(m_consoleProcess, SIGNAL(processMessage(QString,bool)), + this, SIGNAL(appendMessage(QString,bool))); connect(m_consoleProcess, SIGNAL(processStopped()), this, SLOT(processStopped())); } @@ -131,14 +133,23 @@ void ApplicationLauncher::guiProcessError() default: error = tr("Some error has occurred while running the program."); } - emit applicationError(error); + emit appendMessage(error, true); } void ApplicationLauncher::readStandardOutput() { QByteArray data = m_guiProcess->readAllStandardOutput(); emit appendOutput(m_outputCodec->toUnicode( - data.constData(), data.length(), &m_outputCodecState)); + data.constData(), data.length(), &m_outputCodecState), + false); +} + +void ApplicationLauncher::readStandardError() +{ + QByteArray data = m_guiProcess->readAllStandardError(); + emit appendOutput(m_outputCodec->toUnicode( + data.constData(), data.length(), &m_outputCodecState), + true); } void ApplicationLauncher::processStopped() diff --git a/src/plugins/projectexplorer/applicationrunconfiguration.cpp b/src/plugins/projectexplorer/applicationrunconfiguration.cpp index 8b2b8e0ef7..b7a750a418 100644 --- a/src/plugins/projectexplorer/applicationrunconfiguration.cpp +++ b/src/plugins/projectexplorer/applicationrunconfiguration.cpp @@ -101,10 +101,10 @@ LocalApplicationRunControl::LocalApplicationRunControl(LocalApplicationRunConfig m_runMode = static_cast<ApplicationLauncher::Mode>(runConfiguration->runMode()); m_commandLineArguments = runConfiguration->commandLineArguments(); - connect(&m_applicationLauncher, SIGNAL(applicationError(QString)), - this, SLOT(slotError(QString))); - connect(&m_applicationLauncher, SIGNAL(appendOutput(QString)), - this, SLOT(slotAddToOutputWindow(QString))); + connect(&m_applicationLauncher, SIGNAL(appendMessage(QString,bool)), + this, SLOT(slotAppendMessage(QString,bool))); + connect(&m_applicationLauncher, SIGNAL(appendOutput(QString, bool)), + this, SLOT(slotAddToOutputWindow(QString, bool))); connect(&m_applicationLauncher, SIGNAL(processExited(int)), this, SLOT(processExited(int))); connect(&m_applicationLauncher, SIGNAL(bringToForegroundRequested(qint64)), @@ -120,7 +120,7 @@ void LocalApplicationRunControl::start() m_applicationLauncher.start(m_runMode, m_executable, m_commandLineArguments); emit started(); - emit addToOutputWindow(this, tr("Starting %1...").arg(QDir::toNativeSeparators(m_executable))); + emit appendMessage(this, tr("Starting %1...").arg(QDir::toNativeSeparators(m_executable)), false); } void LocalApplicationRunControl::stop() @@ -133,20 +133,22 @@ bool LocalApplicationRunControl::isRunning() const return m_applicationLauncher.isRunning(); } -void LocalApplicationRunControl::slotError(const QString & err) +void LocalApplicationRunControl::slotAppendMessage(const QString &err, + bool isError) { - emit error(this, err); + emit appendMessage(this, err, isError); emit finished(); } -void LocalApplicationRunControl::slotAddToOutputWindow(const QString &line) +void LocalApplicationRunControl::slotAddToOutputWindow(const QString &line, + bool stderr) { - emit addToOutputWindowInline(this, line); + emit addToOutputWindowInline(this, line, stderr); } void LocalApplicationRunControl::processExited(int exitCode) { - emit addToOutputWindow(this, tr("%1 exited with code %2").arg(QDir::toNativeSeparators(m_executable)).arg(exitCode)); + emit appendMessage(this, tr("%1 exited with code %2").arg(QDir::toNativeSeparators(m_executable)).arg(exitCode), false); emit finished(); } diff --git a/src/plugins/projectexplorer/applicationrunconfiguration.h b/src/plugins/projectexplorer/applicationrunconfiguration.h index 22bead2395..f0060eb429 100644 --- a/src/plugins/projectexplorer/applicationrunconfiguration.h +++ b/src/plugins/projectexplorer/applicationrunconfiguration.h @@ -88,8 +88,8 @@ public: virtual bool isRunning() const; private slots: void processExited(int exitCode); - void slotAddToOutputWindow(const QString &line); - void slotError(const QString & error); + void slotAddToOutputWindow(const QString &line, bool stderr); + void slotAppendMessage(const QString &err, bool isError); private: ProjectExplorer::ApplicationLauncher m_applicationLauncher; QString m_executable; diff --git a/src/plugins/projectexplorer/outputformatter.cpp b/src/plugins/projectexplorer/outputformatter.cpp index 6a3e2df989..f2347267a6 100644 --- a/src/plugins/projectexplorer/outputformatter.cpp +++ b/src/plugins/projectexplorer/outputformatter.cpp @@ -49,7 +49,7 @@ void OutputFormatter::setPlainTextEdit(QPlainTextEdit *plainText) setParent(m_plainTextEdit); } -void OutputFormatter::appendOutput(const QString &text) +void OutputFormatter::appendApplicationOutput(const QString &text, bool /*onStdErr*/) { QTextCharFormat format; format.setForeground(plainTextEdit()->palette().text().color()); @@ -57,9 +57,9 @@ void OutputFormatter::appendOutput(const QString &text) plainTextEdit()->insertPlainText(text); } -void OutputFormatter::appendError(const QString &text) +void OutputFormatter::appendMessage(const QString &text, bool isError) { - appendOutput(text); + appendApplicationOutput(text, isError); } void OutputFormatter::mousePressEvent(QMouseEvent * /*e*/) diff --git a/src/plugins/projectexplorer/outputformatter.h b/src/plugins/projectexplorer/outputformatter.h index f8dc96f72d..4bde9197f6 100644 --- a/src/plugins/projectexplorer/outputformatter.h +++ b/src/plugins/projectexplorer/outputformatter.h @@ -50,8 +50,8 @@ public: QPlainTextEdit *plainTextEdit() const; void setPlainTextEdit(QPlainTextEdit *plainText); - virtual void appendOutput(const QString &text); - virtual void appendError(const QString &text); + virtual void appendApplicationOutput(const QString &text, bool onStdErr); + virtual void appendMessage(const QString &text, bool isError); virtual void mousePressEvent(QMouseEvent *e); virtual void mouseReleaseEvent(QMouseEvent *e); diff --git a/src/plugins/projectexplorer/outputwindow.cpp b/src/plugins/projectexplorer/outputwindow.cpp index a26f6855b8..3423d4bae4 100644 --- a/src/plugins/projectexplorer/outputwindow.cpp +++ b/src/plugins/projectexplorer/outputwindow.cpp @@ -210,22 +210,25 @@ void OutputPane::createNewOutputWindow(RunControl *rc) } } -void OutputPane::appendOutput(RunControl *rc, const QString &out) +void OutputPane::appendApplicationOutput(RunControl *rc, const QString &out, + bool onStdErr) { OutputWindow *ow = m_outputWindows.value(rc); - ow->appendOutput(out); + ow->appendApplicationOutput(out, onStdErr); } -void OutputPane::appendOutputInline(RunControl *rc, const QString &out) +void OutputPane::appendApplicationOutputInline(RunControl *rc, + const QString &out, + bool onStdErr) { OutputWindow *ow = m_outputWindows.value(rc); - ow->appendOutputInline(out); + ow->appendApplicationOutputInline(out, onStdErr); } -void OutputPane::appendError(RunControl *rc, const QString &out) +void OutputPane::appendMessage(RunControl *rc, const QString &out, bool isError) { OutputWindow *ow = m_outputWindows.value(rc); - ow->appendError(out); + ow->appendMessage(out, isError); } void OutputPane::showTabFor(RunControl *rc) @@ -424,7 +427,7 @@ void OutputWindow::showEvent(QShowEvent *e) m_scrollToBottom = false; } -QString OutputWindow::doNewlineMagic(const QString &out) +QString OutputWindow::doNewlineEnfocement(const QString &out) { m_scrollToBottom = true; QString s = out; @@ -439,17 +442,17 @@ QString OutputWindow::doNewlineMagic(const QString &out) return s; } -void OutputWindow::appendOutput(const QString &out) +void OutputWindow::appendApplicationOutput(const QString &out, bool onStdErr) { setMaximumBlockCount(MaxBlockCount); const bool atBottom = isScrollbarAtBottom(); - m_formatter->appendOutput(doNewlineMagic(out)); + m_formatter->appendApplicationOutput(doNewlineEnfocement(out), onStdErr); if (atBottom) scrollToBottom(); enableUndoRedo(); } -void OutputWindow::appendOutputInline(const QString &out) +void OutputWindow::appendApplicationOutputInline(const QString &out, bool onStdErr) { m_scrollToBottom = true; setMaximumBlockCount(MaxBlockCount); @@ -462,7 +465,7 @@ void OutputWindow::appendOutputInline(const QString &out) if (!enforceNewline) { newline = out.indexOf(QLatin1Char('\n')); moveCursor(QTextCursor::End); - m_formatter->appendOutput(newline < 0 ? out : out.left(newline)); // doesn't enforce new paragraph like appendPlainText + m_formatter->appendApplicationOutput(newline < 0 ? out : out.left(newline), onStdErr); // doesn't enforce new paragraph like appendPlainText } QString s = out.mid(newline+1); @@ -473,7 +476,7 @@ void OutputWindow::appendOutputInline(const QString &out) m_enforceNewline = true; s.chop(1); } - m_formatter->appendOutput(QLatin1Char('\n') + s); + m_formatter->appendApplicationOutput(QLatin1Char('\n') + s, onStdErr); } if (atBottom) @@ -481,10 +484,10 @@ void OutputWindow::appendOutputInline(const QString &out) enableUndoRedo(); } -void OutputWindow::appendError(const QString &out) +void OutputWindow::appendMessage(const QString &out, bool isError) { setMaximumBlockCount(MaxBlockCount); - m_formatter->appendError(doNewlineMagic(out)); + m_formatter->appendMessage(doNewlineEnfocement(out), isError); enableUndoRedo(); } diff --git a/src/plugins/projectexplorer/outputwindow.h b/src/plugins/projectexplorer/outputwindow.h index 48e86a1f8d..cc791a574d 100644 --- a/src/plugins/projectexplorer/outputwindow.h +++ b/src/plugins/projectexplorer/outputwindow.h @@ -92,9 +92,11 @@ public slots: void projectRemoved(); void coreAboutToClose(); - void appendOutput(RunControl *rc, const QString &out); - void appendOutputInline(RunControl *rc, const QString &out); - void appendError(RunControl *rc, const QString &out); + void appendApplicationOutput(RunControl *rc, const QString &out, + bool onStdErr); + void appendApplicationOutputInline(RunControl *rc, const QString &out, + bool onStdErr); + void appendMessage(RunControl *rc, const QString &out, bool isError); private slots: void reRunRunControl(); @@ -127,9 +129,9 @@ public: OutputFormatter* formatter() const; void setFormatter(OutputFormatter *formatter); - void appendOutput(const QString &out); - void appendOutputInline(const QString &out); - void appendError(const QString &out); + void appendApplicationOutput(const QString &out, bool onStdErr); + void appendApplicationOutputInline(const QString &out, bool onStdErr); + void appendMessage(const QString &out, bool isError); void grayOutOldContent(); @@ -145,7 +147,7 @@ protected: private: void enableUndoRedo(); - QString doNewlineMagic(const QString &out); + QString doNewlineEnfocement(const QString &out); private: Core::BaseContext *m_outputWindowContext; diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index df1bbb1afc..ed07b118f3 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1273,12 +1273,12 @@ void ProjectExplorerPlugin::startRunControl(RunControl *runControl, const QStrin if (projectExplorerSettings().cleanOldAppOutput) d->m_outputPane->clearContents(); - connect(runControl, SIGNAL(addToOutputWindow(RunControl *, const QString &)), - d->m_outputPane, SLOT(appendOutput(RunControl*,const QString &))); - connect(runControl, SIGNAL(addToOutputWindowInline(RunControl *, const QString &)), - d->m_outputPane, SLOT(appendOutputInline(RunControl*,const QString &))); - connect(runControl, SIGNAL(error(RunControl *, const QString &)), - d->m_outputPane, SLOT(appendError(RunControl *, const QString &))); + connect(runControl, SIGNAL(addToOutputWindow(RunControl *, const QString &, bool)), + d->m_outputPane, SLOT(appendApplicationOutput(RunControl*,const QString &, bool))); + connect(runControl, SIGNAL(addToOutputWindowInline(RunControl *, const QString &, bool)), + d->m_outputPane, SLOT(appendApplicationOutputInline(RunControl*,const QString &, bool))); + connect(runControl, SIGNAL(appendMessage(RunControl*,QString,bool)), + d->m_outputPane, SLOT(appendMessage(RunControl *, const QString &, bool))); connect(runControl, SIGNAL(finished()), this, SLOT(runControlFinished())); diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index a43c0027b1..86efaf680c 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -172,9 +172,9 @@ public: virtual OutputFormatter *createOutputFormatter(QObject *parent = 0); signals: - void addToOutputWindow(RunControl *, const QString &line); - void addToOutputWindowInline(RunControl *, const QString &line); - void error(RunControl *, const QString &error); + void addToOutputWindow(RunControl *, const QString &line, bool onStdErr); + void addToOutputWindowInline(RunControl *, const QString &line, bool onStdErr); + void appendMessage(RunControl *, const QString &error, bool isError); void started(); void finished(); diff --git a/src/plugins/projectexplorer/winguiprocess.cpp b/src/plugins/projectexplorer/winguiprocess.cpp index aaf3ce861d..3317ce317b 100644 --- a/src/plugins/projectexplorer/winguiprocess.cpp +++ b/src/plugins/projectexplorer/winguiprocess.cpp @@ -122,12 +122,12 @@ void WinGuiProcess::run() &si, m_pid); if (!started) { - emit processError(tr("The process could not be started!")); + emit processMessage(tr("The process could not be started!"), true); break; } if (!dbgInterface) { - emit receivedDebugOutput(tr("Cannot retrieve debugging output!")); + emit receivedDebugOutput(tr("Cannot retrieve debugging output!"), true); WaitForSingleObject(m_pid->hProcess, INFINITE); } else { LPSTR message; @@ -148,7 +148,7 @@ void WinGuiProcess::run() switch (ret) { case WAIT_OBJECT_0 + 0: if (*processId == m_pid->dwProcessId) - emit receivedDebugOutput(QString::fromLocal8Bit(message)); + emit receivedDebugOutput(QString::fromLocal8Bit(message), false); SetEvent(bufferReadyEvent); break; case WAIT_OBJECT_0 + 1: diff --git a/src/plugins/projectexplorer/winguiprocess.h b/src/plugins/projectexplorer/winguiprocess.h index 026291fa37..34c0c3320e 100644 --- a/src/plugins/projectexplorer/winguiprocess.h +++ b/src/plugins/projectexplorer/winguiprocess.h @@ -61,8 +61,8 @@ public: int exitCode() const; signals: - void processError(const QString &error); - void receivedDebugOutput(const QString &output); + void processMessage(const QString &error, bool isError); + void receivedDebugOutput(const QString &output, bool stderr); void processFinished(int exitCode); private: diff --git a/src/plugins/qmlprojectmanager/qmloutputformatter.cpp b/src/plugins/qmlprojectmanager/qmloutputformatter.cpp index 450a0b9073..821a492b61 100644 --- a/src/plugins/qmlprojectmanager/qmloutputformatter.cpp +++ b/src/plugins/qmlprojectmanager/qmloutputformatter.cpp @@ -44,7 +44,7 @@ QmlOutputFormatter::QmlOutputFormatter(QObject *parent) { } -void QmlOutputFormatter::appendOutput(const QString &text) +void QmlOutputFormatter::appendApplicationOutput(const QString &text, bool /*onStdErr*/) { QTextCharFormat normalFormat, linkFormat; normalFormat.setForeground(plainTextEdit()->palette().text().color()); @@ -72,9 +72,9 @@ void QmlOutputFormatter::appendOutput(const QString &text) plainTextEdit()->insertPlainText(text.mid(index)); } -void QmlOutputFormatter::appendError(const QString &text) +void QmlOutputFormatter::appendMessage(const QString &text, bool isError) { - appendOutput(text); + appendApplicationOutput(text, isError); } void QmlOutputFormatter::mousePressEvent(QMouseEvent * /*e*/) diff --git a/src/plugins/qmlprojectmanager/qmloutputformatter.h b/src/plugins/qmlprojectmanager/qmloutputformatter.h index 1302ca43e3..4d02a0c493 100644 --- a/src/plugins/qmlprojectmanager/qmloutputformatter.h +++ b/src/plugins/qmlprojectmanager/qmloutputformatter.h @@ -42,8 +42,8 @@ class QmlOutputFormatter: public ProjectExplorer::OutputFormatter public: QmlOutputFormatter(QObject *parent = 0); - virtual void appendOutput(const QString &text); - virtual void appendError(const QString &text); + virtual void appendApplicationOutput(const QString &text, bool onStdErr); + virtual void appendMessage(const QString &text, bool isError); virtual void mousePressEvent(QMouseEvent *e); virtual void mouseReleaseEvent(QMouseEvent *e); diff --git a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp index 7b7c70636e..aa4a0a37fe 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp @@ -65,10 +65,10 @@ QmlRunControl::QmlRunControl(QmlProjectRunConfiguration *runConfiguration, bool m_executable = runConfiguration->viewerPath(); m_commandLineArguments = runConfiguration->viewerArguments(); - connect(&m_applicationLauncher, SIGNAL(applicationError(QString)), - this, SLOT(slotError(QString))); - connect(&m_applicationLauncher, SIGNAL(appendOutput(QString)), - this, SLOT(slotAddToOutputWindow(QString))); + connect(&m_applicationLauncher, SIGNAL(appendMessage(QString,bool)), + this, SLOT(slotError(QString, bool))); + connect(&m_applicationLauncher, SIGNAL(appendOutput(QString, bool)), + this, SLOT(slotAddToOutputWindow(QString, bool))); connect(&m_applicationLauncher, SIGNAL(processExited(int)), this, SLOT(processExited(int))); connect(&m_applicationLauncher, SIGNAL(bringToForegroundRequested(qint64)), @@ -90,7 +90,7 @@ void QmlRunControl::start() emit started(); emit addToOutputWindow(this, tr("Starting %1 %2").arg(QDir::toNativeSeparators(m_executable), - m_commandLineArguments.join(QLatin1String(" ")))); + m_commandLineArguments.join(QLatin1String(" "))), false); } void QmlRunControl::stop() @@ -113,25 +113,25 @@ void QmlRunControl::slotBringApplicationToForeground(qint64 pid) bringApplicationToForeground(pid); } -void QmlRunControl::slotError(const QString &err) +void QmlRunControl::slotError(const QString &err, bool isError) { - emit error(this, err); + emit appendMessage(this, err, isError); emit finished(); } -void QmlRunControl::slotAddToOutputWindow(const QString &line) +void QmlRunControl::slotAddToOutputWindow(const QString &line, bool onStdErr) { if (m_debugMode && line.startsWith("QDeclarativeDebugServer: Waiting for connection")) { Core::ICore *core = Core::ICore::instance(); core->modeManager()->activateMode(Debugger::Constants::MODE_DEBUG); } - emit addToOutputWindowInline(this, line); + emit addToOutputWindowInline(this, line, onStdErr); } void QmlRunControl::processExited(int exitCode) { - emit addToOutputWindow(this, tr("%1 exited with code %2").arg(QDir::toNativeSeparators(m_executable)).arg(exitCode)); + emit appendMessage(this, tr("%1 exited with code %2").arg(QDir::toNativeSeparators(m_executable)).arg(exitCode), exitCode != 0); emit finished(); } diff --git a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.h b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.h index dcff96f392..d6fe7e1cdb 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectruncontrol.h +++ b/src/plugins/qmlprojectmanager/qmlprojectruncontrol.h @@ -55,8 +55,8 @@ public: private slots: void processExited(int exitCode); void slotBringApplicationToForeground(qint64 pid); - void slotAddToOutputWindow(const QString &line); - void slotError(const QString & error); + void slotAddToOutputWindow(const QString &line, bool onStdErr); + void slotError(const QString &error, bool isError); private: ProjectExplorer::ApplicationLauncher m_applicationLauncher; diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemoruncontrol.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemoruncontrol.cpp index 675d8d87cb..2042341e80 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemoruncontrol.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemoruncontrol.cpp @@ -83,7 +83,7 @@ void AbstractMaemoRunControl::start() void AbstractMaemoRunControl::startInitialCleanup() { - emit addToOutputWindow(this, tr("Cleaning up remote leftovers first ...")); + emit appendMessage(this, tr("Cleaning up remote leftovers first ..."), false); const QStringList appsToKill = QStringList() << executableFileName() << QLatin1String("gdbserver"); killRemoteProcesses(appsToKill, true); @@ -103,14 +103,14 @@ void AbstractMaemoRunControl::stop() void AbstractMaemoRunControl::handleInitialCleanupFinished() { if (m_stoppedByUser) { - emit addToOutputWindow(this, tr("Initial cleanup canceled by user.")); + emit appendMessage(this, tr("Initial cleanup canceled by user."), false); emit finished(); } else if (m_initialCleaner->hasError()) { handleError(tr("Error running initial cleanup: %1.") .arg(m_initialCleaner->error())); emit finished(); } else { - emit addToOutputWindow(this, tr("Initial cleanup done.")); + emit appendMessage(this, tr("Initial cleanup done."), false); startInternal(); } } @@ -158,7 +158,7 @@ void AbstractMaemoRunControl::deploy() files << srcFilePath; deploySpecs << SshDeploySpec(srcFilePath, tgtFilePath); } - emit addToOutputWindow(this, tr("Files to deploy: %1.").arg(files.join(" "))); + emit appendMessage(this, tr("Files to deploy: %1.").arg(files.join(" ")), false); m_sshDeployer.reset(new MaemoSshDeployer(m_devConfig, deploySpecs)); connect(m_sshDeployer.data(), SIGNAL(finished()), this, SLOT(handleDeployThreadFinished())); @@ -213,7 +213,7 @@ void AbstractMaemoRunControl::startExecution() this, SLOT(handleRunThreadFinished())); connect(m_sshRunner.data(), SIGNAL(remoteOutput(QString)), this, SLOT(handleRemoteOutput(QString))); - emit addToOutputWindow(this, tr("Starting remote application.")); + emit appendMessage(this, tr("Starting remote application."), false); m_sshRunner->start(); } @@ -257,13 +257,13 @@ void AbstractMaemoRunControl::handleDeployThreadFinished() { bool cancel; if (m_stoppedByUser) { - emit addToOutputWindow(this, tr("Deployment canceled by user.")); + emit appendMessage(this, tr("Deployment canceled by user."), false); cancel = true; } else if (m_sshDeployer->hasError()) { handleError(tr("Deployment failed: %1").arg(m_sshDeployer->error())); cancel = true; } else { - emit addToOutputWindow(this, tr("Deployment finished.")); + emit appendMessage(this, tr("Deployment finished."), false); cancel = false; } @@ -280,13 +280,16 @@ void AbstractMaemoRunControl::handleDeployThreadFinished() void AbstractMaemoRunControl::handleRunThreadFinished() { if (m_stoppedByUser) { - emit addToOutputWindow(this, - tr("Remote execution canceled due to user request.")); + emit appendMessage(this, + tr("Remote execution canceled due to user request."), + false); } else if (m_sshRunner->hasError()) { - emit addToOutputWindow(this, tr("Error running remote process: %1") - .arg(m_sshRunner->error())); + emit appendMessage(this, tr("Error running remote process: %1") + .arg(m_sshRunner->error()), + true); } else { - emit addToOutputWindow(this, tr("Finished running remote process.")); + emit appendMessage(this, tr("Finished running remote process."), + false); } emit finished(); } @@ -335,7 +338,7 @@ QString AbstractMaemoRunControl::targetCmdLineSuffix() const void AbstractMaemoRunControl::handleError(const QString &errString) { QMessageBox::critical(0, tr("Remote Execution Failure"), errString); - emit error(this, errString); + emit appendMessage(this, errString, true); } @@ -365,9 +368,9 @@ void MaemoRunControl::stopInternal() AbstractMaemoRunControl::stopRunning(false); } -void MaemoRunControl::handleRemoteOutput(const QString &output) +void MaemoRunControl::handleRemoteOutput(const QString &output, bool onStdErr) { - emit addToOutputWindowInline(this, output); + emit addToOutputWindowInline(this, output, onStdErr); } @@ -392,8 +395,8 @@ MaemoDebugRunControl::MaemoDebugRunControl(RunConfiguration *runConfiguration) connect(m_debuggerManager, SIGNAL(debuggingFinished()), this, SLOT(debuggingFinished()), Qt::QueuedConnection); - connect(m_debuggerManager, SIGNAL(applicationOutputAvailable(QString)), - this, SLOT(debuggerOutput(QString)), Qt::QueuedConnection); + connect(m_debuggerManager, SIGNAL(applicationOutputAvailable(QString, bool)), + this, SLOT(debuggerOutput(QString, bool)), Qt::QueuedConnection); } MaemoDebugRunControl::~MaemoDebugRunControl() @@ -417,13 +420,13 @@ QString MaemoDebugRunControl::remoteCall() const .arg(executableFilePathOnTarget()).arg(targetCmdLineSuffix()); } -void MaemoDebugRunControl::handleRemoteOutput(const QString &output) +void MaemoDebugRunControl::handleRemoteOutput(const QString &output, bool onStdErr) { if (!m_debuggingStarted) { m_debuggingStarted = true; startDebugging(); } - emit addToOutputWindowInline(this, output); + emit addToOutputWindowInline(this, output, onStdErr); } void MaemoDebugRunControl::startDebugging() @@ -447,9 +450,9 @@ void MaemoDebugRunControl::debuggingFinished() AbstractMaemoRunControl::stopRunning(true); } -void MaemoDebugRunControl::debuggerOutput(const QString &output) +void MaemoDebugRunControl::debuggerOutput(const QString &output, bool onStdErr) { - emit addToOutputWindowInline(this, QLatin1String("[gdb says:] ") + output); + emit appendMessage(this, QLatin1String("[gdb says:] ") + output, onStdErr); } QString MaemoDebugRunControl::gdbServerPort() const diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemoruncontrol.h b/src/plugins/qt4projectmanager/qt-maemo/maemoruncontrol.h index 2eb0bf38c0..17fc4ddc75 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemoruncontrol.h +++ b/src/plugins/qt4projectmanager/qt-maemo/maemoruncontrol.h @@ -86,7 +86,7 @@ protected: QString executableFilePathOnTarget() const; private slots: - virtual void handleRemoteOutput(const QString &output)=0; + virtual void handleRemoteOutput(const QString &output, bool onStdErr)=0; void handleInitialCleanupFinished(); void handleDeployThreadFinished(); void handleRunThreadFinished(); @@ -138,7 +138,7 @@ public: private: virtual void startInternal(); virtual void stopInternal(); - virtual void handleRemoteOutput(const QString &output); + virtual void handleRemoteOutput(const QString &output, bool onStdErr); virtual QString remoteCall() const; }; @@ -151,13 +151,13 @@ public: bool isRunning() const; private slots: - void debuggerOutput(const QString &output); + void debuggerOutput(const QString &output, bool onStdErr); void debuggingFinished(); private: virtual void startInternal(); virtual void stopInternal(); - virtual void handleRemoteOutput(const QString &output); + virtual void handleRemoteOutput(const QString &output, bool onStdErr); virtual QString remoteCall() const; QString gdbServerPort() const; diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp index 5c9598e92d..5f5fe0cc13 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp @@ -534,19 +534,19 @@ void S60DeviceRunControlBase::start() emit started(); if (m_serialPortName.isEmpty()) { m_deployProgress->reportCanceled(); - error(this, tr("There is no device plugged in.")); + appendMessage(this, tr("There is no device plugged in."), true); emit finished(); return; } - emit addToOutputWindow(this, tr("Executable file: %1").arg(msgListFile(m_executableFileName))); + emit appendMessage(this, tr("Executable file: %1").arg(msgListFile(m_executableFileName)), false); QString errorMessage; QString settingsCategory; QString settingsPage; if (!checkConfiguration(&errorMessage, &settingsCategory, &settingsPage)) { m_deployProgress->reportCanceled(); - error(this, errorMessage); + appendMessage(this, errorMessage, true); emit finished(); Core::ICore::instance()->showWarningWithOptions(tr("Debugger for Symbian Platform"), errorMessage, QString(), @@ -566,14 +566,15 @@ void S60DeviceRunControlBase::start() if (!packageInfo.exists() || packageInfo.lastModified() < packageWithTargetInfo.lastModified()) { // the 'targetname_armX_udeb.sis' crap exists and is new, rename it - emit addToOutputWindow(this, tr("Renaming new package '%1' to '%2'") - .arg(QDir::toNativeSeparators(m_packageFileNameWithTarget), - QDir::toNativeSeparators(m_signedPackage))); + emit appendMessage(this, tr("Renaming new package '%1' to '%2'") + .arg(QDir::toNativeSeparators(m_packageFileNameWithTarget), + QDir::toNativeSeparators(m_signedPackage)), false); ok = renameFile(m_packageFileNameWithTarget, m_signedPackage, &errorMessage); } else { // the 'targetname_armX_udeb.sis' crap exists but is old, remove it - emit addToOutputWindow(this, tr("Removing old package '%1'") - .arg(QDir::toNativeSeparators(m_packageFileNameWithTarget))); + emit appendMessage(this, tr("Removing old package '%1'") + .arg(QDir::toNativeSeparators(m_packageFileNameWithTarget)), + false); QFile::remove(m_packageFileNameWithTarget); } } @@ -589,7 +590,7 @@ void S60DeviceRunControlBase::start() } else { m_deployProgress->reportCanceled(); errorMessage = tr("Failed to find package '%1': %2").arg(m_signedPackage, errorMessage); - error(this, errorMessage); + appendMessage(this, errorMessage, true); stop(); emit finished(); } @@ -651,7 +652,7 @@ void S60DeviceRunControlBase::startDeployment() m_launcher->setCopyFileName(m_signedPackage, copyDst); m_launcher->setInstallFileName(copyDst); initLauncher(runFileName, m_launcher); - emit addToOutputWindow(this, tr("Package: %1\nDeploying application to '%2'...").arg(msgListFile(m_signedPackage), m_serialPortFriendlyName)); + emit appendMessage(this, tr("Package: %1\nDeploying application to '%2'...").arg(msgListFile(m_signedPackage), m_serialPortFriendlyName), false); // Prompt the user to start up the Blue tooth connection const trk::PromptStartCommunicationResult src = S60RunConfigBluetoothStarter::startCommunication(m_launcher->trkDevice(), @@ -668,7 +669,7 @@ void S60DeviceRunControlBase::startDeployment() if (!success) { if (!errorMessage.isEmpty()) - error(this, errorMessage); + appendMessage(this, errorMessage, true); stop(); emit finished(); } @@ -676,28 +677,28 @@ void S60DeviceRunControlBase::startDeployment() void S60DeviceRunControlBase::printCreateFileFailed(const QString &filename, const QString &errorMessage) { - emit addToOutputWindow(this, tr("Could not create file %1 on device: %2").arg(filename, errorMessage)); + emit appendMessage(this, tr("Could not create file %1 on device: %2").arg(filename, errorMessage), true); } void S60DeviceRunControlBase::printWriteFileFailed(const QString &filename, const QString &errorMessage) { - emit addToOutputWindow(this, tr("Could not write to file %1 on device: %2").arg(filename, errorMessage)); + emit appendMessage(this, tr("Could not write to file %1 on device: %2").arg(filename, errorMessage), true); } void S60DeviceRunControlBase::printCloseFileFailed(const QString &filename, const QString &errorMessage) { const QString msg = tr("Could not close file %1 on device: %2. It will be closed when App TRK is closed."); - emit addToOutputWindow(this, msg.arg(filename, errorMessage)); + emit appendMessage(this, msg.arg(filename, errorMessage), true); } void S60DeviceRunControlBase::printConnectFailed(const QString &errorMessage) { - emit addToOutputWindow(this, tr("Could not connect to App TRK on device: %1. Restarting App TRK might help.").arg(errorMessage)); + emit appendMessage(this, tr("Could not connect to App TRK on device: %1. Restarting App TRK might help.").arg(errorMessage), true); } void S60DeviceRunControlBase::printCopyingNotice() { - emit addToOutputWindow(this, tr("Copying install file...")); + emit appendMessage(this, tr("Copying install file..."), false); } void S60DeviceRunControlBase::printCopyProgress(int progress) @@ -708,7 +709,7 @@ void S60DeviceRunControlBase::printCopyProgress(int progress) void S60DeviceRunControlBase::printInstallingNotice() { m_deployProgress->setProgressValue(PROGRESS_PACKAGEDEPLOYED); - emit addToOutputWindow(this, tr("Installing application...")); + emit appendMessage(this, tr("Installing application..."), false); } void S60DeviceRunControlBase::printInstallingFinished() @@ -724,7 +725,7 @@ void S60DeviceRunControlBase::printInstallFailed(const QString &filename, const QTC_ASSERT(m_deployProgress, ;) if (m_deployProgress) m_deployProgress->reportCanceled(); - emit addToOutputWindow(this, tr("Could not install from package %1 on device: %2").arg(filename, errorMessage)); + emit appendMessage(this, tr("Could not install from package %1 on device: %2").arg(filename, errorMessage), true); } void S60DeviceRunControlBase::launcherFinished() @@ -749,7 +750,7 @@ void S60DeviceRunControlBase::reportDeployFinished() void S60DeviceRunControlBase::processStopped(uint pc, uint pid, uint tid, const QString& reason) { - emit addToOutputWindow(this, trk::Launcher::msgStopped(pid, tid, pc, reason)); + emit addToOutputWindow(this, trk::Launcher::msgStopped(pid, tid, pc, reason), false); m_launcher->terminate(); } @@ -779,20 +780,20 @@ void S60DeviceRunControlBase::slotWaitingForTrkClosed() { if (m_launcher && m_launcher->state() == trk::Launcher::WaitingForTrk) { stop(); - error(this, tr("Canceled.")); + appendMessage(this, tr("Canceled."), true); emit finished(); } } -void S60DeviceRunControlBase::printApplicationOutput(const QString &output) +void S60DeviceRunControlBase::printApplicationOutput(const QString &output, bool onStdErr) { - emit addToOutputWindowInline(this, output); + emit addToOutputWindowInline(this, output, onStdErr); } void S60DeviceRunControlBase::deviceRemoved(const SymbianUtils::SymbianDevice &d) { if (m_handleDeviceRemoval && d.portName() == m_serialPortName) { - error(this, tr("The device '%1' has been disconnected").arg(d.friendlyName())); + appendMessage(this, tr("The device '%1' has been disconnected").arg(d.friendlyName()), true); emit finished(); } } @@ -824,21 +825,21 @@ void S60DeviceRunControl::initLauncher(const QString &executable, trk::Launcher void S60DeviceRunControl::handleLauncherFinished() { emit finished(); - emit addToOutputWindow(this, tr("Finished.")); + emit appendMessage(this, tr("Finished."), false); } void S60DeviceRunControl::printStartingNotice() { - emit addToOutputWindow(this, tr("Starting application...")); + emit appendMessage(this, tr("Starting application..."), false); } void S60DeviceRunControl::printRunNotice(uint pid) { - emit addToOutputWindow(this, tr("Application running with pid %1.").arg(pid)); + emit appendMessage(this, tr("Application running with pid %1.").arg(pid), false); } void S60DeviceRunControl::printRunFailNotice(const QString &errorMessage) { - emit addToOutputWindow(this, tr("Could not start application: %1").arg(errorMessage)); + emit appendMessage(this, tr("Could not start application: %1").arg(errorMessage), true); } // ======== S60DeviceDebugRunControl @@ -854,8 +855,8 @@ S60DeviceDebugRunControl::S60DeviceDebugRunControl(S60DeviceRunConfiguration *ru connect(dm, SIGNAL(debuggingFinished()), this, SLOT(debuggingFinished()), Qt::QueuedConnection); - connect(dm, SIGNAL(applicationOutputAvailable(QString)), - this, SLOT(printApplicationOutput(QString)), + connect(dm, SIGNAL(applicationOutputAvailable(QString, bool)), + this, SLOT(printApplicationOutput(QString, bool)), Qt::QueuedConnection); m_startParams->remoteChannel = rc->serialPortName(); @@ -892,7 +893,7 @@ void S60DeviceDebugRunControl::initLauncher(const QString &executable, trk::Laun if (!QFileInfo(m_startParams->symbolFileName).isFile()) { m_startParams->symbolFileName.clear(); - emit addToOutputWindow(this, tr("Warning: Cannot locate the symbol file belonging to %1.").arg(m_localExecutableFileName)); + emit appendMessage(this, tr("Warning: Cannot locate the symbol file belonging to %1.").arg(m_localExecutableFileName), true); } launcher->addStartupActions(trk::Launcher::ActionCopyInstall); @@ -902,13 +903,13 @@ void S60DeviceDebugRunControl::initLauncher(const QString &executable, trk::Laun void S60DeviceDebugRunControl::handleLauncherFinished() { - emit addToOutputWindow(this, tr("Launching debugger...")); + emit appendMessage(this, tr("Launching debugger..."), false); Debugger::DebuggerManager::instance()->startNewDebugger(m_startParams); } void S60DeviceDebugRunControl::debuggingFinished() { - emit addToOutputWindow(this, tr("Debugging finished.")); + emit appendMessage(this, tr("Debugging finished."), false); emit finished(); } diff --git a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h index 6827114568..25603e972e 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h +++ b/src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h @@ -161,7 +161,7 @@ protected: void setReleaseDeviceAfterLauncherFinish(bool); protected slots: - void printApplicationOutput(const QString &output); + void printApplicationOutput(const QString &output, bool onStdErr); void deviceRemoved(const SymbianUtils::SymbianDevice &); private slots: diff --git a/src/plugins/qt4projectmanager/qt-s60/s60emulatorrunconfiguration.cpp b/src/plugins/qt4projectmanager/qt-s60/s60emulatorrunconfiguration.cpp index 8b03c17c92..3a6d849d60 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60emulatorrunconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt-s60/s60emulatorrunconfiguration.cpp @@ -304,8 +304,8 @@ S60EmulatorRunControl::S60EmulatorRunControl(S60EmulatorRunConfiguration *runCon m_executable = runConfiguration->executable(); connect(&m_applicationLauncher, SIGNAL(applicationError(QString)), this, SLOT(slotError(QString))); - connect(&m_applicationLauncher, SIGNAL(appendOutput(QString)), - this, SLOT(slotAddToOutputWindow(QString))); + connect(&m_applicationLauncher, SIGNAL(appendOutput(QString, bool)), + this, SLOT(slotAddToOutputWindow(QString, bool))); connect(&m_applicationLauncher, SIGNAL(processExited(int)), this, SLOT(processExited(int))); connect(&m_applicationLauncher, SIGNAL(bringToForegroundRequested(qint64)), @@ -317,7 +317,7 @@ void S60EmulatorRunControl::start() m_applicationLauncher.start(ApplicationLauncher::Gui, m_executable, QStringList()); emit started(); - emit addToOutputWindow(this, tr("Starting %1...").arg(QDir::toNativeSeparators(m_executable))); + emit appendMessage(this, tr("Starting %1...").arg(QDir::toNativeSeparators(m_executable)), false); } void S60EmulatorRunControl::stop() @@ -332,22 +332,22 @@ bool S60EmulatorRunControl::isRunning() const void S60EmulatorRunControl::slotError(const QString & err) { - emit error(this, err); + emit appendMessage(this, err, false); emit finished(); } -void S60EmulatorRunControl::slotAddToOutputWindow(const QString &line) +void S60EmulatorRunControl::slotAddToOutputWindow(const QString &line, bool onStdErr) { static QString prefix = tr("[Qt Message]"); static int prefixLength = prefix.length(); int index = line.indexOf(prefix); if (index != -1) { - emit addToOutputWindowInline(this, line.mid(index + prefixLength + 1)); + emit addToOutputWindowInline(this, line.mid(index + prefixLength + 1), onStdErr); } } void S60EmulatorRunControl::processExited(int exitCode) { - emit addToOutputWindow(this, tr("%1 exited with code %2").arg(QDir::toNativeSeparators(m_executable)).arg(exitCode)); + emit appendMessage(this, tr("%1 exited with code %2").arg(QDir::toNativeSeparators(m_executable)).arg(exitCode), exitCode != 0); emit finished(); } diff --git a/src/plugins/qt4projectmanager/qt-s60/s60emulatorrunconfiguration.h b/src/plugins/qt4projectmanager/qt-s60/s60emulatorrunconfiguration.h index f84772a79f..7fd1dda8f2 100644 --- a/src/plugins/qt4projectmanager/qt-s60/s60emulatorrunconfiguration.h +++ b/src/plugins/qt4projectmanager/qt-s60/s60emulatorrunconfiguration.h @@ -137,7 +137,7 @@ public: private slots: void processExited(int exitCode); - void slotAddToOutputWindow(const QString &line); + void slotAddToOutputWindow(const QString &line, bool onStdErr); void slotError(const QString & error); private: |