diff --git a/indra/llinventory/llparcel.h b/indra/llinventory/llparcel.h index 3b39aeb56b3a6503fc932e4ed1020afc30539713..5d08c1f4c69a24249fbb7c20290ffe3cc820f98b 100644 --- a/indra/llinventory/llparcel.h +++ b/indra/llinventory/llparcel.h @@ -295,7 +295,6 @@ class LLParcel void setAllowTerraform(BOOL b){setParcelFlag(PF_ALLOW_TERRAFORM, b); } void setAllowDamage(BOOL b) { setParcelFlag(PF_ALLOW_DAMAGE, b); } void setAllowFly(BOOL b) { setParcelFlag(PF_ALLOW_FLY, b); } - void setAllowLandmark(BOOL b){ setParcelFlag(PF_ALLOW_LANDMARK, b); } void setAllowGroupScripts(BOOL b) { setParcelFlag(PF_ALLOW_GROUP_SCRIPTS, b); } void setAllowOtherScripts(BOOL b) { setParcelFlag(PF_ALLOW_OTHER_SCRIPTS, b); } void setAllowDeedToGroup(BOOL b) { setParcelFlag(PF_ALLOW_DEED_TO_GROUP, b); } @@ -476,11 +475,6 @@ class LLParcel BOOL getAllowFly() const { return (mParcelFlags & PF_ALLOW_FLY) ? TRUE : FALSE; } - // Remove permission restrictions for creating landmarks. - // We should eventually remove this flag completely. - BOOL getAllowLandmark() const - { return TRUE; } - BOOL getAllowGroupScripts() const { return (mParcelFlags & PF_ALLOW_GROUP_SCRIPTS) ? TRUE : FALSE; } diff --git a/indra/llinventory/llparcelflags.h b/indra/llinventory/llparcelflags.h index 25b27a281af89dfd3f01891d2a42103f01714247..4cffa83cc1c2446bcc0d64fab432fa8cb0ff1f38 100644 --- a/indra/llinventory/llparcelflags.h +++ b/indra/llinventory/llparcelflags.h @@ -33,7 +33,7 @@ const U32 PF_ALLOW_FLY = 1 << 0;// Can start flying const U32 PF_ALLOW_OTHER_SCRIPTS= 1 << 1;// Scripts by others can run. const U32 PF_FOR_SALE = 1 << 2;// Can buy this land const U32 PF_FOR_SALE_OBJECTS = 1 << 7;// Can buy all objects on this land -const U32 PF_ALLOW_LANDMARK = 1 << 3; +const U32 PF_ALLOW_LANDMARK = 1 << 3;// Always true/deprecated const U32 PF_ALLOW_TERRAFORM = 1 << 4; const U32 PF_ALLOW_DAMAGE = 1 << 5; const U32 PF_CREATE_OBJECTS = 1 << 6; diff --git a/indra/newview/lllandmarkactions.cpp b/indra/newview/lllandmarkactions.cpp index c243f8b4f0194c8567fbaa6f51dd9f36b1f601cc..a17dc674acb08b460f83af1fa331ff11886eb326 100644 --- a/indra/newview/lllandmarkactions.cpp +++ b/indra/newview/lllandmarkactions.cpp @@ -228,23 +228,6 @@ LLViewerInventoryItem* LLLandmarkActions::findLandmarkForAgentPos() return findLandmarkForGlobalPos(gAgent.getPositionGlobal()); } -bool LLLandmarkActions::canCreateLandmarkHere() -{ - LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - if(!agent_parcel) - { - LL_WARNS() << "No agent region" << LL_ENDL; - return false; - } - if (agent_parcel->getAllowLandmark() - || LLViewerParcelMgr::isParcelOwnedByAgent(agent_parcel, GP_LAND_ALLOW_LANDMARK)) - { - return true; - } - - return false; -} - void LLLandmarkActions::createLandmarkHere( const std::string& name, const std::string& desc, @@ -261,11 +244,6 @@ void LLLandmarkActions::createLandmarkHere( LL_WARNS() << "No agent parcel" << LL_ENDL; return; } - if (!canCreateLandmarkHere()) - { - LLNotificationsUtil::add("CannotCreateLandmarkNotOwner"); - return; - } create_inventory_item(gAgent.getID(), gAgent.getSessionID(), folder_id, LLTransactionID::tnull, diff --git a/indra/newview/lllandmarkactions.h b/indra/newview/lllandmarkactions.h index 870d92811ea2bbac7826d955feec08a272193077..ae7b072fcb381133ad828286f38119e82f2b4d93 100644 --- a/indra/newview/lllandmarkactions.h +++ b/indra/newview/lllandmarkactions.h @@ -72,12 +72,6 @@ class LLLandmarkActions */ static LLViewerInventoryItem* findLandmarkForAgentPos(); - - /** - * @brief Checks whether agent has rights to create landmark for current parcel. - */ - static bool canCreateLandmarkHere(); - /** * @brief Creates landmark for current parcel. */ diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index fe0608d5441594e958547554213017c52425502d..3f5664f431a18c8efcebd014ed08bf1e0cdee0f9 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -396,9 +396,7 @@ LLContextMenu* LLTeleportHistoryPanel::ContextMenu::createMenu() // (N.B. callbacks don't take const refs as mID is local scope) LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; - registrar.add("TeleportHistory.Teleport", boost::bind(&LLTeleportHistoryPanel::ContextMenu::onTeleport, this)); - registrar.add("TeleportHistory.MoreInformation",boost::bind(&LLTeleportHistoryPanel::ContextMenu::onInfo, this)); - registrar.add("TeleportHistory.CopyToClipboard",boost::bind(&LLTeleportHistoryPanel::ContextMenu::onCopyToClipboard, this)); + registrar.add("TeleportHistory.Action", boost::bind(&LLTeleportHistoryPanel::ContextMenu::onUserAction, this, _2)); // create the context menu from the XUI llassert(LLMenuGL::sMenuContainer != NULL); @@ -406,14 +404,27 @@ LLContextMenu* LLTeleportHistoryPanel::ContextMenu::createMenu() "menu_teleport_history_item.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance()); } -void LLTeleportHistoryPanel::ContextMenu::onTeleport() +void LLTeleportHistoryPanel::ContextMenu::onUserAction(const LLSD& userdata) { - confirmTeleport(mIndex); -} - -void LLTeleportHistoryPanel::ContextMenu::onInfo() -{ - LLTeleportHistoryFlatItem::showPlaceInfoPanel(mIndex); + std::string command_name = userdata.asString(); + if ("teleport" == command_name) + { + confirmTeleport(mIndex); + } + else if ("view" == command_name) + { + LLTeleportHistoryFlatItem::showPlaceInfoPanel(mIndex); + } + else if ("show_on_map" == command_name) + { + LLTeleportHistoryStorage::getInstance()->showItemOnMap(mIndex); + } + else if ("copy_slurl" == command_name) + { + LLVector3d globalPos = LLTeleportHistoryStorage::getInstance()->getItems()[mIndex].mGlobalPos; + LLLandmarkActions::getSLURLfromPosGlobal(globalPos, + boost::bind(&LLTeleportHistoryPanel::ContextMenu::gotSLURLCallback, _1)); + } } //static @@ -427,13 +438,6 @@ void LLTeleportHistoryPanel::ContextMenu::gotSLURLCallback(const std::string& sl LLNotificationsUtil::add("CopySLURL", args); } -void LLTeleportHistoryPanel::ContextMenu::onCopyToClipboard() -{ - LLVector3d globalPos = LLTeleportHistoryStorage::getInstance()->getItems()[mIndex].mGlobalPos; - LLLandmarkActions::getSLURLfromPosGlobal(globalPos, - boost::bind(&LLTeleportHistoryPanel::ContextMenu::gotSLURLCallback, _1)); -} - // Not yet implemented; need to remove buildPanel() from constructor when we switch //static LLRegisterPanelClassWrapper<LLTeleportHistoryPanel> t_teleport_history("panel_teleport_history"); diff --git a/indra/newview/llpanelteleporthistory.h b/indra/newview/llpanelteleporthistory.h index b88861c5c632cb3cd50da65a5cb11015b55a0ec5..e0abbc47db00de5a3e406d137d10475c7ec72f0f 100644 --- a/indra/newview/llpanelteleporthistory.h +++ b/indra/newview/llpanelteleporthistory.h @@ -52,9 +52,7 @@ class LLTeleportHistoryPanel : public LLPanelPlacesTab private: LLContextMenu* createMenu(); - void onTeleport(); - void onInfo(); - void onCopyToClipboard(); + void onUserAction(const LLSD& userdata); static void gotSLURLCallback(const std::string& slurl); diff --git a/indra/newview/llteleporthistorystorage.cpp b/indra/newview/llteleporthistorystorage.cpp index 8a5704939a134f54c3ffda1aa2408f571a72c48f..93fa457bd0946b8be2a80ffc14817f4b4a7983c6 100644 --- a/indra/newview/llteleporthistorystorage.cpp +++ b/indra/newview/llteleporthistorystorage.cpp @@ -33,6 +33,8 @@ #include "lldir.h" #include "llteleporthistory.h" #include "llagent.h" +#include "llfloaterreg.h" +#include "llfloaterworldmap.h" // Max offset for two global positions to consider them as equal const F64 MAX_GLOBAL_POS_OFFSET = 5.0f; @@ -253,3 +255,23 @@ void LLTeleportHistoryStorage::goToItem(S32 idx) gAgent.teleportViaLocation(mItems[idx].mGlobalPos); } +void LLTeleportHistoryStorage::showItemOnMap(S32 idx) +{ + // Validate specified index. + if (idx < 0 || idx >= (S32)mItems.size()) + { + LL_WARNS() << "Invalid teleport history index (" << idx << ") specified" << LL_ENDL; + dump(); + return; + } + + LLVector3d landmark_global_pos = mItems[idx].mGlobalPos; + + LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance(); + if (!landmark_global_pos.isExactlyZero() && worldmap_instance) + { + worldmap_instance->trackLocation(landmark_global_pos); + LLFloaterReg::showInstance("world_map", "center"); + } +} + diff --git a/indra/newview/llteleporthistorystorage.h b/indra/newview/llteleporthistorystorage.h index 946ac0af1aaed473bb4fd6e1adce22ae1a985708..3578923fd7dd82e71b91917dd5156d7441446def 100644 --- a/indra/newview/llteleporthistorystorage.h +++ b/indra/newview/llteleporthistorystorage.h @@ -107,6 +107,13 @@ class LLTeleportHistoryStorage: public LLSingleton<LLTeleportHistoryStorage> */ void goToItem(S32 idx); + /** + * Show specific item on map. + * + * The item is specified by its index (starting from 0). + */ + void showItemOnMap(S32 idx); + private: void load(); diff --git a/indra/newview/skins/default/xui/en/menu_teleport_history_item.xml b/indra/newview/skins/default/xui/en/menu_teleport_history_item.xml index f939c3996d4d1a895f6d801b01e27ada5ca5525e..52da591e35e6c58df40aa3e3eb1aad7ffe165b1e 100644 --- a/indra/newview/skins/default/xui/en/menu_teleport_history_item.xml +++ b/indra/newview/skins/default/xui/en/menu_teleport_history_item.xml @@ -7,20 +7,31 @@ layout="topleft" name="Teleport"> <menu_item_call.on_click - function="TeleportHistory.Teleport" /> + function="TeleportHistory.Action" + parameter="teleport" /> </menu_item_call> <menu_item_call - label="More Information" + label="View" layout="topleft" name="More Information"> <menu_item_call.on_click - function="TeleportHistory.MoreInformation" /> + function="TeleportHistory.Action" + parameter="view" /> + </menu_item_call> + <menu_item_call + label="Show on map" + layout="topleft" + name="show_on_map"> + <menu_item_call.on_click + function="TeleportHistory.Action" + parameter="show_on_map" /> </menu_item_call> <menu_item_call label="Copy SLurl" layout="topleft" name="CopyToClipboard"> <menu_item_call.on_click - function="TeleportHistory.CopyToClipboard" /> + function="TeleportHistory.Action" + parameter="copy_slurl" /> </menu_item_call> </context_menu>