forked from qt-creator/qt-creator
Move OutputFormatter to Utils lib.
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
#ifndef OUTPUTFORMAT_H
|
||||
#define OUTPUTFORMAT_H
|
||||
|
||||
namespace ProjectExplorer {
|
||||
namespace Utils {
|
||||
|
||||
enum OutputFormat
|
||||
{
|
||||
@@ -46,6 +46,6 @@ enum OutputFormat
|
||||
NumberOfFormats // Keep this entry last.
|
||||
};
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
} // namespace Utils
|
||||
|
||||
#endif // OUTPUTFORMATR_H
|
@@ -32,19 +32,16 @@
|
||||
|
||||
#include "outputformatter.h"
|
||||
|
||||
#include <texteditor/fontsettings.h>
|
||||
#include <texteditor/texteditorsettings.h>
|
||||
|
||||
#include <QtGui/QPlainTextEdit>
|
||||
#include <QtGui/QColor>
|
||||
|
||||
#include <QtCore/QString>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace TextEditor;
|
||||
using namespace Utils;
|
||||
|
||||
OutputFormatter::OutputFormatter()
|
||||
: QObject()
|
||||
, m_plainTextEdit(0)
|
||||
, m_formats(0)
|
||||
{
|
||||
|
||||
@@ -94,11 +91,11 @@ QColor OutputFormatter::mixColors(const QColor &a, const QColor &b)
|
||||
|
||||
void OutputFormatter::initFormats()
|
||||
{
|
||||
if (!plainTextEdit())
|
||||
return;
|
||||
QPalette p = plainTextEdit()->palette();
|
||||
|
||||
FontSettings fs = TextEditorSettings::instance()->fontSettings();
|
||||
QFont font = fs.font();
|
||||
QFont boldFont = font;
|
||||
QFont boldFont = m_font;
|
||||
boldFont.setBold(true);
|
||||
|
||||
m_formats = new QTextCharFormat[NumberOfFormats];
|
||||
@@ -112,12 +109,12 @@ void OutputFormatter::initFormats()
|
||||
m_formats[ErrorMessageFormat].setForeground(mixColors(p.color(QPalette::Text), QColor(Qt::red)));
|
||||
|
||||
// StdOutFormat
|
||||
m_formats[StdOutFormat].setFont(font);
|
||||
m_formats[StdOutFormat].setFont(m_font);
|
||||
m_formats[StdOutFormat].setForeground(p.color(QPalette::Text));
|
||||
m_formats[StdOutFormatSameLine] = m_formats[StdOutFormat];
|
||||
|
||||
// StdErrFormat
|
||||
m_formats[StdErrFormat].setFont(font);
|
||||
m_formats[StdErrFormat].setFont(m_font);
|
||||
m_formats[StdErrFormat].setForeground(mixColors(p.color(QPalette::Text), QColor(Qt::red)));
|
||||
m_formats[StdErrFormatSameLine] = m_formats[StdErrFormat];
|
||||
}
|
||||
@@ -126,3 +123,14 @@ void OutputFormatter::handleLink(const QString &href)
|
||||
{
|
||||
Q_UNUSED(href);
|
||||
}
|
||||
|
||||
QFont OutputFormatter::font() const
|
||||
{
|
||||
return m_font;
|
||||
}
|
||||
|
||||
void OutputFormatter::setFont(const QFont &font)
|
||||
{
|
||||
m_font = font;
|
||||
initFormats();
|
||||
}
|
@@ -33,10 +33,11 @@
|
||||
#ifndef OUTPUTFORMATTER_H
|
||||
#define OUTPUTFORMATTER_H
|
||||
|
||||
#include "projectexplorer_export.h"
|
||||
#include "utils_global.h"
|
||||
#include "outputformat.h"
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtGui/QFont>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QPlainTextEdit;
|
||||
@@ -44,9 +45,9 @@ class QTextCharFormat;
|
||||
class QColor;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace ProjectExplorer {
|
||||
namespace Utils {
|
||||
|
||||
class PROJECTEXPLORER_EXPORT OutputFormatter : public QObject
|
||||
class QTCREATOR_UTILS_EXPORT OutputFormatter : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -57,6 +58,9 @@ public:
|
||||
QPlainTextEdit *plainTextEdit() const;
|
||||
void setPlainTextEdit(QPlainTextEdit *plainText);
|
||||
|
||||
QFont font() const;
|
||||
void setFont(const QFont &font);
|
||||
|
||||
virtual void appendMessage(const QString &text, OutputFormat format);
|
||||
virtual void handleLink(const QString &href);
|
||||
|
||||
@@ -70,8 +74,9 @@ protected:
|
||||
private:
|
||||
QPlainTextEdit *m_plainTextEdit;
|
||||
QTextCharFormat *m_formats;
|
||||
QFont m_font;
|
||||
};
|
||||
|
||||
} // namespace ProjectExplorer
|
||||
} // namespace Utils
|
||||
|
||||
#endif // OUTPUTFORMATTER_H
|
@@ -81,7 +81,8 @@ SOURCES += $$PWD/environment.cpp \
|
||||
$$PWD/ssh/sftpdefs.cpp \
|
||||
$$PWD/ssh/sftpchannel.cpp \
|
||||
$$PWD/ssh/sshremoteprocessrunner.cpp \
|
||||
$$PWD/ssh/sshconnectionmanager.cpp
|
||||
$$PWD/ssh/sshconnectionmanager.cpp \
|
||||
$$PWD/outputformatter.cpp
|
||||
|
||||
win32 {
|
||||
SOURCES += $$PWD/abstractprocess_win.cpp \
|
||||
@@ -179,7 +180,9 @@ HEADERS += $$PWD/environment.h \
|
||||
$$PWD/ssh/sshremoteprocessrunner.h \
|
||||
$$PWD/ssh/sshconnectionmanager.h \
|
||||
$$PWD/ssh/sshpseudoterminal.h \
|
||||
$$PWD/statuslabel.h
|
||||
$$PWD/statuslabel.h \
|
||||
$$PWD/outputformatter.h \
|
||||
$$PWD/outputformat.h
|
||||
|
||||
FORMS += $$PWD/filewizardpage.ui \
|
||||
$$PWD/projectintropage.ui \
|
||||
|
@@ -142,12 +142,12 @@ QIcon AnalyzerRunControl::icon() const
|
||||
|
||||
void AnalyzerRunControl::receiveStandardOutput(const QString &text)
|
||||
{
|
||||
appendMessage(text, ProjectExplorer::StdOutFormat);
|
||||
appendMessage(text, Utils::StdOutFormat);
|
||||
}
|
||||
|
||||
void AnalyzerRunControl::receiveStandardError(const QString &text)
|
||||
{
|
||||
appendMessage(text, ProjectExplorer::StdErrFormat);
|
||||
appendMessage(text, Utils::StdErrFormat);
|
||||
}
|
||||
|
||||
void AnalyzerRunControl::addTask(ProjectExplorer::Task::TaskType type, const QString &description,
|
||||
|
@@ -55,10 +55,10 @@
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/outputformat.h>
|
||||
#include <projectexplorer/toolchain.h>
|
||||
#include <projectexplorer/applicationrunconfiguration.h> // For LocalApplication*
|
||||
|
||||
#include <utils/outputformat.h>
|
||||
#include <utils/synchronousprocess.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/fancymainwindow.h>
|
||||
@@ -241,7 +241,7 @@ void DebuggerRunControl::start()
|
||||
// User canceled input dialog asking for executable when working on library project.
|
||||
if (d->m_engine->startParameters().startMode == StartInternal
|
||||
&& d->m_engine->startParameters().executable.isEmpty()) {
|
||||
appendMessage(tr("No executable specified.\n"), ErrorMessageFormat);
|
||||
appendMessage(tr("No executable specified.\n"), Utils::ErrorMessageFormat);
|
||||
emit started();
|
||||
emit finished();
|
||||
return;
|
||||
@@ -257,12 +257,12 @@ void DebuggerRunControl::start()
|
||||
d->m_engine->startDebugger(this);
|
||||
|
||||
if (d->m_running)
|
||||
appendMessage(tr("Debugging starts\n"), NormalMessageFormat);
|
||||
appendMessage(tr("Debugging starts\n"), Utils::NormalMessageFormat);
|
||||
}
|
||||
|
||||
void DebuggerRunControl::startFailed()
|
||||
{
|
||||
appendMessage(tr("Debugging has failed\n"), NormalMessageFormat);
|
||||
appendMessage(tr("Debugging has failed\n"), Utils::NormalMessageFormat);
|
||||
d->m_running = false;
|
||||
emit finished();
|
||||
d->m_engine->handleStartFailed();
|
||||
@@ -270,7 +270,7 @@ void DebuggerRunControl::startFailed()
|
||||
|
||||
void DebuggerRunControl::handleFinished()
|
||||
{
|
||||
appendMessage(tr("Debugging has finished\n"), NormalMessageFormat);
|
||||
appendMessage(tr("Debugging has finished\n"), Utils::NormalMessageFormat);
|
||||
if (d->m_engine)
|
||||
d->m_engine->handleFinished();
|
||||
debuggerCore()->runControlFinished(d->m_engine);
|
||||
@@ -280,13 +280,13 @@ void DebuggerRunControl::showMessage(const QString &msg, int channel)
|
||||
{
|
||||
switch (channel) {
|
||||
case AppOutput:
|
||||
appendMessage(msg, StdOutFormatSameLine);
|
||||
appendMessage(msg, Utils::StdOutFormatSameLine);
|
||||
break;
|
||||
case AppError:
|
||||
appendMessage(msg, StdErrFormatSameLine);
|
||||
appendMessage(msg, Utils::StdErrFormatSameLine);
|
||||
break;
|
||||
case AppStuff:
|
||||
appendMessage(msg, NormalMessageFormat);
|
||||
appendMessage(msg, Utils::NormalMessageFormat);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -200,8 +200,8 @@ void QmlEngine::setupInferior()
|
||||
SIGNAL(processExited(int)),
|
||||
SLOT(disconnected()));
|
||||
connect(&d->m_applicationLauncher,
|
||||
SIGNAL(appendMessage(QString,ProjectExplorer::OutputFormat)),
|
||||
SLOT(appendMessage(QString,ProjectExplorer::OutputFormat)));
|
||||
SIGNAL(appendMessage(QString,Utils::OutputFormat)),
|
||||
SLOT(appendMessage(QString,Utils::OutputFormat)));
|
||||
connect(&d->m_applicationLauncher,
|
||||
SIGNAL(bringToForegroundRequested(qint64)),
|
||||
runControl(),
|
||||
@@ -214,7 +214,7 @@ void QmlEngine::setupInferior()
|
||||
}
|
||||
}
|
||||
|
||||
void QmlEngine::appendMessage(const QString &msg, OutputFormat /* format */)
|
||||
void QmlEngine::appendMessage(const QString &msg, Utils::OutputFormat /* format */)
|
||||
{
|
||||
showMessage(msg, AppOutput); // FIXME: Redirect to RunControl
|
||||
}
|
||||
@@ -392,7 +392,7 @@ void QmlEngine::startApplicationLauncher()
|
||||
QDir::toNativeSeparators(startParameters().executable),
|
||||
startParameters().processArgs)
|
||||
+ QLatin1Char('\n')
|
||||
, NormalMessageFormat);
|
||||
, Utils::NormalMessageFormat);
|
||||
d->m_applicationLauncher.start(ApplicationLauncher::Gui,
|
||||
startParameters().executable,
|
||||
startParameters().processArgs);
|
||||
|
@@ -35,7 +35,7 @@
|
||||
|
||||
#include "debuggerengine.h"
|
||||
|
||||
#include <projectexplorer/outputformat.h>
|
||||
#include <utils/outputformat.h>
|
||||
|
||||
#include <QtCore/QScopedPointer>
|
||||
#include <QtNetwork/QAbstractSocket>
|
||||
@@ -130,7 +130,7 @@ private slots:
|
||||
void connectionStartupFailed();
|
||||
void connectionError(QAbstractSocket::SocketError error);
|
||||
void serviceConnectionError(const QString &service);
|
||||
void appendMessage(const QString &msg, ProjectExplorer::OutputFormat);
|
||||
void appendMessage(const QString &msg, Utils::OutputFormat);
|
||||
|
||||
void synchronizeWatchers();
|
||||
|
||||
|
@@ -34,7 +34,8 @@
|
||||
#define APPLICATIONLAUNCHER_H
|
||||
|
||||
#include "projectexplorer_export.h"
|
||||
#include "outputformat.h"
|
||||
|
||||
#include <utils/outputformat.h>
|
||||
|
||||
#include <QtCore/QProcess>
|
||||
|
||||
@@ -69,7 +70,7 @@ public:
|
||||
qint64 applicationPID() const;
|
||||
|
||||
signals:
|
||||
void appendMessage(const QString &message, ProjectExplorer::OutputFormat format);
|
||||
void appendMessage(const QString &message, Utils::OutputFormat format);
|
||||
void processExited(int exitCode);
|
||||
void bringToForegroundRequested(qint64 pid);
|
||||
|
||||
|
@@ -132,13 +132,13 @@ qint64 ApplicationLauncher::applicationPID() const
|
||||
|
||||
void ApplicationLauncher::appendProcessMessage(const QString &output, bool onStdErr)
|
||||
{
|
||||
emit appendMessage(output, onStdErr ? ErrorMessageFormat : NormalMessageFormat);
|
||||
emit appendMessage(output, onStdErr ? Utils::ErrorMessageFormat : Utils::NormalMessageFormat);
|
||||
}
|
||||
|
||||
void ApplicationLauncher::readWinDebugOutput(const QString &output,
|
||||
bool onStdErr)
|
||||
{
|
||||
emit appendMessage(output, onStdErr ? StdErrFormat : StdOutFormat);
|
||||
emit appendMessage(output, onStdErr ? Utils::StdErrFormat : Utils::StdOutFormat);
|
||||
}
|
||||
|
||||
void ApplicationLauncher::processStopped()
|
||||
|
@@ -99,7 +99,7 @@ ApplicationLauncher::~ApplicationLauncher()
|
||||
|
||||
void ApplicationLauncher::appendProcessMessage(const QString &output, bool onStdErr)
|
||||
{
|
||||
emit appendMessage(output, onStdErr ? ErrorMessageFormat : NormalMessageFormat);
|
||||
emit appendMessage(output, onStdErr ? Utils::ErrorMessageFormat : Utils::NormalMessageFormat);
|
||||
}
|
||||
|
||||
void ApplicationLauncher::setWorkingDirectory(const QString &dir)
|
||||
@@ -176,7 +176,7 @@ void ApplicationLauncher::guiProcessError()
|
||||
default:
|
||||
error = tr("Some error has occurred while running the program.");
|
||||
}
|
||||
emit appendMessage(error + QLatin1Char('\n'), ErrorMessageFormat);
|
||||
emit appendMessage(error + QLatin1Char('\n'), Utils::ErrorMessageFormat);
|
||||
emit processExited(d->m_guiProcess.exitCode());
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ void ApplicationLauncher::readStandardOutput()
|
||||
QByteArray data = d->m_guiProcess.readAllStandardOutput();
|
||||
QString msg = d->m_outputCodec->toUnicode(
|
||||
data.constData(), data.length(), &d->m_outputCodecState);
|
||||
emit appendMessage(msg, StdOutFormatSameLine);
|
||||
emit appendMessage(msg, Utils::StdOutFormatSameLine);
|
||||
}
|
||||
|
||||
void ApplicationLauncher::readStandardError()
|
||||
@@ -193,7 +193,7 @@ void ApplicationLauncher::readStandardError()
|
||||
QByteArray data = d->m_guiProcess.readAllStandardError();
|
||||
QString msg = d->m_outputCodec->toUnicode(
|
||||
data.constData(), data.length(), &d->m_outputCodecState);
|
||||
emit appendMessage(msg, StdErrFormatSameLine);
|
||||
emit appendMessage(msg, Utils::StdErrFormatSameLine);
|
||||
}
|
||||
|
||||
void ApplicationLauncher::processStopped()
|
||||
|
@@ -89,8 +89,8 @@ LocalApplicationRunControl::LocalApplicationRunControl(LocalApplicationRunConfig
|
||||
m_runMode = static_cast<ApplicationLauncher::Mode>(rc->runMode());
|
||||
m_commandLineArguments = rc->commandLineArguments();
|
||||
|
||||
connect(&m_applicationLauncher, SIGNAL(appendMessage(QString,ProjectExplorer::OutputFormat)),
|
||||
this, SLOT(slotAppendMessage(QString,ProjectExplorer::OutputFormat)));
|
||||
connect(&m_applicationLauncher, SIGNAL(appendMessage(QString,Utils::OutputFormat)),
|
||||
this, SLOT(slotAppendMessage(QString,Utils::OutputFormat)));
|
||||
connect(&m_applicationLauncher, SIGNAL(processExited(int)),
|
||||
this, SLOT(processExited(int)));
|
||||
connect(&m_applicationLauncher, SIGNAL(bringToForegroundRequested(qint64)),
|
||||
@@ -105,12 +105,12 @@ void LocalApplicationRunControl::start()
|
||||
{
|
||||
emit started();
|
||||
if (m_executable.isEmpty()) {
|
||||
appendMessage(tr("No executable specified.\n"), ErrorMessageFormat);
|
||||
appendMessage(tr("No executable specified.\n"), Utils::ErrorMessageFormat);
|
||||
emit finished();
|
||||
} else {
|
||||
m_applicationLauncher.start(m_runMode, m_executable, m_commandLineArguments);
|
||||
QString msg = tr("Starting %1...\n").arg(QDir::toNativeSeparators(m_executable));
|
||||
appendMessage(msg, NormalMessageFormat);
|
||||
appendMessage(msg, Utils::NormalMessageFormat);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ QIcon LocalApplicationRunControl::icon() const
|
||||
}
|
||||
|
||||
void LocalApplicationRunControl::slotAppendMessage(const QString &err,
|
||||
OutputFormat format)
|
||||
Utils::OutputFormat format)
|
||||
{
|
||||
appendMessage(err, format);
|
||||
}
|
||||
@@ -140,7 +140,7 @@ void LocalApplicationRunControl::processExited(int exitCode)
|
||||
{
|
||||
QString msg = tr("%1 exited with code %2\n")
|
||||
.arg(QDir::toNativeSeparators(m_executable)).arg(exitCode);
|
||||
appendMessage(msg, NormalMessageFormat);
|
||||
appendMessage(msg, Utils::NormalMessageFormat);
|
||||
emit finished();
|
||||
}
|
||||
|
||||
|
@@ -65,7 +65,7 @@ public:
|
||||
virtual QIcon icon() const;
|
||||
private slots:
|
||||
void processExited(int exitCode);
|
||||
void slotAppendMessage(const QString &err, ProjectExplorer::OutputFormat isError);
|
||||
void slotAppendMessage(const QString &err, Utils::OutputFormat isError);
|
||||
private:
|
||||
ProjectExplorer::ApplicationLauncher m_applicationLauncher;
|
||||
QString m_executable;
|
||||
|
@@ -36,7 +36,6 @@
|
||||
#include "projectexplorersettings.h"
|
||||
#include "runconfiguration.h"
|
||||
#include "session.h"
|
||||
#include "outputformatter.h"
|
||||
|
||||
#include <coreplugin/actionmanager/actionmanager.h>
|
||||
#include <coreplugin/actionmanager/actioncontainer.h>
|
||||
@@ -47,10 +46,15 @@
|
||||
#include <coreplugin/icontext.h>
|
||||
#include <find/basetextfind.h>
|
||||
#include <aggregation/aggregate.h>
|
||||
|
||||
#include <texteditor/basetexteditor.h>
|
||||
#include <texteditor/fontsettings.h>
|
||||
#include <texteditor/texteditorsettings.h>
|
||||
|
||||
#include <projectexplorer/project.h>
|
||||
#include <qt4projectmanager/qt4projectmanagerconstants.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/outputformatter.h>
|
||||
|
||||
#include <QtGui/QIcon>
|
||||
#include <QtGui/QScrollBar>
|
||||
@@ -72,6 +76,8 @@ static const int MaxBlockCount = 100000;
|
||||
|
||||
enum { debug = 0 };
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
namespace ProjectExplorer {
|
||||
namespace Internal {
|
||||
|
||||
@@ -242,8 +248,8 @@ void OutputPane::createNewOutputWindow(RunControl *rc)
|
||||
this, SLOT(runControlStarted()));
|
||||
connect(rc, SIGNAL(finished()),
|
||||
this, SLOT(runControlFinished()));
|
||||
connect(rc, SIGNAL(appendMessage(ProjectExplorer::RunControl*,QString,ProjectExplorer::OutputFormat)),
|
||||
this, SLOT(appendMessage(ProjectExplorer::RunControl*,QString,ProjectExplorer::OutputFormat)));
|
||||
connect(rc, SIGNAL(appendMessage(ProjectExplorer::RunControl*,QString,Utils::OutputFormat)),
|
||||
this, SLOT(appendMessage(ProjectExplorer::RunControl*,QString,Utils::OutputFormat)));
|
||||
|
||||
// First look if we can reuse a tab
|
||||
const int size = m_runControlTabs.size();
|
||||
@@ -598,6 +604,7 @@ OutputFormatter *OutputWindow::formatter() const
|
||||
void OutputWindow::setFormatter(OutputFormatter *formatter)
|
||||
{
|
||||
m_formatter = formatter;
|
||||
m_formatter->setFont(TextEditor::TextEditorSettings::instance()->fontSettings().font());
|
||||
m_formatter->setPlainTextEdit(this);
|
||||
}
|
||||
|
||||
|
@@ -35,6 +35,7 @@
|
||||
|
||||
#include "outputformat.h"
|
||||
#include <coreplugin/ioutputpane.h>
|
||||
#include <utils/outputformatter.h>
|
||||
|
||||
#include <QtGui/QPlainTextEdit>
|
||||
#include <QtGui/QIcon>
|
||||
@@ -50,7 +51,6 @@ namespace Core {
|
||||
}
|
||||
|
||||
namespace ProjectExplorer {
|
||||
class OutputFormatter;
|
||||
class RunControl;
|
||||
class Project;
|
||||
|
||||
@@ -107,7 +107,7 @@ public slots:
|
||||
void projectRemoved();
|
||||
|
||||
void appendMessage(ProjectExplorer::RunControl *rc, const QString &out,
|
||||
ProjectExplorer::OutputFormat format);
|
||||
Utils::OutputFormat format);
|
||||
|
||||
private slots:
|
||||
void reRunRunControl();
|
||||
@@ -156,10 +156,10 @@ public:
|
||||
OutputWindow(QWidget *parent = 0);
|
||||
~OutputWindow();
|
||||
|
||||
OutputFormatter* formatter() const;
|
||||
void setFormatter(OutputFormatter *formatter);
|
||||
Utils::OutputFormatter* formatter() const;
|
||||
void setFormatter(Utils::OutputFormatter *formatter);
|
||||
|
||||
void appendMessage(const QString &out, OutputFormat format);
|
||||
void appendMessage(const QString &out, Utils::OutputFormat format);
|
||||
/// appends a \p text using \p format without using formater
|
||||
void appendText(const QString &text, const QTextCharFormat &format, int maxLineCount);
|
||||
|
||||
@@ -189,7 +189,7 @@ private:
|
||||
QString doNewlineEnfocement(const QString &out);
|
||||
|
||||
Core::IContext *m_outputWindowContext;
|
||||
OutputFormatter *m_formatter;
|
||||
Utils::OutputFormatter *m_formatter;
|
||||
|
||||
bool m_enforceNewline;
|
||||
bool m_scrollToBottom;
|
||||
|
@@ -89,8 +89,6 @@ HEADERS += projectexplorer.h \
|
||||
buildenvironmentwidget.h \
|
||||
ldparser.h \
|
||||
linuxiccparser.h \
|
||||
outputformat.h \
|
||||
outputformatter.h \
|
||||
runconfigurationmodel.h \
|
||||
buildconfigurationmodel.h \
|
||||
processparameters.h \
|
||||
@@ -180,7 +178,6 @@ SOURCES += projectexplorer.cpp \
|
||||
buildenvironmentwidget.cpp \
|
||||
ldparser.cpp \
|
||||
linuxiccparser.cpp \
|
||||
outputformatter.cpp \
|
||||
runconfigurationmodel.cpp \
|
||||
buildconfigurationmodel.cpp \
|
||||
taskhub.cpp \
|
||||
|
@@ -32,7 +32,6 @@
|
||||
|
||||
#include "runconfiguration.h"
|
||||
|
||||
#include "outputformatter.h"
|
||||
#include "project.h"
|
||||
#include "target.h"
|
||||
#include "toolchain.h"
|
||||
@@ -327,9 +326,9 @@ QList<IRunConfigurationAspect *> RunConfiguration::extraAspects() const
|
||||
return m_aspects;
|
||||
}
|
||||
|
||||
ProjectExplorer::OutputFormatter *RunConfiguration::createOutputFormatter() const
|
||||
Utils::OutputFormatter *RunConfiguration::createOutputFormatter() const
|
||||
{
|
||||
return new OutputFormatter();
|
||||
return new Utils::OutputFormatter();
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -450,7 +449,7 @@ RunControl::RunControl(RunConfiguration *runConfiguration, QString mode)
|
||||
}
|
||||
// We need to ensure that there's always a OutputFormatter
|
||||
if (!m_outputFormatter)
|
||||
m_outputFormatter = new OutputFormatter();
|
||||
m_outputFormatter = new Utils::OutputFormatter();
|
||||
}
|
||||
|
||||
RunControl::~RunControl()
|
||||
@@ -458,7 +457,7 @@ RunControl::~RunControl()
|
||||
delete m_outputFormatter;
|
||||
}
|
||||
|
||||
OutputFormatter *RunControl::outputFormatter()
|
||||
Utils::OutputFormatter *RunControl::outputFormatter()
|
||||
{
|
||||
return m_outputFormatter;
|
||||
}
|
||||
@@ -554,7 +553,7 @@ void RunControl::bringApplicationToForegroundInternal()
|
||||
#endif
|
||||
}
|
||||
|
||||
void RunControl::appendMessage(const QString &msg, OutputFormat format)
|
||||
void RunControl::appendMessage(const QString &msg, Utils::OutputFormat format)
|
||||
{
|
||||
emit appendMessage(this, msg, format);
|
||||
}
|
||||
|
@@ -36,7 +36,8 @@
|
||||
#include "abi.h"
|
||||
#include "projectconfiguration.h"
|
||||
#include "projectexplorer_export.h"
|
||||
#include "outputformat.h"
|
||||
|
||||
#include <utils/outputformatter.h>
|
||||
|
||||
#include <QtCore/QMetaType>
|
||||
#include <QtCore/QWeakPointer>
|
||||
@@ -47,7 +48,6 @@ namespace ProjectExplorer {
|
||||
|
||||
class BuildConfiguration;
|
||||
class IRunConfigurationAspect;
|
||||
class OutputFormatter;
|
||||
class RunControl;
|
||||
class Target;
|
||||
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
|
||||
Target *target() const;
|
||||
|
||||
virtual ProjectExplorer::OutputFormatter *createOutputFormatter() const;
|
||||
virtual Utils::OutputFormatter *createOutputFormatter() const;
|
||||
|
||||
void setUseQmlDebugger(bool value);
|
||||
void setUseCppDebugger(bool value);
|
||||
@@ -206,16 +206,16 @@ public:
|
||||
|
||||
bool sameRunConfiguration(const RunControl *other) const;
|
||||
|
||||
OutputFormatter *outputFormatter();
|
||||
Utils::OutputFormatter *outputFormatter();
|
||||
QString runMode() const;
|
||||
|
||||
public slots:
|
||||
void bringApplicationToForeground(qint64 pid);
|
||||
void appendMessage(const QString &msg, ProjectExplorer::OutputFormat format);
|
||||
void appendMessage(const QString &msg, Utils::OutputFormat format);
|
||||
|
||||
signals:
|
||||
void appendMessage(ProjectExplorer::RunControl *runControl,
|
||||
const QString &msg, ProjectExplorer::OutputFormat format);
|
||||
const QString &msg, Utils::OutputFormat format);
|
||||
void started();
|
||||
void finished();
|
||||
|
||||
@@ -232,7 +232,7 @@ private:
|
||||
QString m_displayName;
|
||||
QString m_runMode;
|
||||
const QWeakPointer<RunConfiguration> m_runConfiguration;
|
||||
OutputFormatter *m_outputFormatter;
|
||||
Utils::OutputFormatter *m_outputFormatter;
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
//these two are used to bring apps in the foreground on Mac
|
||||
|
@@ -164,7 +164,7 @@ void QmlProfilerEngine::QmlProfilerEnginePrivate::launchperfmonitor()
|
||||
m_launcher.start(ProjectExplorer::ApplicationLauncher::Gui, m_params.debuggee, arguments);
|
||||
}
|
||||
|
||||
void QmlProfilerEngine::logApplicationMessage(const QString &msg, ProjectExplorer::OutputFormat /*format*/)
|
||||
void QmlProfilerEngine::logApplicationMessage(const QString &msg, Utils::OutputFormat /*format*/)
|
||||
{
|
||||
qDebug() << "app: " << msg;
|
||||
}
|
||||
|
@@ -35,7 +35,7 @@
|
||||
#define QMLPROFILERENGINE_H
|
||||
|
||||
#include <analyzerbase/ianalyzerengine.h>
|
||||
#include <projectexplorer/outputformat.h>
|
||||
#include <utils/outputformat.h>
|
||||
|
||||
namespace QmlProfiler {
|
||||
namespace Internal {
|
||||
@@ -63,7 +63,7 @@ private slots:
|
||||
void setFetchingData(bool);
|
||||
void dataReceived();
|
||||
void finishProcess();
|
||||
void logApplicationMessage(const QString &msg, ProjectExplorer::OutputFormat format);
|
||||
void logApplicationMessage(const QString &msg, Utils::OutputFormat format);
|
||||
|
||||
private:
|
||||
class QmlProfilerEnginePrivate;
|
||||
|
@@ -219,7 +219,7 @@ QWidget *QmlProjectRunConfiguration::createConfigurationWidget()
|
||||
return m_configurationWidget.data();
|
||||
}
|
||||
|
||||
ProjectExplorer::OutputFormatter *QmlProjectRunConfiguration::createOutputFormatter() const
|
||||
Utils::OutputFormatter *QmlProjectRunConfiguration::createOutputFormatter() const
|
||||
{
|
||||
return new Qt4ProjectManager::QtOutputFormatter(qmlTarget()->qmlProject());
|
||||
}
|
||||
|
@@ -99,7 +99,7 @@ public:
|
||||
// RunConfiguration
|
||||
bool isEnabled(ProjectExplorer::BuildConfiguration *bc) const;
|
||||
virtual QWidget *createConfigurationWidget();
|
||||
ProjectExplorer::OutputFormatter *createOutputFormatter() const;
|
||||
Utils::OutputFormatter *createOutputFormatter() const;
|
||||
QVariantMap toMap() const;
|
||||
|
||||
ProjectExplorer::Abi abi() const;
|
||||
|
@@ -79,8 +79,8 @@ QmlRunControl::QmlRunControl(QmlProjectRunConfiguration *runConfiguration, QStri
|
||||
}
|
||||
m_commandLineArguments = runConfiguration->viewerArguments();
|
||||
|
||||
connect(&m_applicationLauncher, SIGNAL(appendMessage(QString,ProjectExplorer::OutputFormat)),
|
||||
this, SLOT(slotAppendMessage(QString, ProjectExplorer::OutputFormat)));
|
||||
connect(&m_applicationLauncher, SIGNAL(appendMessage(QString,Utils::OutputFormat)),
|
||||
this, SLOT(slotAppendMessage(QString, Utils::OutputFormat)));
|
||||
connect(&m_applicationLauncher, SIGNAL(processExited(int)),
|
||||
this, SLOT(processExited(int)));
|
||||
connect(&m_applicationLauncher, SIGNAL(bringToForegroundRequested(qint64)),
|
||||
@@ -100,7 +100,7 @@ void QmlRunControl::start()
|
||||
emit started();
|
||||
QString msg = tr("Starting %1 %2\n")
|
||||
.arg(QDir::toNativeSeparators(m_executable), m_commandLineArguments);
|
||||
appendMessage(msg, NormalMessageFormat);
|
||||
appendMessage(msg, Utils::NormalMessageFormat);
|
||||
}
|
||||
|
||||
RunControl::StopResult QmlRunControl::stop()
|
||||
@@ -124,7 +124,7 @@ void QmlRunControl::slotBringApplicationToForeground(qint64 pid)
|
||||
bringApplicationToForeground(pid);
|
||||
}
|
||||
|
||||
void QmlRunControl::slotAppendMessage(const QString &line, OutputFormat format)
|
||||
void QmlRunControl::slotAppendMessage(const QString &line, Utils::OutputFormat format)
|
||||
{
|
||||
appendMessage(line, format);
|
||||
}
|
||||
@@ -133,7 +133,7 @@ void QmlRunControl::processExited(int exitCode)
|
||||
{
|
||||
QString msg = tr("%1 exited with code %2\n")
|
||||
.arg(QDir::toNativeSeparators(m_executable)).arg(exitCode);
|
||||
appendMessage(msg, exitCode ? ErrorMessageFormat : NormalMessageFormat);
|
||||
appendMessage(msg, exitCode ? Utils::ErrorMessageFormat : Utils::NormalMessageFormat);
|
||||
emit finished();
|
||||
}
|
||||
|
||||
|
@@ -58,7 +58,7 @@ public:
|
||||
private slots:
|
||||
void processExited(int exitCode);
|
||||
void slotBringApplicationToForeground(qint64 pid);
|
||||
void slotAppendMessage(const QString &line, ProjectExplorer::OutputFormat);
|
||||
void slotAppendMessage(const QString &line, Utils::OutputFormat);
|
||||
|
||||
private:
|
||||
ProjectExplorer::ApplicationLauncher m_applicationLauncher;
|
||||
|
@@ -699,7 +699,7 @@ Qt4RunConfiguration::BaseEnvironmentBase Qt4RunConfiguration::baseEnvironmentBas
|
||||
return m_baseEnvironmentBase;
|
||||
}
|
||||
|
||||
ProjectExplorer::OutputFormatter *Qt4RunConfiguration::createOutputFormatter() const
|
||||
Utils::OutputFormatter *Qt4RunConfiguration::createOutputFormatter() const
|
||||
{
|
||||
return new QtOutputFormatter(qt4Target()->qt4Project());
|
||||
}
|
||||
|
@@ -102,7 +102,7 @@ public:
|
||||
// TODO detectQtShadowBuild() ? how did this work ?
|
||||
QVariantMap toMap() const;
|
||||
|
||||
ProjectExplorer::OutputFormatter *createOutputFormatter() const;
|
||||
Utils::OutputFormatter *createOutputFormatter() const;
|
||||
|
||||
signals:
|
||||
void commandLineArgumentsChanged(const QString&);
|
||||
|
@@ -137,7 +137,7 @@ QWidget *MaemoRunConfiguration::createConfigurationWidget()
|
||||
return new MaemoRunConfigurationWidget(this);
|
||||
}
|
||||
|
||||
ProjectExplorer::OutputFormatter *MaemoRunConfiguration::createOutputFormatter() const
|
||||
Utils::OutputFormatter *MaemoRunConfiguration::createOutputFormatter() const
|
||||
{
|
||||
return new QtOutputFormatter(maemoTarget()->qt4Project());
|
||||
}
|
||||
|
@@ -84,7 +84,7 @@ public:
|
||||
using ProjectExplorer::RunConfiguration::isEnabled;
|
||||
bool isEnabled(ProjectExplorer::BuildConfiguration *config) const;
|
||||
QWidget *createConfigurationWidget();
|
||||
ProjectExplorer::OutputFormatter *createOutputFormatter() const;
|
||||
Utils::OutputFormatter *createOutputFormatter() const;
|
||||
AbstractQt4MaemoTarget *maemoTarget() const;
|
||||
Qt4BuildConfiguration *activeQt4BuildConfiguration() const;
|
||||
|
||||
|
@@ -95,7 +95,7 @@ void MaemoRunControl::handleSshError(const QString &error)
|
||||
|
||||
void MaemoRunControl::startExecution()
|
||||
{
|
||||
appendMessage(tr("Starting remote process ...\n"), NormalMessageFormat);
|
||||
appendMessage(tr("Starting remote process ...\n"), Utils::NormalMessageFormat);
|
||||
m_runner->startExecution(QString::fromLocal8Bit("%1 %2 %3 %4")
|
||||
.arg(MaemoGlobal::remoteCommandPrefix(m_runner->devConfig()->osVersion(),
|
||||
m_runner->connection()->connectionParameters().userName,
|
||||
@@ -109,29 +109,29 @@ void MaemoRunControl::handleRemoteProcessFinished(qint64 exitCode)
|
||||
{
|
||||
if (exitCode != MaemoSshRunner::InvalidExitCode) {
|
||||
appendMessage(tr("Finished running remote process. Exit code was %1.\n")
|
||||
.arg(exitCode), NormalMessageFormat);
|
||||
.arg(exitCode), Utils::NormalMessageFormat);
|
||||
}
|
||||
setFinished();
|
||||
}
|
||||
|
||||
void MaemoRunControl::handleRemoteOutput(const QByteArray &output)
|
||||
{
|
||||
appendMessage(QString::fromUtf8(output), StdOutFormatSameLine);
|
||||
appendMessage(QString::fromUtf8(output), Utils::StdOutFormatSameLine);
|
||||
}
|
||||
|
||||
void MaemoRunControl::handleRemoteErrorOutput(const QByteArray &output)
|
||||
{
|
||||
appendMessage(QString::fromUtf8(output), StdErrFormatSameLine);
|
||||
appendMessage(QString::fromUtf8(output), Utils::StdErrFormatSameLine);
|
||||
}
|
||||
|
||||
void MaemoRunControl::handleProgressReport(const QString &progressString)
|
||||
{
|
||||
appendMessage(progressString + QLatin1Char('\n'), NormalMessageFormat);
|
||||
appendMessage(progressString + QLatin1Char('\n'), Utils::NormalMessageFormat);
|
||||
}
|
||||
|
||||
void MaemoRunControl::handleMountDebugOutput(const QString &output)
|
||||
{
|
||||
appendMessage(output, StdErrFormatSameLine);
|
||||
appendMessage(output, Utils::StdErrFormatSameLine);
|
||||
}
|
||||
|
||||
bool MaemoRunControl::isRunning() const
|
||||
@@ -147,7 +147,7 @@ QIcon MaemoRunControl::icon() const
|
||||
void MaemoRunControl::handleError(const QString &errString)
|
||||
{
|
||||
stop();
|
||||
appendMessage(errString, ErrorMessageFormat);
|
||||
appendMessage(errString, Utils::ErrorMessageFormat);
|
||||
QMessageBox::critical(0, tr("Remote Execution Failure"), errString);
|
||||
}
|
||||
|
||||
|
@@ -98,11 +98,11 @@ bool CodaRunControl::doStart()
|
||||
if (m_address.isEmpty() && m_serialPort.isEmpty()) {
|
||||
cancelProgress();
|
||||
QString msg = tr("No device is connected. Please connect a device and try again.\n");
|
||||
appendMessage(msg, NormalMessageFormat);
|
||||
appendMessage(msg, Utils::NormalMessageFormat);
|
||||
return false;
|
||||
}
|
||||
appendMessage(tr("Executable file: %1\n").arg(msgListFile(executableFileName())),
|
||||
NormalMessageFormat);
|
||||
Utils::NormalMessageFormat);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -122,14 +122,14 @@ bool CodaRunControl::setupLauncher()
|
||||
|
||||
if (m_serialPort.length()) {
|
||||
// We get the port from SymbianDeviceManager
|
||||
appendMessage(tr("Connecting to '%1'...\n").arg(m_serialPort), NormalMessageFormat);
|
||||
appendMessage(tr("Connecting to '%1'...\n").arg(m_serialPort), Utils::NormalMessageFormat);
|
||||
m_codaDevice = SymbianUtils::SymbianDeviceManager::instance()->getCodaDevice(m_serialPort);
|
||||
if (m_codaDevice.isNull()) {
|
||||
appendMessage(tr("Unable to create CODA connection. Please try again.\n"), ErrorMessageFormat);
|
||||
appendMessage(tr("Unable to create CODA connection. Please try again.\n"), Utils::ErrorMessageFormat);
|
||||
return false;
|
||||
}
|
||||
if (!m_codaDevice->device()->isOpen()) {
|
||||
appendMessage(tr("Could not open serial device: %1\n").arg(m_codaDevice->device()->errorString()), ErrorMessageFormat);
|
||||
appendMessage(tr("Could not open serial device: %1\n").arg(m_codaDevice->device()->errorString()), Utils::ErrorMessageFormat);
|
||||
return false;
|
||||
}
|
||||
connect(SymbianUtils::SymbianDeviceManager::instance(), SIGNAL(deviceRemoved(const SymbianUtils::SymbianDevice)),
|
||||
@@ -151,7 +151,7 @@ bool CodaRunControl::setupLauncher()
|
||||
m_codaDevice->setDevice(codaSocket);
|
||||
codaSocket->connectToHost(m_address, m_port);
|
||||
m_state = StateConnecting;
|
||||
appendMessage(tr("Connecting to %1:%2...\n").arg(m_address).arg(m_port), NormalMessageFormat);
|
||||
appendMessage(tr("Connecting to %1:%2...\n").arg(m_address).arg(m_port), Utils::NormalMessageFormat);
|
||||
}
|
||||
QTimer::singleShot(5000, this, SLOT(checkForTimeout()));
|
||||
if (debug)
|
||||
@@ -178,7 +178,7 @@ void CodaRunControl::doStop()
|
||||
|
||||
void CodaRunControl::slotError(const QString &error)
|
||||
{
|
||||
appendMessage(tr("Error: %1\n").arg(error), ErrorMessageFormat);
|
||||
appendMessage(tr("Error: %1\n").arg(error), Utils::ErrorMessageFormat);
|
||||
finishRunControl();
|
||||
}
|
||||
|
||||
@@ -238,7 +238,7 @@ void CodaRunControl::handleConnected()
|
||||
if (m_state >= StateConnected)
|
||||
return;
|
||||
m_state = StateConnected;
|
||||
appendMessage(tr("Connected.\n"), NormalMessageFormat);
|
||||
appendMessage(tr("Connected.\n"), Utils::NormalMessageFormat);
|
||||
setProgress(maxProgress()*0.80);
|
||||
emit connected();
|
||||
if (!m_stopAfterConnect)
|
||||
@@ -251,7 +251,7 @@ void CodaRunControl::handleContextRemoved(const CodaEvent &event)
|
||||
= static_cast<const CodaRunControlContextRemovedEvent &>(event).ids();
|
||||
if (!m_runningProcessId.isEmpty()
|
||||
&& removedItems.contains(m_runningProcessId.toAscii())) {
|
||||
appendMessage(tr("Process has finished.\n"), NormalMessageFormat);
|
||||
appendMessage(tr("Process has finished.\n"), Utils::NormalMessageFormat);
|
||||
finishRunControl();
|
||||
}
|
||||
}
|
||||
@@ -276,7 +276,7 @@ void CodaRunControl::handleContextSuspended(const CodaEvent &event)
|
||||
switch (me.reason()) {
|
||||
case TcfSuspendEvent::Other:
|
||||
case TcfSuspendEvent::Crash:
|
||||
appendMessage(tr("Thread has crashed: %1\n").arg(QString::fromLatin1(me.message())), ErrorMessageFormat);
|
||||
appendMessage(tr("Thread has crashed: %1\n").arg(QString::fromLatin1(me.message())), Utils::ErrorMessageFormat);
|
||||
|
||||
if (me.reason() == TcfSuspendEvent::Crash)
|
||||
stop();
|
||||
@@ -303,7 +303,7 @@ void CodaRunControl::handleModuleLoadSuspended(const CodaEvent &event)
|
||||
void CodaRunControl::handleLogging(const CodaEvent &event)
|
||||
{
|
||||
const CodaLoggingWriteEvent &me = static_cast<const CodaLoggingWriteEvent &>(event);
|
||||
appendMessage(me.message(), StdOutFormat);
|
||||
appendMessage(me.message(), Utils::StdOutFormat);
|
||||
}
|
||||
|
||||
void CodaRunControl::handleAddListener(const CodaCommandResult &result)
|
||||
@@ -318,7 +318,7 @@ void CodaRunControl::handleFindProcesses(const CodaCommandResult &result)
|
||||
{
|
||||
if (result.values.size() && result.values.at(0).type() == JsonValue::Array && result.values.at(0).children().count()) {
|
||||
//there are processes running. Cannot run mine
|
||||
appendMessage(tr("The process is already running on the device. Please first close it.\n"), ErrorMessageFormat);
|
||||
appendMessage(tr("The process is already running on the device. Please first close it.\n"), Utils::ErrorMessageFormat);
|
||||
finishRunControl();
|
||||
} else {
|
||||
setProgress(maxProgress()*0.90);
|
||||
@@ -328,7 +328,7 @@ void CodaRunControl::handleFindProcesses(const CodaCommandResult &result)
|
||||
commandLineArguments().split(' '),
|
||||
QString(),
|
||||
true);
|
||||
appendMessage(tr("Launching: %1\n").arg(executableName()), NormalMessageFormat);
|
||||
appendMessage(tr("Launching: %1\n").arg(executableName()), Utils::NormalMessageFormat);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -337,9 +337,9 @@ void CodaRunControl::handleCreateProcess(const CodaCommandResult &result)
|
||||
const bool ok = result.type == CodaCommandResult::SuccessReply;
|
||||
if (ok) {
|
||||
setProgress(maxProgress());
|
||||
appendMessage(tr("Launched.\n"), NormalMessageFormat);
|
||||
appendMessage(tr("Launched.\n"), Utils::NormalMessageFormat);
|
||||
} else {
|
||||
appendMessage(tr("Launch failed: %1\n").arg(result.toString()), ErrorMessageFormat);
|
||||
appendMessage(tr("Launch failed: %1\n").arg(result.toString()), Utils::ErrorMessageFormat);
|
||||
finishRunControl();
|
||||
}
|
||||
}
|
||||
@@ -383,7 +383,7 @@ void CodaRunControl::cancelConnection()
|
||||
return;
|
||||
|
||||
stop();
|
||||
appendMessage(tr("Canceled.\n"), ErrorMessageFormat);
|
||||
appendMessage(tr("Canceled.\n"), Utils::ErrorMessageFormat);
|
||||
emit finished();
|
||||
}
|
||||
|
||||
@@ -391,7 +391,7 @@ void CodaRunControl::deviceRemoved(const SymbianUtils::SymbianDevice &device)
|
||||
{
|
||||
if (m_codaDevice && device.portName() == m_serialPort) {
|
||||
QString msg = tr("The device '%1' has been disconnected.\n").arg(device.friendlyName());
|
||||
appendMessage(msg, ErrorMessageFormat);
|
||||
appendMessage(msg, Utils::ErrorMessageFormat);
|
||||
finishRunControl();
|
||||
}
|
||||
}
|
||||
|
@@ -171,7 +171,7 @@ QWidget *S60DeviceRunConfiguration::createConfigurationWidget()
|
||||
return new S60DeviceRunConfigurationWidget(this);
|
||||
}
|
||||
|
||||
ProjectExplorer::OutputFormatter *S60DeviceRunConfiguration::createOutputFormatter() const
|
||||
Utils::OutputFormatter *S60DeviceRunConfiguration::createOutputFormatter() const
|
||||
{
|
||||
return new QtOutputFormatter(qt4Target()->qt4Project());
|
||||
}
|
||||
@@ -491,7 +491,7 @@ S60DeviceDebugRunControl::S60DeviceDebugRunControl(S60DeviceRunConfiguration *rc
|
||||
if (startParameters().symbolFileName.isEmpty()) {
|
||||
const QString msg = tr("Warning: Cannot locate the symbol file belonging to %1.\n").
|
||||
arg(rc->localExecutableFileName());
|
||||
appendMessage(msg, ErrorMessageFormat);
|
||||
appendMessage(msg, Utils::ErrorMessageFormat);
|
||||
}
|
||||
if (masterSlaveEngineTypes.first == Debugger::QmlEngineType) {
|
||||
connect(engine(), SIGNAL(requestRemoteSetup()), this, SLOT(remoteSetupRequested()));
|
||||
@@ -501,7 +501,7 @@ S60DeviceDebugRunControl::S60DeviceDebugRunControl(S60DeviceRunConfiguration *rc
|
||||
|
||||
void S60DeviceDebugRunControl::start()
|
||||
{
|
||||
appendMessage(tr("Launching debugger...\n"), NormalMessageFormat);
|
||||
appendMessage(tr("Launching debugger...\n"), Utils::NormalMessageFormat);
|
||||
Debugger::DebuggerRunControl::start();
|
||||
}
|
||||
|
||||
@@ -558,7 +558,7 @@ void S60DeviceDebugRunControl::handleDebuggingFinished()
|
||||
}
|
||||
}
|
||||
|
||||
void S60DeviceDebugRunControl::handleMessageFromCoda(ProjectExplorer::RunControl *aCodaRunControl, const QString &msg, ProjectExplorer::OutputFormat format)
|
||||
void S60DeviceDebugRunControl::handleMessageFromCoda(ProjectExplorer::RunControl *aCodaRunControl, const QString &msg, Utils::OutputFormat format)
|
||||
{
|
||||
// This only gets used when QmlEngine is the master debug engine. If GDB is running, messages are handled via the gdb adapter
|
||||
Q_UNUSED(aCodaRunControl)
|
||||
|
@@ -71,7 +71,7 @@ public:
|
||||
bool isEnabled(ProjectExplorer::BuildConfiguration *configuration) const;
|
||||
QWidget *createConfigurationWidget();
|
||||
|
||||
ProjectExplorer::OutputFormatter *createOutputFormatter() const;
|
||||
Utils::OutputFormatter *createOutputFormatter() const;
|
||||
|
||||
QString commandLineArguments() const;
|
||||
void setCommandLineArguments(const QString &args);
|
||||
@@ -148,7 +148,7 @@ private slots:
|
||||
void qmlEngineStateChanged(const Debugger::DebuggerState &state);
|
||||
void codaFinished();
|
||||
void handleDebuggingFinished();
|
||||
void handleMessageFromCoda(ProjectExplorer::RunControl *aCodaRunControl, const QString &msg, ProjectExplorer::OutputFormat format);
|
||||
void handleMessageFromCoda(ProjectExplorer::RunControl *aCodaRunControl, const QString &msg, Utils::OutputFormat format);
|
||||
|
||||
private:
|
||||
CodaRunControl *m_codaRunControl;
|
||||
|
@@ -155,7 +155,7 @@ QWidget *S60EmulatorRunConfiguration::createConfigurationWidget()
|
||||
return new S60EmulatorRunConfigurationWidget(this);
|
||||
}
|
||||
|
||||
ProjectExplorer::OutputFormatter *S60EmulatorRunConfiguration::createOutputFormatter() const
|
||||
Utils::OutputFormatter *S60EmulatorRunConfiguration::createOutputFormatter() const
|
||||
{
|
||||
return new QtOutputFormatter(qt4Target()->qt4Project());
|
||||
}
|
||||
@@ -342,8 +342,8 @@ S60EmulatorRunControl::S60EmulatorRunControl(S60EmulatorRunConfiguration *runCon
|
||||
m_executable = runConfiguration->executable();
|
||||
connect(&m_applicationLauncher, SIGNAL(applicationError(QString)),
|
||||
this, SLOT(slotError(QString)));
|
||||
connect(&m_applicationLauncher, SIGNAL(appendMessage(QString, ProjectExplorer::OutputFormat)),
|
||||
this, SLOT(slotAppendMessage(QString, ProjectExplorer::OutputFormat)));
|
||||
connect(&m_applicationLauncher, SIGNAL(appendMessage(QString, Utils::OutputFormat)),
|
||||
this, SLOT(slotAppendMessage(QString, Utils::OutputFormat)));
|
||||
connect(&m_applicationLauncher, SIGNAL(processExited(int)),
|
||||
this, SLOT(processExited(int)));
|
||||
connect(&m_applicationLauncher, SIGNAL(bringToForegroundRequested(qint64)),
|
||||
@@ -356,7 +356,7 @@ void S60EmulatorRunControl::start()
|
||||
emit started();
|
||||
|
||||
QString msg = tr("Starting %1...\n").arg(QDir::toNativeSeparators(m_executable));
|
||||
appendMessage(msg, NormalMessageFormat);
|
||||
appendMessage(msg, Utils::NormalMessageFormat);
|
||||
}
|
||||
|
||||
RunControl::StopResult S60EmulatorRunControl::stop()
|
||||
@@ -377,11 +377,11 @@ QIcon S60EmulatorRunControl::icon() const
|
||||
|
||||
void S60EmulatorRunControl::slotError(const QString & err)
|
||||
{
|
||||
appendMessage(err, ErrorMessageFormat);
|
||||
appendMessage(err, Utils::ErrorMessageFormat);
|
||||
emit finished();
|
||||
}
|
||||
|
||||
void S60EmulatorRunControl::slotAppendMessage(const QString &line, OutputFormat format)
|
||||
void S60EmulatorRunControl::slotAppendMessage(const QString &line, Utils::OutputFormat format)
|
||||
{
|
||||
static QString prefix = tr("[Qt Message]");
|
||||
static int prefixLength = prefix.length();
|
||||
@@ -393,6 +393,6 @@ void S60EmulatorRunControl::slotAppendMessage(const QString &line, OutputFormat
|
||||
void S60EmulatorRunControl::processExited(int exitCode)
|
||||
{
|
||||
QString msg = tr("%1 exited with code %2\n");
|
||||
appendMessage(msg, exitCode ? ErrorMessageFormat : NormalMessageFormat);
|
||||
appendMessage(msg, exitCode ? Utils::ErrorMessageFormat : Utils::NormalMessageFormat);
|
||||
emit finished();
|
||||
}
|
||||
|
@@ -72,7 +72,7 @@ public:
|
||||
bool isEnabled(ProjectExplorer::BuildConfiguration *configuration) const;
|
||||
QWidget *createConfigurationWidget();
|
||||
|
||||
ProjectExplorer::OutputFormatter *createOutputFormatter() const;
|
||||
Utils::OutputFormatter *createOutputFormatter() const;
|
||||
|
||||
QString executable() const;
|
||||
|
||||
@@ -149,7 +149,7 @@ public:
|
||||
|
||||
private slots:
|
||||
void processExited(int exitCode);
|
||||
void slotAppendMessage(const QString &line, ProjectExplorer::OutputFormat);
|
||||
void slotAppendMessage(const QString &line, Utils::OutputFormat);
|
||||
void slotError(const QString & error);
|
||||
|
||||
private:
|
||||
|
@@ -119,7 +119,7 @@ void S60RunControlBase::start()
|
||||
|
||||
if (m_runSmartInstaller) { //Smart Installer does the running by itself
|
||||
cancelProgress();
|
||||
appendMessage(tr("Please finalise the installation on your device.\n"), NormalMessageFormat);
|
||||
appendMessage(tr("Please finalise the installation on your device.\n"), Utils::NormalMessageFormat);
|
||||
emit finished();
|
||||
return;
|
||||
}
|
||||
@@ -172,7 +172,7 @@ void S60RunControlBase::startLaunching()
|
||||
|
||||
void S60RunControlBase::handleFinished()
|
||||
{
|
||||
appendMessage(tr("Finished.\n"), NormalMessageFormat);
|
||||
appendMessage(tr("Finished.\n"), Utils::NormalMessageFormat);
|
||||
}
|
||||
|
||||
void S60RunControlBase::setProgress(int value)
|
||||
|
@@ -83,12 +83,12 @@ bool TrkRunControl::doStart()
|
||||
if (m_serialPortName.isEmpty()) {
|
||||
cancelProgress();
|
||||
QString msg = tr("No device is connected. Please connect a device and try again.\n");
|
||||
appendMessage(msg, NormalMessageFormat);
|
||||
appendMessage(msg, Utils::NormalMessageFormat);
|
||||
return false;
|
||||
}
|
||||
|
||||
appendMessage(tr("Executable file: %1\n").arg(msgListFile(executableFileName())),
|
||||
NormalMessageFormat);
|
||||
Utils::NormalMessageFormat);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ bool TrkRunControl::setupLauncher()
|
||||
QString errorMessage;
|
||||
m_launcher = trk::Launcher::acquireFromDeviceManager(m_serialPortName, 0, &errorMessage);
|
||||
if (!m_launcher) {
|
||||
appendMessage(errorMessage, ErrorMessageFormat);
|
||||
appendMessage(errorMessage, Utils::ErrorMessageFormat);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ bool TrkRunControl::setupLauncher()
|
||||
|
||||
if (!m_launcher->startServer(&errorMessage)) {
|
||||
appendMessage(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), ErrorMessageFormat);
|
||||
"Check if the phone is connected and App TRK is running.").arg(m_serialPortName, errorMessage), Utils::ErrorMessageFormat);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -149,7 +149,7 @@ void TrkRunControl::doStop()
|
||||
void TrkRunControl::printConnectFailed(const QString &errorMessage)
|
||||
{
|
||||
appendMessage(tr("Could not connect to App TRK on device: %1. Restarting App TRK might help.\n").arg(errorMessage),
|
||||
ErrorMessageFormat);
|
||||
Utils::ErrorMessageFormat);
|
||||
}
|
||||
|
||||
void TrkRunControl::launcherFinished()
|
||||
@@ -162,7 +162,7 @@ void TrkRunControl::launcherFinished()
|
||||
|
||||
void TrkRunControl::processStopped(uint pc, uint pid, uint tid, const QString &reason)
|
||||
{
|
||||
appendMessage(trk::Launcher::msgStopped(pid, tid, pc, reason), StdOutFormat);
|
||||
appendMessage(trk::Launcher::msgStopped(pid, tid, pc, reason), Utils::StdOutFormat);
|
||||
m_launcher->terminate();
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ void TrkRunControl::slotWaitingForTrkClosed()
|
||||
{
|
||||
if (m_launcher && m_launcher->state() == trk::Launcher::WaitingForTrk) {
|
||||
stop();
|
||||
appendMessage(tr("Canceled.\n"), ErrorMessageFormat);
|
||||
appendMessage(tr("Canceled.\n"), Utils::ErrorMessageFormat);
|
||||
emit finished();
|
||||
}
|
||||
}
|
||||
@@ -205,7 +205,7 @@ void TrkRunControl::printApplicationOutput(const QString &output)
|
||||
|
||||
void TrkRunControl::printApplicationOutput(const QString &output, bool onStdErr)
|
||||
{
|
||||
appendMessage(output, onStdErr ? StdErrFormat : StdOutFormat);
|
||||
appendMessage(output, onStdErr ? Utils::StdErrFormat : Utils::StdOutFormat);
|
||||
}
|
||||
|
||||
void TrkRunControl::deviceRemoved(const SymbianUtils::SymbianDevice &d)
|
||||
@@ -215,7 +215,7 @@ void TrkRunControl::deviceRemoved(const SymbianUtils::SymbianDevice &d)
|
||||
m_launcher->deleteLater();
|
||||
m_launcher = 0;
|
||||
QString msg = tr("The device '%1' has been disconnected.\n").arg(d.friendlyName());
|
||||
appendMessage(msg, ErrorMessageFormat);
|
||||
appendMessage(msg, Utils::ErrorMessageFormat);
|
||||
emit finished();
|
||||
}
|
||||
}
|
||||
@@ -232,16 +232,16 @@ void TrkRunControl::initLauncher(const QString &executable, trk::Launcher *launc
|
||||
|
||||
void TrkRunControl::printStartingNotice()
|
||||
{
|
||||
appendMessage(tr("Starting application...\n"), NormalMessageFormat);
|
||||
appendMessage(tr("Starting application...\n"), Utils::NormalMessageFormat);
|
||||
}
|
||||
|
||||
void TrkRunControl::applicationRunNotice(uint pid)
|
||||
{
|
||||
appendMessage(tr("Application running with pid %1.\n").arg(pid), NormalMessageFormat);
|
||||
appendMessage(tr("Application running with pid %1.\n").arg(pid), Utils::NormalMessageFormat);
|
||||
setProgress(maxProgress());
|
||||
}
|
||||
|
||||
void TrkRunControl::applicationRunFailedNotice(const QString &errorMessage)
|
||||
{
|
||||
appendMessage(tr("Could not start application: %1\n").arg(errorMessage), NormalMessageFormat);
|
||||
appendMessage(tr("Could not start application: %1\n").arg(errorMessage), Utils::NormalMessageFormat);
|
||||
}
|
||||
|
@@ -91,7 +91,7 @@ LinkResult QtOutputFormatter::matchLine(const QString &line) const
|
||||
return lr;
|
||||
}
|
||||
|
||||
void QtOutputFormatter::appendMessage(const QString &txt, OutputFormat format)
|
||||
void QtOutputFormatter::appendMessage(const QString &txt, Utils::OutputFormat format)
|
||||
{
|
||||
QTextCursor cursor(plainTextEdit()->document());
|
||||
cursor.movePosition(QTextCursor::End);
|
||||
@@ -173,7 +173,7 @@ void QtOutputFormatter::appendMessage(const QString &txt, OutputFormat format)
|
||||
}
|
||||
|
||||
void QtOutputFormatter::appendLine(QTextCursor &cursor, LinkResult lr,
|
||||
const QString &line, ProjectExplorer::OutputFormat format)
|
||||
const QString &line, Utils::OutputFormat format)
|
||||
{
|
||||
const QTextCharFormat normalFormat = charFormat(format);
|
||||
cursor.insertText(line.left(lr.start), normalFormat);
|
||||
|
@@ -35,7 +35,7 @@
|
||||
|
||||
#include "qt4projectmanager_global.h"
|
||||
|
||||
#include <projectexplorer/outputformatter.h>
|
||||
#include <utils/outputformatter.h>
|
||||
#include <utils/fileinprojectfinder.h>
|
||||
|
||||
#include <QtCore/QRegExp>
|
||||
@@ -57,14 +57,14 @@ struct LinkResult
|
||||
};
|
||||
|
||||
class QT4PROJECTMANAGER_EXPORT QtOutputFormatter
|
||||
: public ProjectExplorer::OutputFormatter
|
||||
: public Utils::OutputFormatter
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QtOutputFormatter(ProjectExplorer::Project *project);
|
||||
|
||||
virtual void appendMessage(const QString &text,
|
||||
ProjectExplorer::OutputFormat format);
|
||||
Utils::OutputFormat format);
|
||||
virtual void handleLink(const QString &href);
|
||||
|
||||
private slots:
|
||||
@@ -73,7 +73,7 @@ private slots:
|
||||
private:
|
||||
LinkResult matchLine(const QString &line) const;
|
||||
void appendLine(QTextCursor & cursor, LinkResult lr,
|
||||
const QString &line, ProjectExplorer::OutputFormat);
|
||||
const QString &line, Utils::OutputFormat);
|
||||
|
||||
QRegExp m_qmlError;
|
||||
QRegExp m_qtError;
|
||||
|
Reference in New Issue
Block a user