Skip to content

Commit aa8aeed

Browse files
committed
GraphViewer: added Show/Hide global path
1 parent 7aaa469 commit aa8aeed

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

guilib/src/GraphViewer.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,7 @@ void GraphViewer::contextMenuEvent(QContextMenuEvent * event)
868868
QAction * aShowHideOrigin;
869869
QAction * aShowHideReferential;
870870
QAction * aShowHideLocalRadius;
871+
QAction * aClearGlobalPath;
871872
if(_gridMap->isVisible())
872873
{
873874
aShowHideGridMap = menu.addAction(tr("Hide grid map"));
@@ -900,6 +901,15 @@ void GraphViewer::contextMenuEvent(QContextMenuEvent * event)
900901
{
901902
aShowHideLocalRadius = menu.addAction(tr("Show local radius"));
902903
}
904+
if(_globalPathLinkItems.size() && _globalPathLinkItems.begin().value()->isVisible())
905+
{
906+
aClearGlobalPath = menu.addAction(tr("Hide global path"));
907+
}
908+
else
909+
{
910+
aClearGlobalPath = menu.addAction(tr("Show global path"));
911+
}
912+
aClearGlobalPath->setEnabled(_globalPathLinkItems.size());
903913
menu.addSeparator();
904914
QAction * aRestoreDefaults = menu.addAction(tr("Restore defaults"));
905915

@@ -1097,6 +1107,13 @@ void GraphViewer::contextMenuEvent(QContextMenuEvent * event)
10971107
{
10981108
this->restoreDefaults();
10991109
}
1110+
else if(r == aClearGlobalPath)
1111+
{
1112+
for(QMap<int, LinkItem*>::iterator iter=_globalPathLinkItems.begin(); iter!=_globalPathLinkItems.end(); ++iter)
1113+
{
1114+
iter.value()->setVisible(!iter.value()->isVisible());
1115+
}
1116+
}
11001117
if(r)
11011118
{
11021119
emit configChanged();

0 commit comments

Comments
 (0)