void LLLandmarksPanel::onAddAction(const LLSD& userdata) const { LLFolderViewModelItemInventory* view_model = getCurSelectedViewModelItem(); LLFolderViewItem* item = getCurSelectedItem(); std::string command_name = userdata.asString(); if("add_landmark" == command_name) { LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos(); if(landmark) { LLNotificationsUtil::add("LandmarkAlreadyExists"); } else { LLFloaterSidePanelContainer::showPanel("places", LLSD().with("type", "create_landmark")); } } else if ("category" == command_name) { if (item && mCurrentSelectedList == mLandmarksInventoryPanel) { LLFolderViewModelItem* folder_bridge = NULL; if (view_model->getInventoryType() == LLInventoryType::IT_LANDMARK) { // for a landmark get parent folder bridge folder_bridge = item->getParentFolder()->getViewModelItem(); } else if (view_model->getInventoryType() == LLInventoryType::IT_CATEGORY) { // for a folder get its own bridge folder_bridge = view_model; } menu_create_inventory_item(mCurrentSelectedList, dynamic_cast<LLFolderBridge*> (folder_bridge), LLSD( "category"), gInventory.findCategoryUUIDForType( LLFolderType::FT_LANDMARK)); } else { //in case My Landmarks tab is completely empty (thus cannot be determined as being selected) menu_create_inventory_item(mLandmarksInventoryPanel, NULL, LLSD("category"), gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK)); if (mMyLandmarksAccordionTab) { mMyLandmarksAccordionTab->changeOpenClose(false); } } } }
void LLPanelMainInventory::doCreate(const LLSD& userdata) { menu_create_inventory_item(getPanel()->getRootFolder(), NULL, userdata); }
void LLInventoryPanel::doCreate(const LLSD& userdata) { menu_create_inventory_item(mFolderRoot, LLFolderBridge::sSelf.get(), userdata); }