Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
c3c54d13
Commit
c3c54d13
authored
May 06, 2016
by
dogmaphobic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reformatting message window text.
parent
770ece07
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
9 deletions
+14
-9
UASMessageHandler.cc
src/uas/UASMessageHandler.cc
+4
-4
MainWindowInner.qml
src/ui/MainWindowInner.qml
+10
-5
No files found.
src/uas/UASMessageHandler.cc
View file @
c3c54d13
...
...
@@ -145,17 +145,17 @@ void UASMessageHandler::handleTextMessage(int, int compId, int severity, QString
case
MAV_SEVERITY_ALERT
:
case
MAV_SEVERITY_CRITICAL
:
case
MAV_SEVERITY_ERROR
:
style
=
QString
(
"
color: #f95e5e; font-weight:bold
"
);
style
=
QString
(
"
<#E>
"
);
_errorCount
++
;
_errorCountTotal
++
;
break
;
case
MAV_SEVERITY_NOTICE
:
case
MAV_SEVERITY_WARNING
:
style
=
QString
(
"
color: #f9b55e; font-weight:bold
"
);
style
=
QString
(
"
<#I>
"
);
_warningCount
++
;
break
;
default:
style
=
QString
(
"
color: #ffffff; font-weight:bold
"
);
style
=
QString
(
"
<#N>
"
);
_normalCount
++
;
break
;
}
...
...
@@ -200,7 +200,7 @@ void UASMessageHandler::handleTextMessage(int, int compId, int severity, QString
if
(
_multiComp
)
{
compString
=
QString
(
" COMP:%1"
).
arg
(
compId
);
}
message
->
_setFormatedText
(
QString
(
"<
p><font style=
\"
%1
\"
>[%2%3]%4 %5</font></p
>"
).
arg
(
style
).
arg
(
dateString
).
arg
(
compString
).
arg
(
severityText
).
arg
(
text
));
message
->
_setFormatedText
(
QString
(
"<
font style=
\"
%1
\"
>[%2%3]%4 %5</font><br/
>"
).
arg
(
style
).
arg
(
dateString
).
arg
(
compString
).
arg
(
severityText
).
arg
(
text
));
if
(
message
->
severityIsError
())
{
_latestError
=
severityText
+
" "
+
text
;
...
...
src/ui/MainWindowInner.qml
View file @
c3c54d13
...
...
@@ -229,9 +229,16 @@ Item {
}
}
function
formatMessage
(
message
)
{
message
=
message
.
replace
(
new
RegExp
(
"
<#E>
"
,
"
g
"
),
"
color: #f95e5e; font:
"
+
(
ScreenTools
.
defaultFontPointSize
.
toFixed
(
0
)
-
1
)
+
"
pt monospace;
"
);
message
=
message
.
replace
(
new
RegExp
(
"
<#I>
"
,
"
g
"
),
"
color: #f9b55e; font:
"
+
(
ScreenTools
.
defaultFontPointSize
.
toFixed
(
0
)
-
1
)
+
"
pt monospace;
"
);
message
=
message
.
replace
(
new
RegExp
(
"
<#N>
"
,
"
g
"
),
"
color: #ffffff; font:
"
+
(
ScreenTools
.
defaultFontPointSize
.
toFixed
(
0
)
-
1
)
+
"
pt monospace;
"
);
return
message
;
}
onFormatedMessageChanged
:
{
if
(
messageArea
.
visible
)
{
messageText
.
append
(
format
edMessage
)
messageText
.
append
(
format
Message
(
formatedMessage
)
)
//-- Hack to scroll down
messageFlick
.
flick
(
0
,
-
500
)
}
...
...
@@ -242,7 +249,7 @@ Item {
currentPopUp
.
close
()
}
if
(
QGroundControl
.
multiVehicleManager
.
activeVehicleAvailable
)
{
messageText
.
text
=
activeVehicle
.
formatedMessages
messageText
.
text
=
formatMessage
(
activeVehicle
.
formatedMessages
)
//-- Hack to scroll to last message
for
(
var
i
=
0
;
i
<
activeVehicle
.
messageCount
;
i
++
)
messageFlick
.
flick
(
0
,
-
5000
)
...
...
@@ -372,13 +379,11 @@ Item {
readOnly
:
true
textFormat
:
TextEdit
.
RichText
color
:
"
white
"
font.family
:
ScreenTools
.
normalFontFamily
font.pointSize
:
ScreenTools
.
defaultFontPointSize
}
}
//-- Dismiss System Message
Image
{
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
//
anchors.margins: ScreenTools.defaultFontPixelHeight
anchors.top
:
parent
.
top
anchors.right
:
parent
.
right
width
:
ScreenTools
.
defaultFontPixelHeight
*
1.5
...
...
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