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
da19aa2d
Commit
da19aa2d
authored
Mar 12, 2014
by
VArdulov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fising the Message View and a Comment
parent
af086fa5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
QGCMessageView.cc
src/ui/uas/QGCMessageView.cc
+6
-6
No files found.
src/ui/uas/QGCMessageView.cc
View file @
da19aa2d
...
...
@@ -23,7 +23,7 @@ QGCMessageView::QGCMessageView(QWidget *parent) :
ui
->
plainTextEdit
->
hide
();
// Enable the right-click menu for the text editor. This works because the plainTextEdit
// widget has its context menu policy set to its actions list. So
we
any actions we add
// widget has its context menu policy set to its actions list. So any actions we add
// to this widget's action list will be automatically displayed.
// We only have the clear action right now.
QAction
*
clearAction
=
new
QAction
(
tr
(
"Clear Text"
),
this
);
...
...
@@ -86,7 +86,7 @@ void QGCMessageView::handleTextMessage(int uasid, int compId, int severity, QStr
// Get all the UAS info.
UASInterface
*
uas
=
UASManager
::
instance
()
->
getUASForId
(
uasid
);
QString
uasName
(
uas
->
getUASName
());
//
QString uasName(uas->getUASName());
QString
colorName
(
uas
->
getColor
().
name
());
// Color the output depending on the message severity. We have 3 distinct cases:
...
...
@@ -106,12 +106,12 @@ void QGCMessageView::handleTextMessage(int uasid, int compId, int severity, QStr
GAudioOutput
::
instance
()
->
say
(
text
.
toLower
());
style
=
QString
(
"color:#DC143C; font-weight:bold"
);
break
;
case
MAV_SEVERITY_WARNING
:
case
MAV_SEVERITY_NOTICE
:
case
MAV_SEVERITY_WARNING
:
style
=
QString
(
"color:%1; font-weight:bold"
).
arg
(
colorName
);
break
;
default:
style
=
QString
(
"color:
%1
; font-weight:bold"
).
arg
(
colorName
);
style
=
QString
(
"color:
white
; font-weight:bold"
).
arg
(
colorName
);
break
;
}
...
...
@@ -149,8 +149,8 @@ void QGCMessageView::handleTextMessage(int uasid, int compId, int severity, QStr
}
// Finally append the properly-styled text with a timestamp.
QString
dateString
=
QDateTime
::
currentDateTime
().
toString
(
Qt
::
SystemLocaleShortDate
);
msgWidget
->
appendHtml
(
QString
(
"<p style=
\"
color:#CCCCCC
\"
>[%2 -
%3:%4]<font style=
\"
%1
\"
>%5 %6</font></p>"
).
arg
(
style
).
arg
(
dateString
).
arg
(
uasName
).
arg
(
compId
).
arg
(
severityText
).
arg
(
text
));
QString
dateString
=
QDateTime
::
currentDateTime
().
toString
(
"hh:mm:ss.zzz"
);
msgWidget
->
appendHtml
(
QString
(
"<p style=
\"
color:#CCCCCC
\"
>[%2 -
COMP:%4]<font style=
\"
%1
\"
>%5 %6</font></p>"
).
arg
(
style
).
arg
(
dateString
).
arg
(
compId
).
arg
(
severityText
).
arg
(
text
));
// Ensure text area scrolls correctly
scroller
->
setValue
(
scroller
->
maximum
());
...
...
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