diff options
| author | angela <angela@lindenlab.com> | 2009-11-04 12:33:52 +0800 |
|---|---|---|
| committer | angela <angela@lindenlab.com> | 2009-11-04 12:33:52 +0800 |
| commit | 61603ca9d55c76219093cb7000e7f75e539bf5fe (patch) | |
| tree | b1528b99061758e0f7b8fdaaa8754c2169036d89 /indra/newview/llpanellandmarks.cpp | |
| parent | 1190b5d9eb6f1e1d698430957b99872abd354f81 (diff) | |
| parent | 6e9fe077277b50634b125084f52da55fa8cb84d9 (diff) | |
mergre
Diffstat (limited to 'indra/newview/llpanellandmarks.cpp')
| -rw-r--r-- | indra/newview/llpanellandmarks.cpp | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 6d6fd38cce..91e1590dc3 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -553,16 +553,14 @@ void LLLandmarksPanel::onAddAction(const LLSD& userdata) const std::string command_name = userdata.asString(); if("add_landmark" == command_name) { - LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos(); - if(landmark) - { - LLSideTray::getInstance()->showPanel("panel_places", - LLSD().insert("type", "landmark").insert("id",landmark->getUUID())); - } - else + if(LLLandmarkActions::landmarkAlreadyExists()) { - LLSideTray::getInstance()->showPanel("panel_places", LLSD().insert("type", "create_landmark")); + std::string location; + LLAgentUI::buildLocationString(location, LLAgentUI::LOCATION_FORMAT_FULL); + llwarns<<" Landmark already exists at location: "<< location<<llendl; + return; } + LLSideTray::getInstance()->showPanel("panel_places", LLSD().insert("type", "create_landmark")); } else if ("category" == command_name) { @@ -586,7 +584,7 @@ void LLLandmarksPanel::onAddAction(const LLSD& userdata) const menu_create_inventory_item(mCurrentSelectedList->getRootFolder(), dynamic_cast<LLFolderBridge*> (folder_bridge), LLSD( "category"), gInventory.findCategoryUUIDForType( - LLFolderType::FT_LANDMARK)); + LLAssetType::AT_LANDMARK)); } } } @@ -618,21 +616,19 @@ void LLLandmarksPanel::onClipboardAction(const LLSD& userdata) const void LLLandmarksPanel::onFoldingAction(const LLSD& userdata) { - LLFolderView* landmarks_folder = mLandmarksInventoryPanel->getRootFolder(); - LLFolderView* fav_folder = mFavoritesInventoryPanel->getRootFolder(); + if(!mCurrentSelectedList) return; + + LLFolderView* root_folder = mCurrentSelectedList->getRootFolder(); std::string command_name = userdata.asString(); if ("expand_all" == command_name) { - landmarks_folder->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_DOWN); - fav_folder->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_DOWN); - landmarks_folder->arrangeAll(); - fav_folder->arrangeAll(); + root_folder->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_DOWN); + root_folder->arrangeAll(); } else if ("collapse_all" == command_name) { - landmarks_folder->closeAllFolders(); - fav_folder->closeAllFolders(); + root_folder->closeAllFolders(); } else if ( "sort_by_date" == command_name) { @@ -643,9 +639,6 @@ void LLLandmarksPanel::onFoldingAction(const LLSD& userdata) } else { - if(!mCurrentSelectedList) return; - - LLFolderView* root_folder = mCurrentSelectedList->getRootFolder(); root_folder->doToSelected(&gInventory, userdata); } } |
