diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index ccd8497484523075366756322e9706c763e1b5b6..578485c96764a3a1bb0964e409b5e7468aa63a55 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 53870fb5c74282ec3196a7ead7a13ab1ae234e94..abec3ba733f3c4973b93b62841200b1e6fdc88bf 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 1aeb166e01570aaccb4ead89d93c7a887e3a4cad..4d59ab06317bfc97007a222ff866d8a76d0aa63e 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 @@ <on_click function="Places.LandmarksGear.Add.Action" parameter="add_landmark" /> + <on_enable + function="Places.LandmarksGear.Enable" + parameter="add_landmark" /> </menu_item_call> <menu_item_call label="Add Folder" diff --git a/indra/newview/skins/default/xui/en/menu_places_gear_landmark.xml b/indra/newview/skins/default/xui/en/menu_places_gear_landmark.xml index ff5fdd3795322d5c3582f0b7ff7d73b3240c6d29..b8249b621b79a4a7fd327d6e9a897d3a99a91952 100644 --- a/indra/newview/skins/default/xui/en/menu_places_gear_landmark.xml +++ b/indra/newview/skins/default/xui/en/menu_places_gear_landmark.xml @@ -18,7 +18,18 @@ parameter="teleport" /> </menu_item_call> <menu_item_call - label="More Information" + label="Share" + layout="topleft" + name="share"> + <on_click + function="Places.LandmarksGear.Custom.Action" + parameter="share" /> + <on_enable + function="Places.LandmarksGear.Enable" + parameter="share" /> + </menu_item_call> + <menu_item_call + label="View/Edit Landmark" layout="topleft" name="more_info"> <on_click @@ -39,26 +50,27 @@ function="Places.LandmarksGear.Enable" parameter="show_on_map" /> </menu_item_call> - <menu_item_separator - layout="topleft" /> <menu_item_call - label="Add Landmark" + label="Copy SLurl" layout="topleft" - name="add_landmark"> + name="copy_slurl"> <on_click - function="Places.LandmarksGear.Add.Action" - parameter="add_landmark" /> - </menu_item_call> + function="Places.LandmarksGear.CopyPaste.Action" + parameter="copy_slurl" /> + <on_enable + function="Places.LandmarksGear.Enable" + parameter="copy_slurl" /> + </menu_item_call> <menu_item_call - label="Add Folder" + label="Create Pick" layout="topleft" - name="add_folder"> + name="create_pick"> <on_click - function="Places.LandmarksGear.Add.Action" - parameter="category" /> + function="Places.LandmarksGear.Custom.Action" + parameter="create_pick" /> <on_enable function="Places.LandmarksGear.Enable" - parameter="category" /> + parameter="create_pick" /> </menu_item_call> <menu_item_call label="Restore Item" @@ -82,24 +94,13 @@ parameter="cut" /> </menu_item_call> <menu_item_call - label="Copy Landmark" + label="Copy" layout="topleft" name="copy_landmark"> <on_click function="Places.LandmarksGear.CopyPaste.Action" parameter="copy" /> </menu_item_call> - <menu_item_call - label="Copy SLurl" - layout="topleft" - name="copy_slurl"> - <on_click - function="Places.LandmarksGear.CopyPaste.Action" - parameter="copy_slurl" /> - <on_enable - function="Places.LandmarksGear.Enable" - parameter="copy_slurl" /> - </menu_item_call> <menu_item_call label="Paste" layout="topleft" @@ -171,15 +172,4 @@ function="Places.LandmarksGear.Enable" parameter="sort_by_date" /> </menu_item_check> - <menu_item_call - label="Create Pick" - layout="topleft" - name="create_pick"> - <on_click - function="Places.LandmarksGear.Custom.Action" - parameter="create_pick" /> - <on_enable - function="Places.LandmarksGear.Enable" - parameter="create_pick" /> - </menu_item_call> </toggleable_menu>