From 3b65da1fad46eda2c97681879fce8880f7462082 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Fri, 14 Aug 2009 22:40:13 +0000 Subject: merge -r 1341-1350 https://svn.aws.productengine.com/secondlife/pe/stable-1 -> viewer-2.0.0-3 EXT-456 EXT-480 EXT-481 EXT-497 EXT-498 EXT-509 EXT-511 --- indra/newview/llfavoritesbar.cpp | 14 +- indra/newview/lllandmarkactions.cpp | 18 +-- indra/newview/lllandmarkactions.h | 6 +- indra/newview/llpanelavatar.cpp | 6 - indra/newview/llpanelgroupgeneral.cpp | 21 +-- indra/newview/llpanelpicks.cpp | 1 + indra/newview/llpanelplaceinfo.cpp | 8 +- indra/newview/llpanelplaces.cpp | 157 +++++++++++++++------ indra/newview/llpanelplaces.h | 8 +- indra/newview/llpanelprofile.cpp | 10 ++ indra/newview/llpanelprofile.h | 8 ++ indra/newview/llpanelprofileview.cpp | 24 ---- indra/newview/llpanelprofileview.h | 12 -- .../skins/default/xui/en/favorites_bar_button.xml | 2 - .../newview/skins/default/xui/en/menu_landmark.xml | 33 +++++ indra/newview/skins/default/xui/en/menu_place.xml | 47 ++++++ .../skins/default/xui/en/panel_group_general.xml | 16 ++- .../default/xui/en/panel_group_info_sidetray.xml | 2 +- .../skins/default/xui/en/panel_pick_list_item.xml | 2 +- .../newview/skins/default/xui/en/panel_places.xml | 33 +++-- .../newview/skins/default/xui/en/panel_profile.xml | 25 +++- .../default/xui/en/panel_sidetray_home_tab.xml | 11 +- 22 files changed, 309 insertions(+), 155 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/menu_landmark.xml create mode 100644 indra/newview/skins/default/xui/en/menu_place.xml (limited to 'indra/newview') diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 9dfc7bcee7..f739e159f3 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -422,18 +422,8 @@ void LLFavoritesBarCtrl::showDropDownMenu() if(menu) { - if (menu->getClosedByButtonClick()) - { - menu->resetClosedByButtonClick(); - return; - } - - if (menu->getVisible()) - { - menu->setVisible(FALSE); - menu->resetClosedByButtonClick(); + if (!menu->toggleVisibility()) return; - } LLInventoryModel::item_array_t items; @@ -559,7 +549,7 @@ void LLFavoritesBarCtrl::onButtonRightClick( LLUUID item_id,LLView* fav_button,S LLMenuGL::showPopup(fav_button, menu, x, y); } -void copy_slurl_to_clipboard_cb(const LLVector3d& posGlobal, std::string& slurl) +void copy_slurl_to_clipboard_cb(std::string& slurl) { gClipboard.copyFromString(utf8str_to_wstring(slurl)); } diff --git a/indra/newview/lllandmarkactions.cpp b/indra/newview/lllandmarkactions.cpp index 608b9b20e6..a341d81b94 100644 --- a/indra/newview/lllandmarkactions.cpp +++ b/indra/newview/lllandmarkactions.cpp @@ -182,7 +182,7 @@ void LLLandmarkActions::createLandmarkHere() createLandmarkHere(landmark_name, landmark_desc, folder_id); } -void LLLandmarkActions::getSLURLfromPosGlobal(const LLVector3d& global_pos, slurl_signal_t signal) +void LLLandmarkActions::getSLURLfromPosGlobal(const LLVector3d& global_pos, slurl_callback_t cb) { std::string sim_name; bool gotSimName = LLWorldMap::getInstance()->simNameFromPosGlobal(global_pos, sim_name); @@ -190,7 +190,7 @@ void LLLandmarkActions::getSLURLfromPosGlobal(const LLVector3d& global_pos, slur { std::string slurl = LLSLURL::buildSLURLfromPosGlobal(sim_name, global_pos); - signal(global_pos, slurl); + cb(slurl); return; } @@ -198,16 +198,16 @@ void LLLandmarkActions::getSLURLfromPosGlobal(const LLVector3d& global_pos, slur { U64 new_region_handle = to_region_handle(global_pos); - LLWorldMap::url_callback_t cb = boost::bind(&LLLandmarkActions::onRegionResponse, - signal, - global_pos, - _1, _2, _3, _4); + LLWorldMap::url_callback_t url_cb = boost::bind(&LLLandmarkActions::onRegionResponse, + cb, + global_pos, + _1, _2, _3, _4); - LLWorldMap::getInstance()->sendHandleRegionRequest(new_region_handle, cb, std::string("unused"), false); + LLWorldMap::getInstance()->sendHandleRegionRequest(new_region_handle, url_cb, std::string("unused"), false); } } -void LLLandmarkActions::onRegionResponse(slurl_signal_t signal, +void LLLandmarkActions::onRegionResponse(slurl_callback_t cb, const LLVector3d& global_pos, U64 region_handle, const std::string& url, @@ -226,7 +226,7 @@ void LLLandmarkActions::onRegionResponse(slurl_signal_t signal, slurl = ""; } - signal(global_pos, slurl); + cb(slurl); } bool LLLandmarkActions::getLandmarkGlobalPos(const LLUUID& landmarkInventoryItemID, LLVector3d& posGlobal) diff --git a/indra/newview/lllandmarkactions.h b/indra/newview/lllandmarkactions.h index e04d1bf543..12c7398f6a 100644 --- a/indra/newview/lllandmarkactions.h +++ b/indra/newview/lllandmarkactions.h @@ -41,7 +41,7 @@ class LLLandmarkActions { public: - typedef boost::function slurl_signal_t; + typedef boost::function slurl_callback_t; /** * @brief Fetches landmark LLViewerInventoryItems for the given landmark name. @@ -80,7 +80,7 @@ public: /** * @brief Creates SLURL for given global position. */ - static void getSLURLfromPosGlobal(const LLVector3d& global_pos, slurl_signal_t signal); + static void getSLURLfromPosGlobal(const LLVector3d& global_pos, slurl_callback_t cb); /** * @brief Gets landmark global position specified by inventory LLUUID. @@ -96,7 +96,7 @@ private: LLLandmarkActions(); LLLandmarkActions(const LLLandmarkActions&); - static void onRegionResponse(slurl_signal_t signal, + static void onRegionResponse(slurl_callback_t cb, const LLVector3d& global_pos, U64 region_handle, const std::string& url, diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 6c7fb8a0be..6e94b087a6 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -369,7 +369,6 @@ void LLPanelAvatarProfile::resetControls() childSetVisible("sl_groups", true); childSetEnabled("add_friend", true); - childSetVisible("user_name", false); childSetVisible("status_me_panel", false); childSetVisible("profile_me_buttons_panel", false); childSetVisible("account_actions_panel", false); @@ -609,10 +608,6 @@ BOOL LLPanelAvatarMeProfile::postBuild() void LLPanelAvatarMeProfile::onOpen(const LLSD& key) { LLPanelProfileTab::onOpen(key); - - std::string full_name; - gCacheName->getFullName(getAvatarId(), full_name); - childSetValue("user_name", full_name); } void LLPanelAvatarMeProfile::processProfileProperties(const LLAvatarData* avatar_data) @@ -647,7 +642,6 @@ void LLPanelAvatarMeProfile::fillStatusData(const LLAvatarData* avatar_data) void LLPanelAvatarMeProfile::resetControls() { - childSetVisible("user_name", true); childSetVisible("status_panel", false); childSetVisible("profile_buttons_panel", false); childSetVisible("title_groups_text", false); diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index d63e112357..22706513e0 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -887,6 +887,10 @@ void LLPanelGroupGeneral::updateChanged() void LLPanelGroupGeneral::reset() { + mFounderName->setVisible(false); + + getChild("prepend_founded_by")->setVisible(false); + mCtrlReceiveNotices->set(false); @@ -1010,21 +1014,8 @@ void LLPanelGroupGeneral::setGroupID(const LLUUID& id) mComboActiveTitle = getChild("active_title"); - if (mGroupID.isNull()) - { - mGroupNameEditor->setEnabled(TRUE); - mEditCharter->setEnabled(TRUE); - - mCtrlShowInGroupList->setEnabled(TRUE); - mComboMature->setEnabled(TRUE); - mCtrlOpenEnrollment->setEnabled(TRUE); - mCtrlEnrollmentFee->setEnabled(TRUE); - mSpinEnrollmentFee->setEnabled(TRUE); - - mBtnJoinGroup->setVisible(FALSE); - mBtnInfo->setVisible(FALSE); - mGroupName->setVisible(FALSE); - } + mFounderName->setVisible(true); + getChild("prepend_founded_by")->setVisible(true); resetDirty(); diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index afcd8c735c..051bf08c2f 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -204,6 +204,7 @@ void LLPanelPicks::reshapePicksList() reshapePickItem(childp, last_bottom,pickList->getRect().getWidth()); } + //*TODO move back panel reshaping before reshaping pick items, so it will be more durable to xui xml changes S32 height = pickList->getChildCount() * ((*child_first_it)->getRect().getHeight() + PICK_ITEMS_BETWEEN); LLRect rc = pickList->getRect(); rc.setLeftTopAndSize(rc.mLeft, rc.mTop, rc.getWidth(), height); diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp index 0931333ed9..34feb0f5a9 100644 --- a/indra/newview/llpanelplaceinfo.cpp +++ b/indra/newview/llpanelplaceinfo.cpp @@ -240,10 +240,7 @@ void LLPanelPlaceInfo::setParcelID(const LLUUID& parcel_id) } void LLPanelPlaceInfo::setInfoType(INFO_TYPE type) -{ - if (type != PLACE) - toggleMediaPanel(FALSE); - +{ bool is_landmark_info_type = type == LANDMARK; LLPanel* landmark_info_panel = getChild("landmark_info_panel"); if (landmark_info_panel) @@ -276,6 +273,9 @@ void LLPanelPlaceInfo::setInfoType(INFO_TYPE type) mCurrentTitle = getString("title_place"); break; } + + if (type != PLACE) + toggleMediaPanel(FALSE); } BOOL LLPanelPlaceInfo::isMediaPanelVisible() diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 7461d150c8..41be268483 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -43,6 +43,7 @@ #include "lluictrlfactory.h" #include "llagent.h" +#include "lllandmarkactions.h" #include "lllandmarklist.h" #include "llfloaterworldmap.h" #include "llpanelplaces.h" @@ -50,14 +51,22 @@ #include "llpanelteleporthistory.h" #include "llsidetray.h" #include "lltoggleablemenu.h" +#include "llviewermenu.h" #include "llviewerparcelmgr.h" #include "llviewerregion.h" +static const std::string AGENT_INFO_TYPE = "agent"; +static const std::string CREATE_LANDMARK_INFO_TYPE = "create_landmark"; +static const std::string LANDMARK_INFO_TYPE = "landmark"; +static const std::string REMOTE_PLACE_INFO_TYPE = "remote_place"; +static const std::string TELEPORT_HISTORY_INFO_TYPE = "teleport_history"; + // Helper functions static bool cmp_folders(const folder_pair_t& left, const folder_pair_t& right); static std::string getFullFolderName(const LLViewerInventoryCategory* cat); static void collectLandmarkFolders(LLInventoryModel::cat_array_t& cats); static const LLVector3 get_pos_local_from_global(const LLVector3d &pos_global); +static void onSLURLBuilt(std::string& slurl); static LLRegisterPanelClassWrapper t_places("panel_places"); @@ -68,6 +77,8 @@ LLPanelPlaces::LLPanelPlaces() mFilterEditor(NULL), mPlaceInfo(NULL), mItem(NULL), + mPlaceMenu(NULL), + mLandmarkMenu(NULL), mLandmarkFoldersMenuHandle(), mPosGlobal() { @@ -107,7 +118,23 @@ BOOL LLPanelPlaces::postBuild() mOverflowBtn = getChild("overflow_btn"); // *TODO: Assign the action to an appropriate event. - mOverflowBtn->setClickedCallback(boost::bind(&LLPanelPlaces::toggleMediaPanel, this)); + //mOverflowBtn->setClickedCallback(boost::bind(&LLPanelPlaces::toggleMediaPanel, this)); + mOverflowBtn->setClickedCallback(boost::bind(&LLPanelPlaces::onOverflowButtonClicked, this)); + + LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; + registrar.add("Places.OverflowMenu.Action", boost::bind(&LLPanelPlaces::onOverflowMenuItemClicked, this, _2)); + + mPlaceMenu = LLUICtrlFactory::getInstance()->createFromFile("menu_place.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + if (!mPlaceMenu) + { + llwarns << "Error loading Place menu" << llendl; + } + + mLandmarkMenu = LLUICtrlFactory::getInstance()->createFromFile("menu_landmark.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + if (!mLandmarkMenu) + { + llwarns << "Error loading Landmark menu" << llendl; + } mTabContainer = getChild("Places Tabs"); if (mTabContainer) @@ -147,21 +174,21 @@ void LLPanelPlaces::onOpen(const LLSD& key) togglePlaceInfoPanel(TRUE); updateVerbs(); - if (mPlaceInfoType == "agent") + if (mPlaceInfoType == AGENT_INFO_TYPE) { mPlaceInfo->setInfoType(LLPanelPlaceInfo::PLACE); mPlaceInfo->displayAgentParcelInfo(); mPosGlobal = gAgent.getPositionGlobal(); } - else if (mPlaceInfoType == "create_landmark") + else if (mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE) { mPlaceInfo->setInfoType(LLPanelPlaceInfo::CREATE_LANDMARK); mPlaceInfo->displayAgentParcelInfo(); mPosGlobal = gAgent.getPositionGlobal(); } - else if (mPlaceInfoType == "landmark") + else if (mPlaceInfoType == LANDMARK_INFO_TYPE) { LLUUID item_uuid = key["id"].asUUID(); LLInventoryItem* item = gInventory.getItem(item_uuid); @@ -170,7 +197,7 @@ void LLPanelPlaces::onOpen(const LLSD& key) setItem(item); } - else if (mPlaceInfoType == "remote_place") + else if (mPlaceInfoType == REMOTE_PLACE_INFO_TYPE) { if (mPlaceInfo->isMediaPanelVisible()) { @@ -186,7 +213,7 @@ void LLPanelPlaces::onOpen(const LLSD& key) LLUUID(), mPosGlobal); } - else if (mPlaceInfoType == "teleport_history") + else if (mPlaceInfoType == TELEPORT_HISTORY_INFO_TYPE) { S32 index = key["id"].asInteger(); @@ -237,11 +264,10 @@ void LLPanelPlaces::onLandmarkLoaded(LLLandmark* landmark) LLUUID region_id; landmark->getRegionID(region_id); - LLVector3d pos_global; - landmark->getGlobalPos(pos_global); + landmark->getGlobalPos(mPosGlobal); mPlaceInfo->displayParcelInfo(landmark->getRegionPos(), region_id, - pos_global); + mPosGlobal); } void LLPanelPlaces::onFilterEdit(const std::string& search_string) @@ -273,12 +299,17 @@ void LLPanelPlaces::onShareButtonClicked() { // TODO: Launch the "Things" Share wizard } +*/ -void LLPanelPlaces::onCopySLURLButtonClicked() +void LLPanelPlaces::copySLURL() { - mActivePanel->onCopySLURL(); + LLLandmarkActions::getSLURLfromPosGlobal(mPosGlobal, boost::bind(&onSLURLBuilt, _1)); +} + +void LLPanelPlaces::deleteLandmark() +{ + gInventory.removeItem(mItem->getUUID()); } -*/ void LLPanelPlaces::onTeleportButtonClicked() { @@ -287,13 +318,13 @@ void LLPanelPlaces::onTeleportButtonClicked() if (mPlaceInfo->getVisible()) { - if (mPlaceInfoType == "landmark") + if (mPlaceInfoType == LANDMARK_INFO_TYPE) { LLSD payload; payload["asset_id"] = mItem->getAssetUUID(); LLNotifications::instance().add("TeleportFromLandmark", LLSD(), payload); } - else if (mPlaceInfoType == "remote_place" || mPlaceInfoType == "agent") + else if (mPlaceInfoType == AGENT_INFO_TYPE || mPlaceInfoType == REMOTE_PLACE_INFO_TYPE) { LLFloaterWorldMap* worldmap_instance = LLFloaterWorldMap::getInstance(); if (!mPosGlobal.isExactlyZero() && worldmap_instance) @@ -320,9 +351,9 @@ void LLPanelPlaces::onShowOnMapButtonClicked() if(!worldmap_instance) return; - if (mPlaceInfoType == "agent" || - mPlaceInfoType == "create_landmark" || - mPlaceInfoType == "remote_place") + if (mPlaceInfoType == AGENT_INFO_TYPE || + mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE || + mPlaceInfoType == REMOTE_PLACE_INFO_TYPE) { if (!mPosGlobal.isExactlyZero()) { @@ -330,7 +361,7 @@ void LLPanelPlaces::onShowOnMapButtonClicked() LLFloaterReg::showInstance("world_map", "center"); } } - else if (mPlaceInfoType == "landmark") + else if (mPlaceInfoType == LANDMARK_INFO_TYPE) { LLLandmark* landmark = gLandmarkList.getAsset(mItem->getAssetUUID()); if (!landmark) @@ -353,6 +384,52 @@ void LLPanelPlaces::onShowOnMapButtonClicked() } } +void LLPanelPlaces::onOverflowButtonClicked() +{ + bool is_agent_place_info_visible = mPlaceInfoType == AGENT_INFO_TYPE; + bool is_landmark_info_visible = mPlaceInfoType == LANDMARK_INFO_TYPE; + + LLToggleableMenu* menu; + + if (is_agent_place_info_visible && mPlaceMenu != NULL) + { + menu = mPlaceMenu; + } + else if (is_landmark_info_visible && mLandmarkMenu != NULL) + { + menu = mLandmarkMenu; + } + else + { + return; + } + + if (!menu->toggleVisibility()) + return; + + menu->updateParent(LLMenuGL::sMenuContainer); + LLRect rect = mOverflowBtn->getRect(); + menu->setButtonRect(rect, this); + LLMenuGL::showPopup(this, menu, rect.mRight, rect.mTop); +} + +void LLPanelPlaces::onOverflowMenuItemClicked(const LLSD& param) +{ + std::string item = param.asString(); + if (item == "landmark") + { + onOpen(LLSD().insert("type", CREATE_LANDMARK_INFO_TYPE)); + } + else if (item == "copy") + { + copySLURL(); + } + else if (item == "delete") + { + deleteLandmark(); + } +} + void LLPanelPlaces::onCreateLandmarkButtonClicked(const LLUUID& folder_id) { if (!mPlaceInfo) @@ -380,11 +457,11 @@ void LLPanelPlaces::toggleMediaPanel() return; mPlaceInfo->toggleMediaPanel(!mPlaceInfo->isMediaPanelVisible()); - + // Refresh the current place info because // the media panel controls can't refer to // the remote parcel media. - onOpen(LLSD().insert("type", "agent")); + onOpen(LLSD().insert("type", AGENT_INFO_TYPE)); } void LLPanelPlaces::togglePlaceInfoPanel(BOOL visible) @@ -402,7 +479,7 @@ void LLPanelPlaces::togglePlaceInfoPanel(BOOL visible) LLRect rect = getRect(); LLRect new_rect = LLRect(rect.mLeft, rect.mTop, rect.mRight, mTabContainer->getRect().mBottom); - mPlaceInfo->reshape(new_rect.getWidth(),new_rect.getHeight()); + mPlaceInfo->reshape(new_rect.getWidth(),new_rect.getHeight()); } } @@ -450,13 +527,13 @@ void LLPanelPlaces::onAgentParcelChange() if (!mPlaceInfo) return; - if (mPlaceInfo->getVisible() && mPlaceInfoType == "create_landmark") + if (mPlaceInfo->getVisible() && mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE) { onOpen(LLSD().insert("type", mPlaceInfoType)); } else if (mPlaceInfo->isMediaPanelVisible()) { - onOpen(LLSD().insert("type", "agent")); + onOpen(LLSD().insert("type", AGENT_INFO_TYPE)); } else { @@ -470,8 +547,8 @@ void LLPanelPlaces::updateVerbs() return; bool is_place_info_visible = mPlaceInfo->getVisible(); - bool is_agent_place_info_visible = mPlaceInfoType == "agent"; - bool is_create_landmark_visible = mPlaceInfoType == "create_landmark"; + bool is_agent_place_info_visible = mPlaceInfoType == AGENT_INFO_TYPE; + bool is_create_landmark_visible = mPlaceInfoType == CREATE_LANDMARK_INFO_TYPE; bool is_media_panel_visible = mPlaceInfo->isMediaPanelVisible(); mTeleportBtn->setVisible(!is_create_landmark_visible); @@ -479,9 +556,7 @@ void LLPanelPlaces::updateVerbs() mCreateLandmarkBtn->setVisible(is_create_landmark_visible); mFolderMenuBtn->setVisible(is_create_landmark_visible); - // Enable overflow button only when showing the information - // about agent's current location. - mOverflowBtn->setEnabled(is_agent_place_info_visible); + mOverflowBtn->setEnabled(is_place_info_visible && !is_media_panel_visible && !is_create_landmark_visible); if (is_place_info_visible) { @@ -493,7 +568,7 @@ void LLPanelPlaces::updateVerbs() !mPosGlobal.isExactlyZero() && !LLViewerParcelMgr::getInstance()->inAgentParcel(mPosGlobal)); } - else if (mPlaceInfoType == "landmark" || mPlaceInfoType == "remote_place") + else if (mPlaceInfoType == LANDMARK_INFO_TYPE || mPlaceInfoType == REMOTE_PLACE_INFO_TYPE) { mTeleportBtn->setEnabled(TRUE); } @@ -525,18 +600,8 @@ void LLPanelPlaces::showLandmarkFoldersMenu() if(!menu) return; - if (menu->getClosedByButtonClick()) - { - menu->resetClosedByButtonClick(); + if (!menu->toggleVisibility()) return; - } - - if (menu->getVisible()) - { - menu->setVisible(FALSE); - menu->resetClosedByButtonClick(); - return; - } // Collect all folders that can contain landmarks. LLInventoryModel::cat_array_t cats; @@ -705,7 +770,7 @@ static void collectLandmarkFolders(LLInventoryModel::cat_array_t& cats) } } -const LLVector3 get_pos_local_from_global(const LLVector3d &pos_global) +static const LLVector3 get_pos_local_from_global(const LLVector3d &pos_global) { F32 region_x = (F32)fmod( pos_global.mdV[VX], (F64)REGION_WIDTH_METERS ); F32 region_y = (F32)fmod( pos_global.mdV[VY], (F64)REGION_WIDTH_METERS ); @@ -713,3 +778,13 @@ const LLVector3 get_pos_local_from_global(const LLVector3d &pos_global) LLVector3 pos_local(region_x, region_y, (F32)pos_global.mdV[VZ]); return pos_local; } + +static void onSLURLBuilt(std::string& slurl) +{ + LLView::getWindow()->copyTextToClipboard(utf8str_to_wstring(slurl)); + + LLSD args; + args["SLURL"] = slurl; + + LLNotifications::instance().add("CopySLURL", args); +} diff --git a/indra/newview/llpanelplaces.h b/indra/newview/llpanelplaces.h index 431c8168d9..a200bc2d28 100644 --- a/indra/newview/llpanelplaces.h +++ b/indra/newview/llpanelplaces.h @@ -66,10 +66,11 @@ private: void onFilterEdit(const std::string& search_string); void onTabSelected(); - //void onCopySLURLButtonClicked(); //void onShareButtonClicked(); void onTeleportButtonClicked(); void onShowOnMapButtonClicked(); + void onOverflowButtonClicked(); + void onOverflowMenuItemClicked(const LLSD& param); void onCreateLandmarkButtonClicked(const LLUUID& folder_id); void onBackButtonClicked(); @@ -80,11 +81,16 @@ private: void updateVerbs(); void showLandmarkFoldersMenu(); + + void copySLURL(); + void deleteLandmark(); LLFilterEditor* mFilterEditor; LLPanelPlacesTab* mActivePanel; LLTabContainer* mTabContainer; LLPanelPlaceInfo* mPlaceInfo; + LLToggleableMenu* mPlaceMenu; + LLToggleableMenu* mLandmarkMenu; LLButton* mCreateLandmarkBtn; LLButton* mFolderMenuBtn; diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 017a7312a1..0af996fac0 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -102,6 +102,10 @@ void LLPanelProfile::onOpen(const LLSD& key) { getTabCtrl()->getCurrentPanel()->onOpen(getAvatarId()); } + + // Update the avatar name. + gCacheName->get(getAvatarId(), FALSE, + boost::bind(&LLPanelProfile::onAvatarNameCached, this, _1, _2, _3, _4)); } //*TODO redo panel toggling @@ -163,3 +167,9 @@ void LLPanelProfile::setAllChildrenVisible(BOOL visible) viewp->setVisible(visible); } } + +void LLPanelProfile::onAvatarNameCached(const LLUUID& id, const std::string& first_name, const std::string& last_name, BOOL is_group) +{ + llassert(getAvatarId() == id); + getChild("user_name", FALSE)->setValue(first_name + " " + last_name); +} diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h index b55963ec4a..0864ec1bc3 100644 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -72,6 +72,14 @@ protected: profile_tabs_t& getTabContainer() { return mTabContainer; } private: + // LLCacheName will call this function when avatar name is loaded from server. + // This is required to display names that have not been cached yet. + void onAvatarNameCached( + const LLUUID& id, + const std::string& first_name, + const std::string& last_name, + BOOL is_group); + LLTabContainer* mTabCtrl; profile_tabs_t mTabContainer; LLUUID mAvatarId; diff --git a/indra/newview/llpanelprofileview.cpp b/indra/newview/llpanelprofileview.cpp index cd18dc4462..1235340f57 100644 --- a/indra/newview/llpanelprofileview.cpp +++ b/indra/newview/llpanelprofileview.cpp @@ -44,7 +44,6 @@ static std::string PANEL_NOTES = "panel_notes"; LLPanelProfileView::LLPanelProfileView() : LLPanelProfile() -, mCacheNameCallbackConnected(false) { } @@ -66,21 +65,6 @@ void LLPanelProfileView::onOpen(const LLSD& key) } LLPanelProfile::onOpen(key); - - // *HACK Profile View is created before gCacheName, as a result we can't call addObserver() - // in postBuild() and have to connect callback here. - // This will call addObserver() once per LLPanelProfileView instance. - if(!mCacheNameCallbackConnected) - { - gCacheName->addObserver(boost::bind(&LLPanelProfileView::cacheNameCallback, this, _1, _2, _3, _4)); - mCacheNameCallbackConnected = true; - } - - // getFullName() will return "(Loading...)" for non cached names, - // in this case cacheNameCallback() will resolve the name. - std::string full_name; - gCacheName->getFullName(getAvatarId(),full_name); - childSetValue("user_name",full_name); } BOOL LLPanelProfileView::postBuild() @@ -105,11 +89,3 @@ void LLPanelProfileView::onBackBtnClick() parent->openPreviousPanel(); } } - -void LLPanelProfileView::cacheNameCallback(const LLUUID& id, const std::string& first_name, const std::string& last_name, BOOL is_group) -{ - if(getAvatarId() == id) - { - childSetValue("user_name", first_name + " " + last_name); - } -} diff --git a/indra/newview/llpanelprofileview.h b/indra/newview/llpanelprofileview.h index 4d5e2997c1..92def7b7ca 100644 --- a/indra/newview/llpanelprofileview.h +++ b/indra/newview/llpanelprofileview.h @@ -60,21 +60,9 @@ public: /*virtual*/ BOOL postBuild(); - // LLCacheName will call this function when avatar name is loaded from server. - // This is required to display names that have not been cached yet. - void cacheNameCallback( - const LLUUID& id, - const std::string& first_name, - const std::string& last_name, - BOOL is_group); - protected: void onBackBtnClick(); - -private: - - bool mCacheNameCallbackConnected; }; #endif //LL_LLPANELPROFILEVIEW_H diff --git a/indra/newview/skins/default/xui/en/favorites_bar_button.xml b/indra/newview/skins/default/xui/en/favorites_bar_button.xml index 02784bb74b..01d8054e9a 100644 --- a/indra/newview/skins/default/xui/en/favorites_bar_button.xml +++ b/indra/newview/skins/default/xui/en/favorites_bar_button.xml @@ -1,6 +1,4 @@ -