Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
78e89fa5
Commit
78e89fa5
authored
May 19, 2014
by
Lorenz Meier
Browse files
Map toolbar: Ensure status label does not lead to screen flickering
parent
d4e5dabf
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/ui/map/QGCMapToolBar.cc
View file @
78e89fa5
...
...
@@ -12,7 +12,8 @@ QGCMapToolBar::QGCMapToolBar(QWidget *parent) :
mapTypesMenu
(
this
),
trailSettingsGroup
(
new
QActionGroup
(
this
)),
updateTimesGroup
(
new
QActionGroup
(
this
)),
mapTypesGroup
(
new
QActionGroup
(
this
))
mapTypesGroup
(
new
QActionGroup
(
this
)),
statusMaxLen
(
15
)
{
ui
->
setupUi
(
this
);
}
...
...
@@ -168,11 +169,16 @@ void QGCMapToolBar::setUAVTrailTime()
if
(
ok
)
{
(
map
->
setTrailModeTimed
(
trailTime
));
ui
->
po
sLabel
->
set
Text
(
tr
(
"Trail mode: Every %1 second%2"
).
arg
(
trailTime
).
arg
((
trailTime
>
1
)
?
"s"
:
""
));
setStatu
sLabelText
(
tr
(
"Trail mode: Every %1 second%2"
).
arg
(
trailTime
).
arg
((
trailTime
>
1
)
?
"s"
:
""
));
}
}
}
void
QGCMapToolBar
::
setStatusLabelText
(
const
QString
&
text
)
{
ui
->
posLabel
->
setText
(
text
.
leftJustified
(
statusMaxLen
,
QChar
(
'.'
),
true
));
}
void
QGCMapToolBar
::
setUAVTrailDistance
()
{
QObject
*
sender
=
QObject
::
sender
();
...
...
@@ -185,7 +191,7 @@ void QGCMapToolBar::setUAVTrailDistance()
if
(
ok
)
{
map
->
setTrailModeDistance
(
trailDistance
);
ui
->
po
sLabel
->
set
Text
(
tr
(
"Trail mode: Every %1 meter%2"
).
arg
(
trailDistance
).
arg
((
trailDistance
==
1
)
?
"s"
:
""
));
setStatu
sLabelText
(
tr
(
"Trail mode: Every %1 meter%2"
).
arg
(
trailDistance
).
arg
((
trailDistance
==
1
)
?
"s"
:
""
));
}
}
}
...
...
@@ -202,7 +208,7 @@ void QGCMapToolBar::setUpdateInterval()
if
(
ok
)
{
map
->
setUpdateRateLimit
(
time
);
ui
->
po
sLabel
->
set
Text
(
tr
(
"Limit: %1 second%2"
).
arg
(
time
).
arg
((
time
!=
1.0
f
)
?
"s"
:
""
));
setStatu
sLabelText
(
tr
(
"Limit: %1 second%2"
).
arg
(
time
).
arg
((
time
!=
1.0
f
)
?
"s"
:
""
));
}
}
}
...
...
@@ -219,30 +225,30 @@ void QGCMapToolBar::setMapType()
if
(
ok
)
{
map
->
SetMapType
((
MapType
::
Types
)
mapType
);
ui
->
po
sLabel
->
set
Text
(
tr
(
"Map: %1"
).
arg
(
mapType
));
setStatu
sLabelText
(
tr
(
"Map: %1"
).
arg
(
mapType
));
}
}
}
void
QGCMapToolBar
::
tileLoadStart
()
{
ui
->
po
sLabel
->
set
Text
(
tr
(
"Loading
..
"
));
setStatu
sLabelText
(
tr
(
"Loading"
));
}
void
QGCMapToolBar
::
tileLoadEnd
()
{
ui
->
po
sLabel
->
set
Text
(
tr
(
"Finished"
));
setStatu
sLabelText
(
tr
(
"Finished"
));
}
void
QGCMapToolBar
::
tileLoadProgress
(
int
progress
)
{
if
(
progress
==
1
)
{
ui
->
po
sLabel
->
set
Text
(
tr
(
"1 tile"
));
setStatu
sLabelText
(
tr
(
"1 tile"
));
}
else
if
(
progress
>
0
)
{
ui
->
po
sLabel
->
set
Text
(
tr
(
"%1 tile"
).
arg
(
progress
));
setStatu
sLabelText
(
tr
(
"%1 tile"
).
arg
(
progress
));
}
else
{
...
...
src/ui/map/QGCMapToolBar.h
View file @
78e89fa5
...
...
@@ -29,6 +29,7 @@ public slots:
void
setUAVTrailDistance
();
void
setUpdateInterval
();
void
setMapType
();
void
setStatusLabelText
(
const
QString
&
text
);
private:
Ui
::
QGCMapToolBar
*
ui
;
...
...
@@ -43,6 +44,8 @@ protected:
QActionGroup
*
trailSettingsGroup
;
QActionGroup
*
updateTimesGroup
;
QActionGroup
*
mapTypesGroup
;
unsigned
statusMaxLen
;
};
#endif // QGCMAPTOOLBAR_H
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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