From 2416955250d512b1f579a164e062475a068e9feb Mon Sep 17 00:00:00 2001 From: lm Date: Wed, 27 Jul 2011 07:48:55 +0200 Subject: [PATCH] Added trail clear button --- src/ui/map/QGCMapToolBar.cc | 1 + src/ui/map/QGCMapToolBar.ui | 11 +++++++++-- src/ui/map/QGCMapWidget.h | 8 ++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/ui/map/QGCMapToolBar.cc b/src/ui/map/QGCMapToolBar.cc index 7627eab77..eebc1f75e 100644 --- a/src/ui/map/QGCMapToolBar.cc +++ b/src/ui/map/QGCMapToolBar.cc @@ -24,6 +24,7 @@ void QGCMapToolBar::setMap(QGCMapWidget* map) connect(ui->goToButton, SIGNAL(clicked()), map, SLOT(showGoToDialog())); connect(ui->goHomeButton, SIGNAL(clicked()), map, SLOT(goHome())); connect(ui->lastPosButton, SIGNAL(clicked()), map, SLOT(loadSettings())); + connect(ui->clearTrailsButton, SIGNAL(clicked()), map, SLOT(deleteTrails())); connect(map, SIGNAL(OnTileLoadStart()), this, SLOT(tileLoadStart())); connect(map, SIGNAL(OnTileLoadComplete()), this, SLOT(tileLoadEnd())); connect(map, SIGNAL(OnTilesStillToLoad(int)), this, SLOT(tileLoadProgress(int))); diff --git a/src/ui/map/QGCMapToolBar.ui b/src/ui/map/QGCMapToolBar.ui index ccb3561d6..e75c9c49b 100644 --- a/src/ui/map/QGCMapToolBar.ui +++ b/src/ui/map/QGCMapToolBar.ui @@ -6,14 +6,14 @@ 0 0 - 693 + 695 35 Form - + 12 @@ -55,6 +55,13 @@ + + + + Clear Trails + + + diff --git a/src/ui/map/QGCMapWidget.h b/src/ui/map/QGCMapWidget.h index be22ae275..d1d34e4b8 100644 --- a/src/ui/map/QGCMapWidget.h +++ b/src/ui/map/QGCMapWidget.h @@ -98,6 +98,14 @@ public slots: } } } + /** @brief Delete all trails */ + void deleteTrails() + { + foreach(mapcontrol::UAVItem* uav, GetUAVS()) + { + uav->DeleteTrail(); + } + } /** @brief Load the settings for this widget from disk */ void loadSettings(bool changePosition=true); -- 2.22.0