diff options
author | Steven Bennetts <steve@lindenlab.com> | 2009-10-19 01:45:44 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2009-10-19 01:45:44 +0000 |
commit | 8103710c054ec6ea4a46f9732e569e543691184b (patch) | |
tree | ac03dd6d385e3345c57eff0e1064a011597fe5d6 /indra/newview/lllandmarkactions.cpp | |
parent | 4ee757b45d527699b094bf9422244171fdd7d693 (diff) |
Merging revisions 2046-2068 of https://svn.aws.productengine.com/secondlife/pe/stable-2 into P:\svn\viewer-2.0.0, respecting ancestry
* Bugs: EXT-1414 EXT-1213 EXT-1539 EXT-1253 EXT-1446 EXT-1438 EXT-1233 EXT-1466 EXT-1446 EXT-1512 EXT-1231
* Dev: EXT-719 (landmarks) EXT-747 EXT-1446 EXT-1378 EXT-397 EXT-1476
* IM changes
Diffstat (limited to 'indra/newview/lllandmarkactions.cpp')
-rw-r--r-- | indra/newview/lllandmarkactions.cpp | 40 |
1 files changed, 33 insertions, 7 deletions
diff --git a/indra/newview/lllandmarkactions.cpp b/indra/newview/lllandmarkactions.cpp index 7c759e22a8..2e6615dd91 100644 --- a/indra/newview/lllandmarkactions.cpp +++ b/indra/newview/lllandmarkactions.cpp @@ -42,16 +42,18 @@ #include "llnotifications.h" #include "llagent.h" +#include "llagentui.h" #include "llinventorymodel.h" #include "lllandmarklist.h" #include "llslurl.h" +#include "llstring.h" #include "llviewerinventory.h" #include "llviewerparcelmgr.h" +#include "llviewerwindow.h" +#include "llwindow.h" #include "llworldmap.h" -#include "lllandmark.h" -#include "llinventorymodel.h" -#include "llagentui.h" +void copy_slurl_to_clipboard_callback(const std::string& slurl); class LLFetchlLandmarkByPos : public LLInventoryCollectFunctor { @@ -303,15 +305,39 @@ void LLLandmarkActions::onRegionResponse(slurl_callback_t cb, bool LLLandmarkActions::getLandmarkGlobalPos(const LLUUID& landmarkInventoryItemID, LLVector3d& posGlobal) { + LLLandmark* landmark = LLLandmarkActions::getLandmark(landmarkInventoryItemID); + + if (NULL == landmark) + return false; + + return landmark->getGlobalPos(posGlobal); +} + +LLLandmark* LLLandmarkActions::getLandmark(const LLUUID& landmarkInventoryItemID) +{ LLViewerInventoryItem* item = gInventory.getItem(landmarkInventoryItemID); if (NULL == item) return false; const LLUUID& asset_id = item->getAssetUUID(); - LLLandmark* landmark = gLandmarkList.getAsset(asset_id, NULL); + return gLandmarkList.getAsset(asset_id, NULL); +} - if (NULL == landmark) - return false; +void LLLandmarkActions::copySLURLtoClipboard(const LLUUID& landmarkInventoryItemID) +{ + LLLandmark* landmark = LLLandmarkActions::getLandmark(landmarkInventoryItemID); + if(landmark) + { + LLVector3d global_pos; + landmark->getGlobalPos(global_pos); + LLLandmarkActions::getSLURLfromPosGlobal(global_pos,©_slurl_to_clipboard_callback,true); + } +} - return landmark->getGlobalPos(posGlobal); +void copy_slurl_to_clipboard_callback(const std::string& slurl) +{ + gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(slurl)); + LLSD args; + args["SLURL"] = slurl; + LLNotifications::instance().add("CopySLURL", args); } |