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
e95c0951
Commit
e95c0951
authored
Apr 11, 2019
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor message system and fix typos/errors
parent
e55deea4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
36 additions
and
37 deletions
+36
-37
MicrohardSettings.qml
src/Microhard/MicrohardSettings.qml
+1
-1
AppMessages.qml
src/QmlControls/AppMessages.qml
+0
-1
TaisyncSettings.qml
src/Taisync/TaisyncSettings.qml
+1
-1
MainQmlWindow.qml
src/ui/MainQmlWindow.qml
+32
-32
GeneralSettings.qml
src/ui/preferences/GeneralSettings.qml
+1
-1
MessageIndicator.qml
src/ui/toolbar/MessageIndicator.qml
+1
-1
No files found.
src/Microhard/MicrohardSettings.qml
View file @
e95c0951
...
@@ -27,7 +27,7 @@ import QGroundControl.Palette 1.0
...
@@ -27,7 +27,7 @@ import QGroundControl.Palette 1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
SettingsManager
1.0
import
QGroundControl
.
SettingsManager
1.0
Item
{
Rectangle
{
id
:
_root
id
:
_root
color
:
qgcPal
.
window
color
:
qgcPal
.
window
anchors.fill
:
parent
anchors.fill
:
parent
...
...
src/QmlControls/AppMessages.qml
View file @
e95c0951
...
@@ -128,7 +128,6 @@ Item {
...
@@ -128,7 +128,6 @@ Item {
fileExtension
:
qsTr
(
"
txt
"
)
fileExtension
:
qsTr
(
"
txt
"
)
selectExisting
:
false
selectExisting
:
false
title
:
qsTr
(
"
Select log save file
"
)
title
:
qsTr
(
"
Select log save file
"
)
root
:
_root
onAcceptedForSave
:
{
onAcceptedForSave
:
{
debugMessageModel
.
writeMessages
(
file
);
debugMessageModel
.
writeMessages
(
file
);
visible
=
false
;
visible
=
false
;
...
...
src/Taisync/TaisyncSettings.qml
View file @
e95c0951
...
@@ -27,7 +27,7 @@ import QGroundControl.Palette 1.0
...
@@ -27,7 +27,7 @@ import QGroundControl.Palette 1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
SettingsManager
1.0
import
QGroundControl
.
SettingsManager
1.0
Item
{
Rectangle
{
id
:
_root
id
:
_root
color
:
qgcPal
.
window
color
:
qgcPal
.
window
anchors.fill
:
parent
anchors.fill
:
parent
...
...
src/ui/MainQmlWindow.qml
View file @
e95c0951
...
@@ -429,7 +429,7 @@ ApplicationWindow {
...
@@ -429,7 +429,7 @@ ApplicationWindow {
}
}
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
//--
System
Messages
//--
Vehicle
Messages
function
formatMessage
(
message
)
{
function
formatMessage
(
message
)
{
message
=
message
.
replace
(
new
RegExp
(
"
<#E>
"
,
"
g
"
),
"
color:
"
+
qgcPal
.
warningText
+
"
; font:
"
+
(
ScreenTools
.
defaultFontPointSize
.
toFixed
(
0
)
-
1
)
+
"
pt monospace;
"
);
message
=
message
.
replace
(
new
RegExp
(
"
<#E>
"
,
"
g
"
),
"
color:
"
+
qgcPal
.
warningText
+
"
; font:
"
+
(
ScreenTools
.
defaultFontPointSize
.
toFixed
(
0
)
-
1
)
+
"
pt monospace;
"
);
...
@@ -438,8 +438,8 @@ ApplicationWindow {
...
@@ -438,8 +438,8 @@ ApplicationWindow {
return
message
;
return
message
;
}
}
function
show
MessageArea
()
{
function
show
VehicleMessages
()
{
if
(
!
m
essageArea
.
visible
)
{
if
(
!
vehicleM
essageArea
.
visible
)
{
if
(
QGroundControl
.
multiVehicleManager
.
activeVehicleAvailable
)
{
if
(
QGroundControl
.
multiVehicleManager
.
activeVehicleAvailable
)
{
messageText
.
text
=
formatMessage
(
activeVehicle
.
formatedMessages
)
messageText
.
text
=
formatMessage
(
activeVehicle
.
formatedMessages
)
//-- Hack to scroll to last message
//-- Hack to scroll to last message
...
@@ -449,12 +449,12 @@ ApplicationWindow {
...
@@ -449,12 +449,12 @@ ApplicationWindow {
}
else
{
}
else
{
messageText
.
text
=
qsTr
(
"
No Messages
"
)
messageText
.
text
=
qsTr
(
"
No Messages
"
)
}
}
m
essageArea
.
open
()
vehicleM
essageArea
.
open
()
}
}
}
}
onFormatedMessageChanged
:
{
onFormatedMessageChanged
:
{
if
(
m
essageArea
.
visible
)
{
if
(
vehicleM
essageArea
.
visible
)
{
messageText
.
append
(
formatMessage
(
formatedMessage
))
messageText
.
append
(
formatMessage
(
formatedMessage
))
//-- Hack to scroll down
//-- Hack to scroll down
messageFlick
.
flick
(
0
,
-
500
)
messageFlick
.
flick
(
0
,
-
500
)
...
@@ -462,7 +462,7 @@ ApplicationWindow {
...
@@ -462,7 +462,7 @@ ApplicationWindow {
}
}
Popup
{
Popup
{
id
:
m
essageArea
id
:
vehicleM
essageArea
width
:
mainWindow
.
width
*
0.666
width
:
mainWindow
.
width
*
0.666
height
:
mainWindow
.
height
*
0.666
height
:
mainWindow
.
height
*
0.666
modal
:
true
modal
:
true
...
@@ -490,7 +490,7 @@ ApplicationWindow {
...
@@ -490,7 +490,7 @@ ApplicationWindow {
color
:
qgcPal
.
text
color
:
qgcPal
.
text
}
}
}
}
//-- Dismiss
System Message
//-- Dismiss
Vehicle Messages
QGCColoredImage
{
QGCColoredImage
{
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
anchors.top
:
parent
.
top
anchors.top
:
parent
.
top
...
@@ -507,7 +507,7 @@ ApplicationWindow {
...
@@ -507,7 +507,7 @@ ApplicationWindow {
anchors.fill
:
parent
anchors.fill
:
parent
anchors.margins
:
ScreenTools
.
isMobile
?
-
ScreenTools
.
defaultFontPixelHeight
:
0
anchors.margins
:
ScreenTools
.
isMobile
?
-
ScreenTools
.
defaultFontPixelHeight
:
0
onClicked
:
{
onClicked
:
{
m
essageArea
.
close
()
vehicleM
essageArea
.
close
()
}
}
}
}
}
}
...
@@ -529,7 +529,7 @@ ApplicationWindow {
...
@@ -529,7 +529,7 @@ ApplicationWindow {
onClicked
:
{
onClicked
:
{
if
(
QGroundControl
.
multiVehicleManager
.
activeVehicleAvailable
)
{
if
(
QGroundControl
.
multiVehicleManager
.
activeVehicleAvailable
)
{
activeVehicle
.
clearMessages
();
activeVehicle
.
clearMessages
();
m
essageArea
.
close
()
vehicleM
essageArea
.
close
()
}
}
}
}
}
}
...
@@ -537,17 +537,18 @@ ApplicationWindow {
...
@@ -537,17 +537,18 @@ ApplicationWindow {
}
}
//-------------------------------------------------------------------------
//-------------------------------------------------------------------------
//--
Critical
System Messages
//-- System Messages
property
var
_messageQueue
:
[]
property
var
_messageQueue
:
[]
property
string
_
critical
Message
:
""
property
string
_
system
Message
:
""
function
showMessage
(
message
)
{
function
showMessage
(
message
)
{
if
(
criticalMmessageArea
.
visible
||
QGroundControl
.
videoManager
.
fullScreen
)
{
vehicleMessageArea
.
close
()
if
(
systemMessageArea
.
visible
||
QGroundControl
.
videoManager
.
fullScreen
)
{
_messageQueue
.
push
(
message
)
_messageQueue
.
push
(
message
)
}
else
{
}
else
{
_
critical
Message
=
message
_
system
Message
=
message
criticalMm
essageArea
.
open
()
systemM
essageArea
.
open
()
}
}
}
}
...
@@ -560,11 +561,11 @@ ApplicationWindow {
...
@@ -560,11 +561,11 @@ ApplicationWindow {
}
}
Popup
{
Popup
{
id
:
criticalMm
essageArea
id
:
systemM
essageArea
y
:
ScreenTools
.
defaultFontPixelHeight
y
:
ScreenTools
.
defaultFontPixelHeight
x
:
(
mainWindow
.
width
-
width
)
*
0.5
x
:
(
mainWindow
.
width
-
width
)
*
0.5
width
:
mainWindow
.
width
*
0.55
width
:
mainWindow
.
width
*
0.55
height
:
Math
.
min
(
criticalMessageText
.
height
+
(
ScreenTools
.
defaultFontPixelHeight
*
2
),
ScreenTools
.
defaultFontPixelHeight
*
6
)
height
:
ScreenTools
.
defaultFontPixelHeight
*
6
modal
:
false
modal
:
false
focus
:
true
focus
:
true
closePolicy
:
Popup
.
CloseOnEscape
closePolicy
:
Popup
.
CloseOnEscape
...
@@ -578,40 +579,39 @@ ApplicationWindow {
...
@@ -578,40 +579,39 @@ ApplicationWindow {
}
}
onOpened
:
{
onOpened
:
{
console
.
log
(
'
Critical Message:
'
+
mainWindow
.
_criticalMessage
)
systemMessageText
.
text
=
mainWindow
.
_systemMessage
criticalMessageText
.
text
=
mainWindow
.
_criticalMessage
}
}
onClosed
:
{
onClosed
:
{
//-- Are there messages in the waiting queue?
//-- Are there messages in the waiting queue?
if
(
mainWindow
.
_messageQueue
.
length
)
{
if
(
mainWindow
.
_messageQueue
.
length
)
{
mainWindow
.
_
critical
Message
=
""
mainWindow
.
_
system
Message
=
""
//-- Show all messages in queue
//-- Show all messages in queue
for
(
var
i
=
0
;
i
<
mainWindow
.
_messageQueue
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
mainWindow
.
_messageQueue
.
length
;
i
++
)
{
var
text
=
mainWindow
.
_messageQueue
[
i
]
var
text
=
mainWindow
.
_messageQueue
[
i
]
mainWindow
.
_
critical
Message
.
append
(
text
)
mainWindow
.
_
system
Message
.
append
(
text
)
}
}
//-- Clear it
//-- Clear it
mainWindow
.
_messageQueue
=
[]
mainWindow
.
_messageQueue
=
[]
criticalMm
essageArea
.
open
()
systemM
essageArea
.
open
()
}
else
{
}
else
{
mainWindow
.
_
critical
Message
=
""
mainWindow
.
_
system
Message
=
""
}
}
}
}
Flickable
{
Flickable
{
id
:
critical
MessageFlick
id
:
system
MessageFlick
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
anchors.fill
:
parent
anchors.fill
:
parent
contentHeight
:
critical
MessageText
.
height
contentHeight
:
system
MessageText
.
height
contentWidth
:
critical
MessageText
.
width
contentWidth
:
system
MessageText
.
width
boundsBehavior
:
Flickable
.
StopAtBounds
boundsBehavior
:
Flickable
.
StopAtBounds
pixelAligned
:
true
pixelAligned
:
true
clip
:
true
clip
:
true
TextEdit
{
TextEdit
{
id
:
critical
MessageText
id
:
system
MessageText
width
:
criticalMmessageArea
.
width
-
critical
Close
.
width
-
(
ScreenTools
.
defaultFontPixelHeight
*
2
)
width
:
systemMessageArea
.
width
-
systemMessage
Close
.
width
-
(
ScreenTools
.
defaultFontPixelHeight
*
2
)
anchors.
left
:
parent
.
lef
t
anchors.
centerIn
:
paren
t
readOnly
:
true
readOnly
:
true
textFormat
:
TextEdit
.
RichText
textFormat
:
TextEdit
.
RichText
font.pointSize
:
ScreenTools
.
defaultFontPointSize
font.pointSize
:
ScreenTools
.
defaultFontPointSize
...
@@ -623,7 +623,7 @@ ApplicationWindow {
...
@@ -623,7 +623,7 @@ ApplicationWindow {
//-- Dismiss Critical Message
//-- Dismiss Critical Message
QGCColoredImage
{
QGCColoredImage
{
id
:
critical
Close
id
:
systemMessage
Close
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
anchors.top
:
parent
.
top
anchors.top
:
parent
.
top
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
...
@@ -637,7 +637,7 @@ ApplicationWindow {
...
@@ -637,7 +637,7 @@ ApplicationWindow {
anchors.fill
:
parent
anchors.fill
:
parent
anchors.margins
:
ScreenTools
.
isMobile
?
-
ScreenTools
.
defaultFontPixelHeight
:
0
anchors.margins
:
ScreenTools
.
isMobile
?
-
ScreenTools
.
defaultFontPixelHeight
:
0
onClicked
:
{
onClicked
:
{
criticalMm
essageArea
.
close
()
systemM
essageArea
.
close
()
}
}
}
}
}
}
...
@@ -652,12 +652,12 @@ ApplicationWindow {
...
@@ -652,12 +652,12 @@ ApplicationWindow {
sourceSize.height
:
width
sourceSize.height
:
width
source
:
"
/res/ArrowDown.svg
"
source
:
"
/res/ArrowDown.svg
"
fillMode
:
Image
.
PreserveAspectFit
fillMode
:
Image
.
PreserveAspectFit
visible
:
critical
MessageText
.
lineCount
>
5
visible
:
system
MessageText
.
lineCount
>
5
color
:
qgcPal
.
alertText
color
:
qgcPal
.
alertText
MouseArea
{
MouseArea
{
anchors.fill
:
parent
anchors.fill
:
parent
onClicked
:
{
onClicked
:
{
critical
MessageFlick
.
flick
(
0
,
-
500
)
system
MessageFlick
.
flick
(
0
,
-
500
)
}
}
}
}
}
}
...
...
src/ui/preferences/GeneralSettings.qml
View file @
e95c0951
...
@@ -24,7 +24,7 @@ import QGroundControl.Palette 1.0
...
@@ -24,7 +24,7 @@ import QGroundControl.Palette 1.0
import
QGroundControl
.
Controllers
1.0
import
QGroundControl
.
Controllers
1.0
import
QGroundControl
.
SettingsManager
1.0
import
QGroundControl
.
SettingsManager
1.0
Item
{
Rectangle
{
id
:
_root
id
:
_root
color
:
qgcPal
.
window
color
:
qgcPal
.
window
anchors.fill
:
parent
anchors.fill
:
parent
...
...
src/ui/toolbar/MessageIndicator.qml
View file @
e95c0951
...
@@ -67,6 +67,6 @@ Item {
...
@@ -67,6 +67,6 @@ Item {
MouseArea
{
MouseArea
{
anchors.fill
:
parent
anchors.fill
:
parent
onClicked
:
mainWindow
.
show
MessageArea
()
onClicked
:
mainWindow
.
show
VehicleMessages
()
}
}
}
}
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