From 74d3f9d017a424d69bfc256ecc1062fdaa3b18c3 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 5 Feb 2021 20:31:22 +0200 Subject: SL-14797 Normalize right-click menus on Landmarks & Picks Part#2 --- indra/newview/llpanellandmarkinfo.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanellandmarkinfo.cpp') diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index 6751c25fb9..069fb32a56 100644 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -106,6 +106,18 @@ void LLPanelLandmarkInfo::resetLocation() // virtual void LLPanelLandmarkInfo::setInfoType(EInfoType type) +{ + LLUUID dest_folder; + setInfoType(type, dest_folder); +} + +// Sets CREATE_LANDMARK infotype and creates landmark at desired folder +void LLPanelLandmarkInfo::setInfoAndCreateLandmark(const LLUUID& fodler_id) +{ + setInfoType(CREATE_LANDMARK, fodler_id); +} + +void LLPanelLandmarkInfo::setInfoType(EInfoType type, const LLUUID &folder_id) { LLPanel* landmark_info_panel = getChild("landmark_info_panel"); @@ -183,7 +195,7 @@ void LLPanelLandmarkInfo::setInfoType(EInfoType type) // remote parcel request to complete. if (!LLLandmarkActions::landmarkAlreadyExists()) { - createLandmark(LLUUID()); + createLandmark(folder_id); } } break; -- cgit v1.2.3 From d43d8bc68b4cbe40e2fb39dea0530a152463d1f9 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 23 Mar 2021 17:38:22 +0200 Subject: SL-14900 new Landmark creation flow --- indra/newview/llpanellandmarkinfo.cpp | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) (limited to 'indra/newview/llpanellandmarkinfo.cpp') diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index 069fb32a56..880323ce16 100644 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -52,7 +52,6 @@ typedef std::pair folder_pair_t; static bool cmp_folders(const folder_pair_t& left, const folder_pair_t& right); -static void collectLandmarkFolders(LLInventoryModel::cat_array_t& cats); static LLPanelInjector t_landmark_info("panel_landmark_info"); @@ -516,7 +515,7 @@ static bool cmp_folders(const folder_pair_t& left, const folder_pair_t& right) return left.second < right.second; } -static void collectLandmarkFolders(LLInventoryModel::cat_array_t& cats) +void LLPanelLandmarkInfo::collectLandmarkFolders(LLInventoryModel::cat_array_t& cats) { LLUUID landmarks_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK); @@ -529,16 +528,20 @@ static void collectLandmarkFolders(LLInventoryModel::cat_array_t& cats) items, LLInventoryModel::EXCLUDE_TRASH, is_category); +} - // Add the "My Favorites" category. - LLUUID favorites_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE); - LLViewerInventoryCategory* favorites_cat = gInventory.getCategory(favorites_id); - if (!favorites_cat) - { - LL_WARNS() << "Cannot find the favorites folder" << LL_ENDL; - } - else - { - cats.push_back(favorites_cat); - } +/* virtual */ void LLUpdateLandmarkParent::fire(const LLUUID& inv_item_id) +{ + LLInventoryModel::update_list_t update; + LLInventoryModel::LLCategoryUpdate old_folder(mItem->getParentUUID(), -1); + update.push_back(old_folder); + LLInventoryModel::LLCategoryUpdate new_folder(mNewParentId, 1); + update.push_back(new_folder); + gInventory.accountForUpdate(update); + + mItem->setParent(mNewParentId); + mItem->updateParentOnServer(FALSE); + + gInventory.updateItem(mItem); + gInventory.notifyObservers(); } -- cgit v1.2.3