summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelplaces.cpp
diff options
context:
space:
mode:
authorAndrew Polunin <apolunin@productengine.com>2010-05-11 11:34:36 +0300
committerAndrew Polunin <apolunin@productengine.com>2010-05-11 11:34:36 +0300
commitb46ba199fffbcbf70a42b28d2fa6b72d38d77771 (patch)
treec989ac21897a0b5d2ab6a87b0434f508d0cb2d5b /indra/newview/llpanelplaces.cpp
parent9027f4430ddd9817f40b59c463d81a8cc3783c58 (diff)
EXT-7075 FIXED Map button now is always enabled and shows current user location if no other item is selected
- Added new pure virtual member function isSingleItemSelected() to the LLPanelPlacesTab. It is used in the LLPanelPlaces class inside onShowOnMapButtonClicked() to check if something was selected on the active panel. If so then selection is shown on the world map. Otherwise current agent position is shown on the world map. - Implemented isSingleItemSelected() in the both LLPanelPlacesTab derived classes: LLLandmarksPanel and LLTeleportHistoryPanel - Removed functionality which disables Map button if no selection is made Reviewed by Sergey Litovchuk at https://codereview.productengine.com/secondlife/r/355/ --HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llpanelplaces.cpp')
-rw-r--r--indra/newview/llpanelplaces.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp
index 51a11e97e4..028440562d 100644
--- a/indra/newview/llpanelplaces.cpp
+++ b/indra/newview/llpanelplaces.cpp
@@ -615,8 +615,21 @@ void LLPanelPlaces::onShowOnMapButtonClicked()
}
else
{
- if (mActivePanel)
+ if (mActivePanel && mActivePanel->isSingleItemSelected())
+ {
mActivePanel->onShowOnMap();
+ }
+ else
+ {
+ LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance();
+ LLVector3d global_pos = gAgent.getPositionGlobal();
+
+ if (!global_pos.isExactlyZero() && worldmap_instance)
+ {
+ worldmap_instance->trackLocation(global_pos);
+ LLFloaterReg::showInstance("world_map", "center");
+ }
+ }
}
}
@@ -1072,7 +1085,6 @@ void LLPanelPlaces::updateVerbs()
mCloseBtn->setVisible(is_create_landmark_visible && !isLandmarkEditModeOn);
mPlaceInfoBtn->setVisible(!is_place_info_visible && !is_create_landmark_visible && !isLandmarkEditModeOn);
- mShowOnMapBtn->setEnabled(!is_create_landmark_visible && !isLandmarkEditModeOn && have_3d_pos);
mPlaceInfoBtn->setEnabled(!is_create_landmark_visible && !isLandmarkEditModeOn && have_3d_pos);
if (is_place_info_visible)