From 2cddf137e3c785dc9efbe7e12b90d239d8eaa958 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 14 Mar 2011 17:37:56 +0200 Subject: STORM-971 FIXED Disable the 'Stop Tracking' menu item in Mini-map floater when tracking gets stopped. - Removed the menu from LLFloaterMap (the mini-map floater) that had conflicted with the one in the LLNetMap widget. - Fixed updating of the "Stop Tracking" menu item; moved that code out of draw() to avoid excessive updates. - Preventively fixed LLTracker::isTracking() to return strictly 1 or 0 (BOOL is known to cause hard-to-debug side effects with values > 1 because it's essentially just an int and thus doesn't enforce any limitations on the value). --- indra/newview/llnetmap.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'indra/newview/llnetmap.cpp') diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 93039d935d..81b3c49906 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -112,10 +112,6 @@ BOOL LLNetMap::postBuild() registrar.add("Minimap.Tracker", boost::bind(&LLNetMap::handleStopTracking, this, _2)); mPopupMenu = LLUICtrlFactory::getInstance()->createFromFile("menu_mini_map.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); - if (mPopupMenu && !LLTracker::isTracking(0)) - { - mPopupMenu->setItemEnabled ("Stop Tracking", false); - } return TRUE; } @@ -510,13 +506,6 @@ void LLNetMap::draw() gGL.popUIMatrix(); LLUICtrl::draw(); - - if (LLTracker::isTracking(0)) - { - mPopupMenu->setItemEnabled ("Stop Tracking", true); - } - - } void LLNetMap::reshape(S32 width, S32 height, BOOL called_from_parent) @@ -886,6 +875,7 @@ BOOL LLNetMap::handleRightMouseDown(S32 x, S32 y, MASK mask) { mPopupMenu->buildDrawLabels(); mPopupMenu->updateParent(LLMenuGL::sMenuContainer); + mPopupMenu->setItemEnabled("Stop Tracking", LLTracker::isTracking(0)); LLMenuGL::showPopup(this, mPopupMenu, x, y); } return TRUE; -- cgit v1.2.3