File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff 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 ();
You can’t perform that action at this time.
0 commit comments