Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
2cf76ead
Commit
2cf76ead
authored
Apr 15, 2011
by
con
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move OutputFormatter to Utils lib.
parent
28c92cf0
Changes
38
Hide whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
168 additions
and
148 deletions
+168
-148
src/libs/utils/outputformat.h
src/libs/utils/outputformat.h
+2
-2
src/libs/utils/outputformatter.cpp
src/libs/utils/outputformatter.cpp
+18
-10
src/libs/utils/outputformatter.h
src/libs/utils/outputformatter.h
+9
-4
src/libs/utils/utils-lib.pri
src/libs/utils/utils-lib.pri
+5
-2
src/plugins/analyzerbase/analyzerruncontrol.cpp
src/plugins/analyzerbase/analyzerruncontrol.cpp
+2
-2
src/plugins/debugger/debuggerrunner.cpp
src/plugins/debugger/debuggerrunner.cpp
+8
-8
src/plugins/debugger/qml/qmlengine.cpp
src/plugins/debugger/qml/qmlengine.cpp
+4
-4
src/plugins/debugger/qml/qmlengine.h
src/plugins/debugger/qml/qmlengine.h
+2
-2
src/plugins/projectexplorer/applicationlauncher.h
src/plugins/projectexplorer/applicationlauncher.h
+3
-2
src/plugins/projectexplorer/applicationlauncher_win.cpp
src/plugins/projectexplorer/applicationlauncher_win.cpp
+2
-2
src/plugins/projectexplorer/applicationlauncher_x11.cpp
src/plugins/projectexplorer/applicationlauncher_x11.cpp
+4
-4
src/plugins/projectexplorer/localapplicationruncontrol.cpp
src/plugins/projectexplorer/localapplicationruncontrol.cpp
+6
-6
src/plugins/projectexplorer/localapplicationruncontrol.h
src/plugins/projectexplorer/localapplicationruncontrol.h
+1
-1
src/plugins/projectexplorer/outputwindow.cpp
src/plugins/projectexplorer/outputwindow.cpp
+10
-3
src/plugins/projectexplorer/outputwindow.h
src/plugins/projectexplorer/outputwindow.h
+6
-6
src/plugins/projectexplorer/projectexplorer.pro
src/plugins/projectexplorer/projectexplorer.pro
+0
-3
src/plugins/projectexplorer/runconfiguration.cpp
src/plugins/projectexplorer/runconfiguration.cpp
+5
-6
src/plugins/projectexplorer/runconfiguration.h
src/plugins/projectexplorer/runconfiguration.h
+7
-7
src/plugins/qmlprofiler/qmlprofilerengine.cpp
src/plugins/qmlprofiler/qmlprofilerengine.cpp
+1
-1
src/plugins/qmlprofiler/qmlprofilerengine.h
src/plugins/qmlprofiler/qmlprofilerengine.h
+2
-2
src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp
src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp
+1
-1
src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h
src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h
+1
-1
src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp
src/plugins/qmlprojectmanager/qmlprojectruncontrol.cpp
+5
-5
src/plugins/qmlprojectmanager/qmlprojectruncontrol.h
src/plugins/qmlprojectmanager/qmlprojectruncontrol.h
+1
-1
src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp
...gins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp
+1
-1
src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.h
...lugins/qt4projectmanager/qt-desktop/qt4runconfiguration.h
+1
-1
src/plugins/qt4projectmanager/qt-maemo/maemorunconfiguration.cpp
...gins/qt4projectmanager/qt-maemo/maemorunconfiguration.cpp
+1
-1
src/plugins/qt4projectmanager/qt-maemo/maemorunconfiguration.h
...lugins/qt4projectmanager/qt-maemo/maemorunconfiguration.h
+1
-1
src/plugins/qt4projectmanager/qt-maemo/maemoruncontrol.cpp
src/plugins/qt4projectmanager/qt-maemo/maemoruncontrol.cpp
+7
-7
src/plugins/qt4projectmanager/qt-s60/codaruncontrol.cpp
src/plugins/qt4projectmanager/qt-s60/codaruncontrol.cpp
+17
-17
src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp
...ns/qt4projectmanager/qt-s60/s60devicerunconfiguration.cpp
+4
-4
src/plugins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h
...gins/qt4projectmanager/qt-s60/s60devicerunconfiguration.h
+2
-2
src/plugins/qt4projectmanager/qt-s60/s60emulatorrunconfiguration.cpp
.../qt4projectmanager/qt-s60/s60emulatorrunconfiguration.cpp
+7
-7
src/plugins/qt4projectmanager/qt-s60/s60emulatorrunconfiguration.h
...ns/qt4projectmanager/qt-s60/s60emulatorrunconfiguration.h
+2
-2
src/plugins/qt4projectmanager/qt-s60/s60runcontrolbase.cpp
src/plugins/qt4projectmanager/qt-s60/s60runcontrolbase.cpp
+2
-2
src/plugins/qt4projectmanager/qt-s60/trkruncontrol.cpp
src/plugins/qt4projectmanager/qt-s60/trkruncontrol.cpp
+12
-12
src/plugins/qt4projectmanager/qtoutputformatter.cpp
src/plugins/qt4projectmanager/qtoutputformatter.cpp
+2
-2
src/plugins/qt4projectmanager/qtoutputformatter.h
src/plugins/qt4projectmanager/qtoutputformatter.h
+4
-4
No files found.
src/
plugins/projectexplorer
/outputformat.h
→
src/
libs/utils
/outputformat.h
View file @
2cf76ead
...
...
@@ -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
src/
plugins/projectexplorer
/outputformatter.cpp
→
src/
libs/utils
/outputformatter.cpp
View file @
2cf76ead
...
...
@@ -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
();
}
src/
plugins/projectexplorer
/outputformatter.h
→
src/
libs/utils
/outputformatter.h
View file @
2cf76ead
...
...
@@ -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
src/libs/utils/utils-lib.pri
View file @
2cf76ead
...
...
@@ -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 \
...
...
src/plugins/analyzerbase/analyzerruncontrol.cpp
View file @
2cf76ead
...
...
@@ -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
,
...
...
src/plugins/debugger/debuggerrunner.cpp
View file @
2cf76ead
...
...
@@ -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
;
}
}
...
...
src/plugins/debugger/qml/qmlengine.cpp
View file @
2cf76ead
...
...
@@ -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
);
...
...
src/plugins/debugger/qml/qmlengine.h
View file @
2cf76ead
...
...
@@ -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
();
...
...
src/plugins/projectexplorer/applicationlauncher.h
View file @
2cf76ead
...
...
@@ -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
);
...
...
src/plugins/projectexplorer/applicationlauncher_win.cpp
View file @
2cf76ead
...
...
@@ -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
()
...
...
src/plugins/projectexplorer/applicationlauncher_x11.cpp
View file @
2cf76ead
...
...
@@ -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
()
...
...
src/plugins/projectexplorer/localapplicationruncontrol.cpp
View file @
2cf76ead
...
...
@@ -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
();
}
...
...
src/plugins/projectexplorer/localapplicationruncontrol.h
View file @
2cf76ead
...
...
@@ -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
;
...
...
src/plugins/projectexplorer/outputwindow.cpp
View file @
2cf76ead
...
...
@@ -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
);
}
...
...
src/plugins/projectexplorer/outputwindow.h
View file @
2cf76ead
...
...
@@ -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
;
...
...
src/plugins/projectexplorer/projectexplorer.pro
View file @
2cf76ead
...
...
@@ -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
\
...
...
src/plugins/projectexplorer/runconfiguration.cpp
View file @
2cf76ead
...
...
@@ -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
);
}
src/plugins/projectexplorer/runconfiguration.h
View file @
2cf76ead
...
...
@@ -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
);