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
5e6d92dd
Commit
5e6d92dd
authored
Apr 29, 2011
by
con
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the buffer size for the Application Output window configurable
Task-number: QTCREATORBUG-4531
parent
f6eef7fa
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
88 additions
and
17 deletions
+88
-17
src/plugins/coreplugin/outputwindow.cpp
src/plugins/coreplugin/outputwindow.cpp
+11
-6
src/plugins/coreplugin/outputwindow.h
src/plugins/coreplugin/outputwindow.h
+5
-1
src/plugins/projectexplorer/appoutputpane.cpp
src/plugins/projectexplorer/appoutputpane.cpp
+4
-2
src/plugins/projectexplorer/appoutputpane.h
src/plugins/projectexplorer/appoutputpane.h
+1
-1
src/plugins/projectexplorer/compileoutputwindow.cpp
src/plugins/projectexplorer/compileoutputwindow.cpp
+2
-1
src/plugins/projectexplorer/projectexplorer.cpp
src/plugins/projectexplorer/projectexplorer.cpp
+2
-0
src/plugins/projectexplorer/projectexplorersettings.h
src/plugins/projectexplorer/projectexplorersettings.h
+5
-2
src/plugins/projectexplorer/projectexplorersettingspage.cpp
src/plugins/projectexplorer/projectexplorersettingspage.cpp
+2
-0
src/plugins/projectexplorer/projectexplorersettingspage.ui
src/plugins/projectexplorer/projectexplorersettingspage.ui
+56
-4
No files found.
src/plugins/coreplugin/outputwindow.cpp
View file @
5e6d92dd
...
...
@@ -43,8 +43,6 @@
#include <QtGui/QAction>
#include <QtGui/QScrollBar>
static
const
int
MaxBlockCount
=
100000
;
using
namespace
Utils
;
namespace
Core
{
...
...
@@ -58,6 +56,7 @@ OutputWindow::OutputWindow(Core::Context context, QWidget *parent)
,
m_scrollToBottom
(
false
)
,
m_linksActive
(
true
)
,
m_mousePressed
(
false
)
,
m_maxLineCount
(
100000
)
{
setVerticalScrollBarPolicy
(
Qt
::
ScrollBarAlwaysOn
);
//setCenterOnScroll(false);
...
...
@@ -203,11 +202,17 @@ QString OutputWindow::doNewlineEnfocement(const QString &out)
return
s
;
}
void
OutputWindow
::
setMaxLineCount
(
int
count
)
{
m_maxLineCount
=
count
;
setMaximumBlockCount
(
m_maxLineCount
);
}
void
OutputWindow
::
appendMessage
(
const
QString
&
output
,
OutputFormat
format
)
{
QString
out
=
output
;
out
.
remove
(
QLatin1Char
(
'\r'
));
setMaximumBlockCount
(
MaxBlock
Count
);
setMaximumBlockCount
(
m_maxLine
Count
);
const
bool
atBottom
=
isScrollbarAtBottom
();
if
(
format
==
ErrorMessageFormat
||
format
==
NormalMessageFormat
)
{
...
...
@@ -254,11 +259,11 @@ void OutputWindow::appendMessage(const QString &output, OutputFormat format)
}
// TODO rename
void
OutputWindow
::
appendText
(
const
QString
&
textIn
,
const
QTextCharFormat
&
format
,
int
maxLineCount
)
void
OutputWindow
::
appendText
(
const
QString
&
textIn
,
const
QTextCharFormat
&
format
)
{
QString
text
=
textIn
;
text
.
remove
(
QLatin1Char
(
'\r'
));
if
(
maxLineCount
>
0
&&
document
()
->
blockCount
()
>
maxLineCount
)
if
(
m_
maxLineCount
>
0
&&
document
()
->
blockCount
()
>
m_
maxLineCount
)
return
;
const
bool
atBottom
=
isScrollbarAtBottom
();
QTextCursor
cursor
=
QTextCursor
(
document
());
...
...
@@ -266,7 +271,7 @@ void OutputWindow::appendText(const QString &textIn, const QTextCharFormat &form
cursor
.
beginEditBlock
();
cursor
.
insertText
(
doNewlineEnfocement
(
text
),
format
);
if
(
maxLineCount
>
0
&&
document
()
->
blockCount
()
>
maxLineCount
)
{
if
(
m_
maxLineCount
>
0
&&
document
()
->
blockCount
()
>
m_
maxLineCount
)
{
QTextCharFormat
tmp
;
tmp
.
setFontWeight
(
QFont
::
Bold
);
cursor
.
insertText
(
tr
(
"Additional output omitted
\n
"
),
tmp
);
...
...
src/plugins/coreplugin/outputwindow.h
View file @
5e6d92dd
...
...
@@ -57,7 +57,7 @@ public:
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
=
QTextCharFormat
()
,
int
maxLineCount
=
-
1
);
void
appendText
(
const
QString
&
text
,
const
QTextCharFormat
&
format
=
QTextCharFormat
());
void
grayOutOldContent
();
void
clear
();
...
...
@@ -66,6 +66,9 @@ public:
void
scrollToBottom
();
void
setMaxLineCount
(
int
count
);
int
maxLineCount
()
const
{
return
m_maxLineCount
;
}
public
slots
:
void
setWordWrapEnabled
(
bool
wrap
);
...
...
@@ -89,6 +92,7 @@ private:
bool
m_scrollToBottom
;
bool
m_linksActive
;
bool
m_mousePressed
;
int
m_maxLineCount
;
};
}
// namespace Core
...
...
src/plugins/projectexplorer/appoutputpane.cpp
View file @
5e6d92dd
...
...
@@ -116,7 +116,7 @@ AppOutputPane::AppOutputPane() :
connect
(
ProjectExplorerPlugin
::
instance
()
->
session
(),
SIGNAL
(
aboutToUnloadSession
()),
this
,
SLOT
(
aboutToUnloadSession
()));
connect
(
ProjectExplorerPlugin
::
instance
(),
SIGNAL
(
settingsChanged
()),
this
,
SLOT
(
update
WordWrapMode
()));
this
,
SLOT
(
update
FromSettings
()));
}
AppOutputPane
::~
AppOutputPane
()
...
...
@@ -264,6 +264,7 @@ void AppOutputPane::createNewOutputWindow(RunControl *rc)
ow
->
setWindowIcon
(
QIcon
(
QLatin1String
(
Qt4ProjectManager
::
Constants
::
ICON_WINDOW
)));
ow
->
setFormatter
(
formatter
);
ow
->
setWordWrapEnabled
(
ProjectExplorerPlugin
::
instance
()
->
projectExplorerSettings
().
wrapAppOutput
);
ow
->
setMaxLineCount
(
ProjectExplorerPlugin
::
instance
()
->
projectExplorerSettings
().
maxAppOutputLines
);
Aggregation
::
Aggregate
*
agg
=
new
Aggregation
::
Aggregate
;
agg
->
add
(
ow
);
agg
->
add
(
new
Find
::
BaseTextFind
(
ow
));
...
...
@@ -281,12 +282,13 @@ void AppOutputPane::handleOldOutput(Core::OutputWindow *window) const
window
->
grayOutOldContent
();
}
void
AppOutputPane
::
update
WordWrapMode
()
void
AppOutputPane
::
update
FromSettings
()
{
const
int
size
=
m_runControlTabs
.
size
();
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
RunControlTab
&
tab
=
m_runControlTabs
[
i
];
tab
.
window
->
setWordWrapEnabled
(
ProjectExplorerPlugin
::
instance
()
->
projectExplorerSettings
().
wrapAppOutput
);
tab
.
window
->
setMaxLineCount
(
ProjectExplorerPlugin
::
instance
()
->
projectExplorerSettings
().
maxAppOutputLines
);
}
}
...
...
src/plugins/projectexplorer/appoutputpane.h
View file @
5e6d92dd
...
...
@@ -104,7 +104,7 @@ private slots:
void
runControlFinished
();
void
aboutToUnloadSession
();
void
update
WordWrapMode
();
void
update
FromSettings
();
private:
struct
RunControlTab
{
...
...
src/plugins/projectexplorer/compileoutputwindow.cpp
View file @
5e6d92dd
...
...
@@ -68,6 +68,7 @@ CompileOutputWindow::CompileOutputWindow(BuildManager * /*bm*/)
m_outputWindow
->
setWindowIcon
(
QIcon
(
QLatin1String
(
Qt4ProjectManager
::
Constants
::
ICON_WINDOW
)));
m_outputWindow
->
setReadOnly
(
true
);
m_outputWindow
->
setUndoRedoEnabled
(
false
);
m_outputWindow
->
setMaxLineCount
(
MAX_LINECOUNT
);
Aggregation
::
Aggregate
*
agg
=
new
Aggregation
::
Aggregate
;
agg
->
add
(
m_outputWindow
);
...
...
@@ -142,7 +143,7 @@ void CompileOutputWindow::appendText(const QString &text, ProjectExplorer::Build
}
m_outputWindow
->
appendText
(
text
,
textFormat
,
MAX_LINECOUNT
);
m_outputWindow
->
appendText
(
text
,
textFormat
);
}
void
CompileOutputWindow
::
clearContents
()
...
...
src/plugins/projectexplorer/projectexplorer.cpp
View file @
5e6d92dd
...
...
@@ -899,6 +899,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
d
->
m_projectExplorerSettings
.
useJom
=
s
->
value
(
"ProjectExplorer/Settings/UseJom"
,
true
).
toBool
();
d
->
m_projectExplorerSettings
.
autorestoreLastSession
=
s
->
value
(
"ProjectExplorer/Settings/AutoRestoreLastSession"
,
false
).
toBool
();
d
->
m_projectExplorerSettings
.
prompToStopRunControl
=
s
->
value
(
"ProjectExplorer/Settings/PromptToStopRunControl"
,
false
).
toBool
();
d
->
m_projectExplorerSettings
.
maxAppOutputLines
=
s
->
value
(
"ProjectExplorer/Settings/MaxAppOutputLines"
,
100000
).
toInt
();
d
->
m_projectExplorerSettings
.
environmentId
=
QUuid
(
s
->
value
(
"ProjectExplorer/Settings/EnvironmentId"
).
toString
());
if
(
d
->
m_projectExplorerSettings
.
environmentId
.
isNull
())
d
->
m_projectExplorerSettings
.
environmentId
=
QUuid
::
createUuid
();
...
...
@@ -1190,6 +1191,7 @@ void ProjectExplorerPlugin::savePersistentSettings()
s
->
setValue
(
"ProjectExplorer/Settings/UseJom"
,
d
->
m_projectExplorerSettings
.
useJom
);
s
->
setValue
(
"ProjectExplorer/Settings/AutoRestoreLastSession"
,
d
->
m_projectExplorerSettings
.
autorestoreLastSession
);
s
->
setValue
(
"ProjectExplorer/Settings/PromptToStopRunControl"
,
d
->
m_projectExplorerSettings
.
prompToStopRunControl
);
s
->
setValue
(
"ProjectExplorer/Settings/MaxAppOutputLines"
,
d
->
m_projectExplorerSettings
.
maxAppOutputLines
);
s
->
setValue
(
"ProjectExplorer/Settings/EnvironmentId"
,
d
->
m_projectExplorerSettings
.
environmentId
.
toString
());
}
}
...
...
src/plugins/projectexplorer/projectexplorersettings.h
View file @
5e6d92dd
...
...
@@ -45,7 +45,8 @@ struct ProjectExplorerSettings
saveBeforeBuild
(
false
),
showCompilerOutput
(
false
),
showRunOutput
(
true
),
cleanOldAppOutput
(
false
),
wrapAppOutput
(
true
),
useJom
(
true
),
autorestoreLastSession
(
false
),
prompToStopRunControl
(
false
)
autorestoreLastSession
(
false
),
prompToStopRunControl
(
false
),
maxAppOutputLines
(
100000
)
{
}
bool
buildBeforeDeploy
;
...
...
@@ -58,6 +59,7 @@ struct ProjectExplorerSettings
bool
useJom
;
bool
autorestoreLastSession
;
// This option is set in the Session Manager!
bool
prompToStopRunControl
;
int
maxAppOutputLines
;
// Add a UUid which is used to identify the development environment.
// This is used to warn the user when he is trying to open a .user file that was created
...
...
@@ -76,7 +78,8 @@ inline bool operator==(const ProjectExplorerSettings &p1, const ProjectExplorerS
&&
p1
.
wrapAppOutput
==
p2
.
wrapAppOutput
&&
p1
.
useJom
==
p2
.
useJom
&&
p1
.
autorestoreLastSession
==
p2
.
autorestoreLastSession
&&
p1
.
prompToStopRunControl
==
p2
.
prompToStopRunControl
;
&&
p1
.
prompToStopRunControl
==
p2
.
prompToStopRunControl
&&
p1
.
maxAppOutputLines
==
p2
.
maxAppOutputLines
;
}
}
// namespace ProjectExplorer
...
...
src/plugins/projectexplorer/projectexplorersettingspage.cpp
View file @
5e6d92dd
...
...
@@ -77,6 +77,7 @@ ProjectExplorerSettings ProjectExplorerSettingsWidget::settings() const
pes
.
wrapAppOutput
=
m_ui
.
wrapAppOutputCheckBox
->
isChecked
();
pes
.
useJom
=
m_ui
.
jomCheckbox
->
isChecked
();
pes
.
prompToStopRunControl
=
m_ui
.
promptToStopRunControlCheckBox
->
isChecked
();
pes
.
maxAppOutputLines
=
m_ui
.
maxAppOutputBox
->
value
();
return
pes
;
}
...
...
@@ -91,6 +92,7 @@ void ProjectExplorerSettingsWidget::setSettings(const ProjectExplorerSettings &
m_ui
.
wrapAppOutputCheckBox
->
setChecked
(
pes
.
wrapAppOutput
);
m_ui
.
jomCheckbox
->
setChecked
(
pes
.
useJom
);
m_ui
.
promptToStopRunControlCheckBox
->
setChecked
(
pes
.
prompToStopRunControl
);
m_ui
.
maxAppOutputBox
->
setValue
(
pes
.
maxAppOutputLines
);
}
QString
ProjectExplorerSettingsWidget
::
projectsDirectory
()
const
...
...
src/plugins/projectexplorer/projectexplorersettingspage.ui
View file @
5e6d92dd
...
...
@@ -6,7 +6,7 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
313
</width>
<width>
447
</width>
<height>
491
</height>
</rect>
</property>
...
...
@@ -21,7 +21,7 @@
<enum>
QFormLayout::ExpandingFieldsGrow
</enum>
</property>
<item
row=
"1"
column=
"1"
>
<widget
class=
"Utils::PathChooser"
name=
"projectsDirectoryPathChooser"
native=
"true"
/>
<widget
class=
"Utils::PathChooser"
name=
"projectsDirectoryPathChooser"
/>
</item>
<item
row=
"0"
column=
"0"
colspan=
"2"
>
<widget
class=
"QRadioButton"
name=
"currentDirectoryRadioButton"
>
...
...
@@ -29,7 +29,7 @@
<string>
Current directory
</string>
</property>
<attribute
name=
"buttonGroup"
>
<string>
directoryButtonGroup
</string>
<string
notr=
"true"
>
directoryButtonGroup
</string>
</attribute>
</widget>
</item>
...
...
@@ -42,7 +42,7 @@
<bool>
true
</bool>
</property>
<attribute
name=
"buttonGroup"
>
<string>
directoryButtonGroup
</string>
<string
notr=
"true"
>
directoryButtonGroup
</string>
</attribute>
</widget>
</item>
...
...
@@ -104,6 +104,58 @@
</property>
</widget>
</item>
<item>
<widget
class=
"QWidget"
name=
"widget"
native=
"true"
>
<layout
class=
"QHBoxLayout"
name=
"horizontalLayout"
>
<property
name=
"margin"
>
<number>
0
</number>
</property>
<item>
<widget
class=
"QLabel"
name=
"label"
>
<property
name=
"text"
>
<string>
Limit application output to
</string>
</property>
</widget>
</item>
<item>
<widget
class=
"QSpinBox"
name=
"maxAppOutputBox"
>
<property
name=
"minimum"
>
<number>
500
</number>
</property>
<property
name=
"maximum"
>
<number>
1000000
</number>
</property>
<property
name=
"singleStep"
>
<number>
500
</number>
</property>
<property
name=
"value"
>
<number>
100000
</number>
</property>
</widget>
</item>
<item>
<widget
class=
"QLabel"
name=
"label_2"
>
<property
name=
"text"
>
<string>
lines
</string>
</property>
</widget>
</item>
<item>
<spacer
name=
"horizontalSpacer"
>
<property
name=
"orientation"
>
<enum>
Qt::Horizontal
</enum>
</property>
<property
name=
"sizeHint"
stdset=
"0"
>
<size>
<width>
40
</width>
<height>
20
</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget
class=
"QCheckBox"
name=
"promptToStopRunControlCheckBox"
>
<property
name=
"toolTip"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment