summaryrefslogtreecommitdiff
path: root/indra/newview/llpanellandmarks.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2009-08-05 16:10:15 -0400
committerNat Goodspeed <nat@lindenlab.com>2009-08-05 16:10:15 -0400
commit07129bf928f79246849e66b396fab44a7a228216 (patch)
treee4e19b342540450ff84dad75f90d5acb5b3d6269 /indra/newview/llpanellandmarks.cpp
parent03ebc43132331b9a8dcb3c418ec9c319a6beddda (diff)
parentdc62495da6e5c153c0df57fdbce6b0f40c0208f2 (diff)
Merge recent changes
Diffstat (limited to 'indra/newview/llpanellandmarks.cpp')
-rw-r--r--indra/newview/llpanellandmarks.cpp47
1 files changed, 37 insertions, 10 deletions
diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp
index 24b4082630..7bf7ceb6d2 100644
--- a/indra/newview/llpanellandmarks.cpp
+++ b/indra/newview/llpanellandmarks.cpp
@@ -31,12 +31,15 @@
#include "llviewerprecompiledheaders.h"
+#include "llpanellandmarks.h"
+
+#include "llbutton.h"
#include "llfloaterreg.h"
#include "lllandmark.h"
#include "llfloaterworldmap.h"
+#include "llfoldervieweventlistener.h"
#include "lllandmarklist.h"
-#include "llpanellandmarks.h"
#include "llsidetray.h"
#include "lltabcontainer.h"
#include "llworldmap.h"
@@ -138,9 +141,10 @@ void LLLandmarksPanel::onShowOnMap()
if (!landmark->getGlobalPos(landmark_global_pos))
return;
- if (!landmark_global_pos.isExactlyZero())
+ LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance();
+ if (!landmark_global_pos.isExactlyZero() && worldmap_instance)
{
- LLFloaterWorldMap::getInstance()->trackLocation(landmark_global_pos);
+ worldmap_instance->trackLocation(landmark_global_pos);
LLFloaterReg::showInstance("world_map", "center");
}
}
@@ -157,8 +161,6 @@ void LLLandmarksPanel::onTeleport()
{
listenerp->openItem();
}
-
- togglePanelPlacesButtons(TRUE);
}
/*
@@ -195,6 +197,28 @@ void LLLandmarksPanel::onCopySLURL()
}
*/
+// virtual
+void LLLandmarksPanel::updateVerbs()
+{
+ if (!isTabVisible())
+ return;
+
+ BOOL enabled = FALSE;
+
+ LLFolderViewItem* current_item = mInventoryPanel->getRootFolder()->getCurSelectedItem();
+ if (current_item)
+ {
+ LLFolderViewEventListener* listenerp = current_item->getListener();
+ if (listenerp->getInventoryType() == LLInventoryType::IT_LANDMARK)
+ {
+ enabled = TRUE;
+ }
+ }
+
+ mTeleportBtn->setEnabled(enabled);
+ mShowOnMapBtn->setEnabled(enabled);
+}
+
void LLLandmarksPanel::onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action)
{
LLFolderViewItem* current_item = mInventoryPanel->getRootFolder()->getCurSelectedItem();
@@ -224,16 +248,14 @@ void LLLandmarksPanel::onSelectionChange(const std::deque<LLFolderViewItem*> &it
if (!mActionBtn->getVisible())
mActionBtn->setVisible(TRUE);
-
- togglePanelPlacesButtons(TRUE);
}
else
{
if (mActionBtn->getVisible())
mActionBtn->setVisible(FALSE);
-
- togglePanelPlacesButtons(FALSE);
}
+
+ updateVerbs();
}
void LLLandmarksPanel::onSelectorButtonClicked()
@@ -244,9 +266,14 @@ void LLLandmarksPanel::onSelectorButtonClicked()
if (listenerp->getInventoryType() == LLInventoryType::IT_LANDMARK)
{
LLSD key;
- key["type"] = LLPanelPlaces::LANDMARK;
+ key["type"] = "landmark";
key["id"] = listenerp->getUUID();
LLSideTray::getInstance()->showPanel("panel_places", key);
}
}
+
+void LLLandmarksPanel::setSelectedItem(const LLUUID& obj_id)
+{
+ mInventoryPanel->setSelection(obj_id, FALSE);
+}