From 99278b2f6259cd6e7b48dfbccb2528d428f83ec6 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 5 Feb 2021 11:15:06 +0200 Subject: SL-14797 Normalize right-click menus on Landmarks & Picks Part#1 --- indra/newview/llpanellandmarks.cpp | 37 +++++++++++++ indra/newview/llpanelplaces.cpp | 2 +- .../default/xui/en/menu_places_gear_folder.xml | 3 ++ .../default/xui/en/menu_places_gear_landmark.xml | 62 +++++++++------------- 4 files changed, 67 insertions(+), 37 deletions(-) diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index ccd8497484..578485c967 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -40,6 +40,7 @@ #include "llagent.h" #include "llagentpicksinfo.h" #include "llagentui.h" +#include "llavataractions.h" #include "llcallbacklist.h" #include "lldndbutton.h" #include "llfloatersidepanelcontainer.h" @@ -1051,6 +1052,38 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const } return false; } + else if ("add_landmark" == command_name) + { + bool is_single_selection = root_folder_view && root_folder_view->getSelectedCount() == 1; + if (!is_single_selection) + { + return false; + } + LLFolderViewModelItemInventory* view_model = getCurSelectedViewModelItem(); + if (!view_model || view_model->getInventoryType() != LLInventoryType::IT_CATEGORY) + { + return false; + } + LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos(); + if (landmark) + { + //already exists + return false; + } + return true; + } + else if ("share" == command_name) + { + if (!mCurrentSelectedList) + { + return false; + } + if (!LLAvatarActions::canShareSelectedItems(mCurrentSelectedList)) + { + return false; + } + return true; + } else { LL_WARNS() << "Unprocessed command has come: " << command_name << LL_ENDL; @@ -1078,6 +1111,10 @@ void LLLandmarksPanel::onCustomAction(const LLSD& userdata) { doActionOnCurSelectedLandmark(boost::bind(&LLLandmarksPanel::doCreatePick, this, _1)); } + else if ("share" == command_name && mCurrentSelectedList) + { + LLAvatarActions::shareWithAvatars(mCurrentSelectedList); + } else if ("restore" == command_name && mCurrentSelectedList) { mCurrentSelectedList->doToSelected(userdata); diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 53870fb5c7..abec3ba733 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -388,7 +388,7 @@ void LLPanelPlaces::onOpen(const LLSD& key) // Update the buttons at the bottom of the panel updateVerbs(); } - else + else // "create_landmark" { mFilterEditor->clear(); onFilterEdit("", false); diff --git a/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml b/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml index 1aeb166e01..4d59ab0631 100644 --- a/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml +++ b/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml @@ -13,6 +13,9 @@ + + + + + - + name="copy_slurl"> - + function="Places.LandmarksGear.CopyPaste.Action" + parameter="copy_slurl" /> + + + name="create_pick"> + function="Places.LandmarksGear.Custom.Action" + parameter="create_pick" /> + parameter="create_pick" /> - - - - - - - - -- cgit v1.2.3