diff options
Diffstat (limited to 'indra/newview/llpanellandmarkinfo.cpp')
-rw-r--r-- | indra/newview/llpanellandmarkinfo.cpp | 65 |
1 files changed, 42 insertions, 23 deletions
diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index 597b8bdb2d..56d52ccc65 100644 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -98,17 +98,17 @@ void LLPanelLandmarkInfo::resetLocation() { LLPanelPlaceInfo::resetLocation(); - std::string not_available = getString("not_available"); - mCreator->setText(not_available); - mOwner->setText(not_available); - mCreated->setText(not_available); + std::string loading = LLTrans::getString("LoadingData"); + mCreator->setText(loading); + mOwner->setText(loading); + mCreated->setText(loading); mLandmarkTitle->setText(LLStringUtil::null); mLandmarkTitleEditor->setText(LLStringUtil::null); mNotesEditor->setText(LLStringUtil::null); } // virtual -void LLPanelLandmarkInfo::setInfoType(INFO_TYPE type) +void LLPanelLandmarkInfo::setInfoType(EInfoType type) { LLPanel* landmark_info_panel = getChild<LLPanel>("landmark_info_panel"); @@ -185,6 +185,13 @@ void LLPanelLandmarkInfo::processParcelInfo(const LLParcelData& parcel_data) region_z = llround(mPosRegion.mV[VZ]); } + LLSD info; + info["update_verbs"] = true; + info["global_x"] = parcel_data.global_x; + info["global_y"] = parcel_data.global_y; + info["global_z"] = parcel_data.global_z; + notifyParent(info); + if (mInfoType == CREATE_LANDMARK) { if (parcel_data.name.empty()) @@ -360,7 +367,6 @@ void LLPanelLandmarkInfo::createLandmark(const LLUUID& folder_id) } LLStringUtil::replaceChar(desc, '\n', ' '); - LLViewerInventoryItem::insertDefaultSortField(name); // If no folder chosen use the "Landmarks" folder. LLLandmarkActions::createLandmarkHere(name, desc, @@ -370,21 +376,31 @@ void LLPanelLandmarkInfo::createLandmark(const LLUUID& folder_id) // static std::string LLPanelLandmarkInfo::getFullFolderName(const LLViewerInventoryCategory* cat) { - std::string name = cat->getName(); + std::string name; LLUUID parent_id; - // translate category name, if it's right below the root - // FIXME: it can throw notification about non existent string in strings.xml - if (cat->getParentUUID().notNull() && cat->getParentUUID() == gInventory.getRootFolderID()) + llassert(cat); + if (cat) { - LLTrans::findString(name, "InvFolder " + name); - } + name = cat->getName(); - // we don't want "My Inventory" to appear in the name - while ((parent_id = cat->getParentUUID()).notNull() && parent_id != gInventory.getRootFolderID()) - { - cat = gInventory.getCategory(parent_id); - name = cat->getName() + "/" + name; + // translate category name, if it's right below the root + // FIXME: it can throw notification about non existent string in strings.xml + if (cat->getParentUUID().notNull() && cat->getParentUUID() == gInventory.getRootFolderID()) + { + LLTrans::findString(name, "InvFolder " + name); + } + + // we don't want "My Inventory" to appear in the name + while ((parent_id = cat->getParentUUID()).notNull() && parent_id != gInventory.getRootFolderID()) + { + cat = gInventory.getCategory(parent_id); + llassert(cat); + if (cat) + { + name = cat->getName() + "/" + name; + } + } } return name; @@ -400,21 +416,24 @@ void LLPanelLandmarkInfo::populateFoldersList() // Put the "Landmarks" folder first in list. LLUUID landmarks_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK); - const LLViewerInventoryCategory* cat = gInventory.getCategory(landmarks_id); - if (!cat) + const LLViewerInventoryCategory* lmcat = gInventory.getCategory(landmarks_id); + if (!lmcat) { llwarns << "Cannot find the landmarks folder" << llendl; } - std::string cat_full_name = getFullFolderName(cat); - mFolderCombo->add(cat_full_name, cat->getUUID()); + else + { + std::string cat_full_name = getFullFolderName(lmcat); + mFolderCombo->add(cat_full_name, lmcat->getUUID()); + } typedef std::vector<folder_pair_t> folder_vec_t; folder_vec_t folders; // Sort the folders by their full name. for (S32 i = 0; i < cats.count(); i++) { - cat = cats.get(i); - cat_full_name = getFullFolderName(cat); + const LLViewerInventoryCategory* cat = cats.get(i); + std::string cat_full_name = getFullFolderName(cat); folders.push_back(folder_pair_t(cat->getUUID(), cat_full_name)); } sort(folders.begin(), folders.end(), cmp_folders); |