From ed40da679530329fce0e7505dc90a898a10d7d86 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Tue, 3 Nov 2009 19:13:36 +0200 Subject: Implemented sub-task EXT-1452 '"places" title should not be on this panel': - Made LLPlaceInfo a base class for two derived LLPlaceProfile and LLLandmarkInfo classes each representing a separate panel with its own XUI layout. - Fixed broken title change for Place Profile and Landmark cases. --HG-- branch : product-engine --- indra/newview/llpanellandmarkinfo.cpp | 437 ++++++++++++++++++++++++++++++++++ 1 file changed, 437 insertions(+) create mode 100644 indra/newview/llpanellandmarkinfo.cpp (limited to 'indra/newview/llpanellandmarkinfo.cpp') diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp new file mode 100644 index 0000000000..1152ca6873 --- /dev/null +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -0,0 +1,437 @@ +/** + * @file llpanellandmarkinfo.cpp + * @brief Displays landmark info in Side Tray. + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2004-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llpanellandmarkinfo.h" + +#include "llinventory.h" + +#include "llcombobox.h" +#include "lllineeditor.h" +#include "lltextbox.h" +#include "lltexteditor.h" +#include "lltrans.h" + +#include "llagent.h" +#include "llagentui.h" +#include "llinventorymodel.h" +#include "lllandmarkactions.h" +#include "llviewerinventory.h" +#include "llviewerparcelmgr.h" +#include "llviewerregion.h" + +//---------------------------------------------------------------------------- +// Aux types and methods +//---------------------------------------------------------------------------- + +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 LLRegisterPanelClassWrapper t_landmark_info("panel_landmark_info"); + +LLPanelLandmarkInfo::LLPanelLandmarkInfo() +: LLPanelPlaceInfo() +{} + +// virtual +LLPanelLandmarkInfo::~LLPanelLandmarkInfo() +{} + +// virtual +BOOL LLPanelLandmarkInfo::postBuild() +{ + LLPanelPlaceInfo::postBuild(); + + mOwner = getChild("owner"); + mCreator = getChild("creator"); + mCreated = getChild("created"); + + mTitleEditor = getChild("title_editor"); + mNotesEditor = getChild("notes_editor"); + mFolderCombo = getChild("folder_combo"); + + return TRUE; +} + +// virtual +void LLPanelLandmarkInfo::resetLocation() +{ + LLPanelPlaceInfo::resetLocation(); + + std::string not_available = getString("not_available"); + mCreator->setText(not_available); + mOwner->setText(not_available); + mCreated->setText(not_available); + mTitleEditor->setText(LLStringUtil::null); + mNotesEditor->setText(LLStringUtil::null); +} + +// virtual +void LLPanelLandmarkInfo::setInfoType(INFO_TYPE type) +{ + LLPanel* landmark_info_panel = getChild("landmark_info_panel"); + + bool is_info_type_create_landmark = type == CREATE_LANDMARK; + bool is_info_type_landmark = type == LANDMARK; + + landmark_info_panel->setVisible(is_info_type_landmark); + + getChild("folder_label")->setVisible(is_info_type_create_landmark); + mFolderCombo->setVisible(is_info_type_create_landmark); + + switch(type) + { + case CREATE_LANDMARK: + mCurrentTitle = getString("title_create_landmark"); + + mTitleEditor->setEnabled(TRUE); + mNotesEditor->setEnabled(TRUE); + break; + + case LANDMARK: + default: + mCurrentTitle = getString("title_landmark"); + + mTitleEditor->setEnabled(FALSE); + mNotesEditor->setEnabled(FALSE); + break; + } + + populateFoldersList(); + + LLPanelPlaceInfo::setInfoType(type); +} + +// virtual +void LLPanelLandmarkInfo::processParcelInfo(const LLParcelData& parcel_data) +{ + LLPanelPlaceInfo::processParcelInfo(parcel_data); + + // HACK: Flag 0x2 == adult region, + // Flag 0x1 == mature region, otherwise assume PG + std::string rating = LLViewerRegion::accessToString(SIM_ACCESS_PG); + if (parcel_data.flags & 0x2) + { + rating = LLViewerRegion::accessToString(SIM_ACCESS_ADULT); + } + else if (parcel_data.flags & 0x1) + { + rating = LLViewerRegion::accessToString(SIM_ACCESS_MATURE); + } + + mMaturityRatingText->setValue(rating); + + S32 region_x; + S32 region_y; + S32 region_z; + + // If the region position is zero, grab position from the global + if(mPosRegion.isExactlyZero()) + { + region_x = llround(parcel_data.global_x) % REGION_WIDTH_UNITS; + region_y = llround(parcel_data.global_y) % REGION_WIDTH_UNITS; + region_z = llround(parcel_data.global_z); + } + else + { + region_x = llround(mPosRegion.mV[VX]); + region_y = llround(mPosRegion.mV[VY]); + region_z = llround(mPosRegion.mV[VZ]); + } + + if (mInfoType == CREATE_LANDMARK) + { + if (parcel_data.name.empty()) + { + mTitleEditor->setText(llformat("%s (%d, %d, %d)", + parcel_data.sim_name.c_str(), region_x, region_y, region_z)); + } + else + { + mTitleEditor->setText(parcel_data.name); + } + + std::string desc; + LLAgentUI::buildLocationString(desc, LLAgentUI::LOCATION_FORMAT_FULL, gAgent.getPositionAgent()); + mNotesEditor->setText(desc); + + if (!LLLandmarkActions::landmarkAlreadyExists()) + { + createLandmark(mFolderCombo->getValue().asUUID()); + } + } +} + +void LLPanelLandmarkInfo::displayItemInfo(const LLInventoryItem* pItem) +{ + if (!pItem) + return; + + if(!gCacheName) + return; + + const LLPermissions& perm = pItem->getPermissions(); + + ////////////////// + // CREATOR NAME // + ////////////////// + if (pItem->getCreatorUUID().notNull()) + { + std::string name; + LLUUID creator_id = pItem->getCreatorUUID(); + if (!gCacheName->getFullName(creator_id, name)) + { + gCacheName->get(creator_id, FALSE, + boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mCreator, _2, _3)); + } + mCreator->setText(name); + } + else + { + mCreator->setText(getString("unknown")); + } + + //////////////// + // OWNER NAME // + //////////////// + if(perm.isOwned()) + { + std::string name; + if (perm.isGroupOwned()) + { + LLUUID group_id = perm.getGroup(); + if (!gCacheName->getGroupName(group_id, name)) + { + gCacheName->get(group_id, TRUE, + boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mOwner, _2, _3)); + } + } + else + { + LLUUID owner_id = perm.getOwner(); + if (!gCacheName->getFullName(owner_id, name)) + { + gCacheName->get(owner_id, FALSE, + boost::bind(&LLPanelPlaceInfo::nameUpdatedCallback, mOwner, _2, _3)); + } + } + mOwner->setText(name); + } + else + { + mOwner->setText(getString("public")); + } + + ////////////////// + // ACQUIRE DATE // + ////////////////// + time_t time_utc = pItem->getCreationDate(); + if (0 == time_utc) + { + mCreated->setText(getString("unknown")); + } + else + { + std::string timeStr = getString("acquired_date"); + LLSD substitution; + substitution["datetime"] = (S32) time_utc; + LLStringUtil::format (timeStr, substitution); + mCreated->setText(timeStr); + } + + mTitleEditor->setText(pItem->getName()); + mNotesEditor->setText(pItem->getDescription()); +} + +void LLPanelLandmarkInfo::toggleLandmarkEditMode(BOOL enabled) +{ + // If switching to edit mode while creating landmark + // the "Create Landmark" title remains. + if (enabled && mInfoType != CREATE_LANDMARK) + { + mTitle->setText(getString("title_edit_landmark")); + } + else + { + mTitle->setText(mCurrentTitle); + } + + if (mNotesEditor->getReadOnly() == (enabled == TRUE)) + { + mTitleEditor->setEnabled(enabled); + mNotesEditor->setReadOnly(!enabled); + mFolderCombo->setVisible(enabled); + getChild("folder_label")->setVisible(enabled); + + // HACK: To change the text color in a text editor + // when it was enabled/disabled we set the text once again. + mNotesEditor->setText(mNotesEditor->getText()); + } +} + +const std::string& LLPanelLandmarkInfo::getLandmarkTitle() const +{ + return mTitleEditor->getText(); +} + +const std::string LLPanelLandmarkInfo::getLandmarkNotes() const +{ + return mNotesEditor->getText(); +} + +const LLUUID LLPanelLandmarkInfo::getLandmarkFolder() const +{ + return mFolderCombo->getValue().asUUID(); +} + +BOOL LLPanelLandmarkInfo::setLandmarkFolder(const LLUUID& id) +{ + return mFolderCombo->setCurrentByID(id); +} + +void LLPanelLandmarkInfo::createLandmark(const LLUUID& folder_id) +{ + std::string name = mTitleEditor->getText(); + std::string desc = mNotesEditor->getText(); + + LLStringUtil::trim(name); + LLStringUtil::trim(desc); + + // If typed name is empty use the parcel name instead. + if (name.empty()) + { + name = mParcelName->getText(); + + // If no parcel exists use the region name instead. + if (name.empty()) + { + name = mRegionName->getText(); + } + } + + LLStringUtil::replaceChar(desc, '\n', ' '); + // If no folder chosen use the "Landmarks" folder. + LLLandmarkActions::createLandmarkHere(name, desc, + folder_id.notNull() ? folder_id : gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK)); +} + +// static +std::string LLPanelLandmarkInfo::getFullFolderName(const LLViewerInventoryCategory* cat) +{ + std::string name = cat->getName(); + 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()) + { + 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); + name = cat->getName() + "/" + name; + } + + return name; +} + +void LLPanelLandmarkInfo::populateFoldersList() +{ + // Collect all folders that can contain landmarks. + LLInventoryModel::cat_array_t cats; + collectLandmarkFolders(cats); + + mFolderCombo->removeall(); + + // Put the "Landmarks" folder first in list. + LLUUID landmarks_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK); + const LLViewerInventoryCategory* cat = gInventory.getCategory(landmarks_id); + if (!cat) + { + llwarns << "Cannot find the landmarks folder" << llendl; + } + std::string cat_full_name = getFullFolderName(cat); + mFolderCombo->add(cat_full_name, cat->getUUID()); + + typedef std::vector 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); + folders.push_back(folder_pair_t(cat->getUUID(), cat_full_name)); + } + sort(folders.begin(), folders.end(), cmp_folders); + + // Finally, populate the combobox. + for (folder_vec_t::const_iterator it = folders.begin(); it != folders.end(); it++) + mFolderCombo->add(it->second, LLSD(it->first)); +} + +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) +{ + LLUUID landmarks_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK); + + // Add descendent folders of the "Landmarks" category. + LLInventoryModel::item_array_t items; // unused + LLIsType is_category(LLAssetType::AT_CATEGORY); + gInventory.collectDescendentsIf( + landmarks_id, + cats, + items, + LLInventoryModel::EXCLUDE_TRASH, + is_category); + + // Add the "My Favorites" category. + LLUUID favorites_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_FAVORITE); + LLViewerInventoryCategory* favorites_cat = gInventory.getCategory(favorites_id); + if (!favorites_cat) + { + llwarns << "Cannot find the favorites folder" << llendl; + } + else + { + cats.put(favorites_cat); + } +} -- cgit v1.3 From e8afde0ed3f37ab5920bee3b66060489c53ef380 Mon Sep 17 00:00:00 2001 From: Steve Bennetts Date: Tue, 3 Nov 2009 20:06:26 -0800 Subject: merge fixes. Includes a refactoring of LLParticipantList to fix compile errors on Windows. --- indra/newview/llpanellandmarkinfo.cpp | 8 ++++---- indra/newview/llparticipantlist.cpp | 29 ++++++++++++++++++----------- indra/newview/llparticipantlist.h | 16 ++++++++-------- 3 files changed, 30 insertions(+), 23 deletions(-) (limited to 'indra/newview/llpanellandmarkinfo.cpp') diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index 1152ca6873..6f3b0db498 100644 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -344,7 +344,7 @@ void LLPanelLandmarkInfo::createLandmark(const LLUUID& folder_id) LLStringUtil::replaceChar(desc, '\n', ' '); // If no folder chosen use the "Landmarks" folder. LLLandmarkActions::createLandmarkHere(name, desc, - folder_id.notNull() ? folder_id : gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK)); + folder_id.notNull() ? folder_id : gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK)); } // static @@ -379,7 +379,7 @@ void LLPanelLandmarkInfo::populateFoldersList() mFolderCombo->removeall(); // Put the "Landmarks" folder first in list. - LLUUID landmarks_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK); + LLUUID landmarks_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK); const LLViewerInventoryCategory* cat = gInventory.getCategory(landmarks_id); if (!cat) { @@ -411,7 +411,7 @@ static bool cmp_folders(const folder_pair_t& left, const folder_pair_t& right) static void collectLandmarkFolders(LLInventoryModel::cat_array_t& cats) { - LLUUID landmarks_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK); + LLUUID landmarks_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK); // Add descendent folders of the "Landmarks" category. LLInventoryModel::item_array_t items; // unused @@ -424,7 +424,7 @@ static void collectLandmarkFolders(LLInventoryModel::cat_array_t& cats) is_category); // Add the "My Favorites" category. - LLUUID favorites_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_FAVORITE); + LLUUID favorites_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE); LLViewerInventoryCategory* favorites_cat = gInventory.getCategory(favorites_id); if (!favorites_cat) { diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index 9450bee315..c00c07e53a 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -1,5 +1,5 @@ -/** - * @file llparticipantlist.cpp +llparticipantlist /** + * @file.cpp * @brief LLParticipantList intended to update view(LLAvatarList) according to incoming messages * * $LicenseInfo:firstyear=2009&license=viewergpl$ @@ -45,14 +45,18 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* avatar_list): mSpeakerMgr(data_source), mAvatarList(avatar_list), - mSpeakerAddListener(*this), - mSpeakerRemoveListener(*this), - mSpeakerClearListener(*this), + mSpeakerAddListener(NULL), + mSpeakerRemoveListener(NULL), + mSpeakerClearListener(NULL), mSortOrder(E_SORT_BY_NAME) { - mSpeakerMgr->addListener(&mSpeakerAddListener, "add"); - mSpeakerMgr->addListener(&mSpeakerRemoveListener, "remove"); - mSpeakerMgr->addListener(&mSpeakerClearListener, "clear"); + mSpeakerAddListener = new SpeakerAddListener(this); + mSpeakerRemoveListener = new SpeakerRemoveListener(this); + mSpeakerClearListener = new SpeakerClearListener(this); + + mSpeakerMgr->addListener(mSpeakerAddListener, "add"); + mSpeakerMgr->addListener(mSpeakerRemoveListener, "remove"); + mSpeakerMgr->addListener(mSpeakerClearListener, "clear"); mAvatarList->setNoItemsCommentText(LLTrans::getString("LoadingData")); mAvatarList->setDoubleClickCallback(boost::bind(&LLParticipantList::onAvatarListDoubleClicked, this, mAvatarList)); @@ -71,6 +75,9 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* av LLParticipantList::~LLParticipantList() { + delete mSpeakerAddListener; + delete mSpeakerRemoveListener; + delete mSpeakerClearListener; } void LLParticipantList::onAvatarListDoubleClicked(LLAvatarList* list) @@ -153,7 +160,7 @@ void LLParticipantList::sort() // bool LLParticipantList::SpeakerAddListener::handleEvent(LLPointer event, const LLSD& userdata) { - return mParent.onAddItemEvent(event, userdata); + return mParent->onAddItemEvent(event, userdata); } // @@ -161,7 +168,7 @@ bool LLParticipantList::SpeakerAddListener::handleEvent(LLPointer event, const LLSD& userdata) { - return mParent.onRemoveItemEvent(event, userdata); + return mParent->onRemoveItemEvent(event, userdata); } // @@ -169,5 +176,5 @@ bool LLParticipantList::SpeakerRemoveListener::handleEvent(LLPointer event, const LLSD& userdata) { - return mParent.onClearListEvent(event, userdata); + return mParent->onClearListEvent(event, userdata); } diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h index 04d9e29256..e8d7224906 100644 --- a/indra/newview/llparticipantlist.h +++ b/indra/newview/llparticipantlist.h @@ -71,29 +71,29 @@ class LLParticipantList class BaseSpeakerListner : public LLOldEvents::LLSimpleListener { public: - BaseSpeakerListner(LLParticipantList& parent) : mParent(parent) {} + BaseSpeakerListner(LLParticipantList* parent) : mParent(parent) {} protected: - LLParticipantList& mParent; + LLParticipantList* mParent; }; class SpeakerAddListener : public BaseSpeakerListner { public: - SpeakerAddListener(LLParticipantList& parent) : BaseSpeakerListner(parent) {} + SpeakerAddListener(LLParticipantList* parent) : BaseSpeakerListner(parent) {} /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); }; class SpeakerRemoveListener : public BaseSpeakerListner { public: - SpeakerRemoveListener(LLParticipantList& parent) : BaseSpeakerListner(parent) {} + SpeakerRemoveListener(LLParticipantList* parent) : BaseSpeakerListner(parent) {} /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); }; class SpeakerClearListener : public BaseSpeakerListner { public: - SpeakerClearListener(LLParticipantList& parent) : BaseSpeakerListner(parent) {} + SpeakerClearListener(LLParticipantList* parent) : BaseSpeakerListner(parent) {} /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata); }; @@ -103,9 +103,9 @@ class LLParticipantList LLSpeakerMgr* mSpeakerMgr; LLAvatarList* mAvatarList; - SpeakerAddListener mSpeakerAddListener; - SpeakerRemoveListener mSpeakerRemoveListener; - SpeakerClearListener mSpeakerClearListener; + SpeakerAddListener* mSpeakerAddListener; + SpeakerRemoveListener* mSpeakerRemoveListener; + SpeakerClearListener* mSpeakerClearListener; EParticipantSortOrder mSortOrder; }; -- cgit v1.3 From 2715e94a5ae969956f493609561f0cc144ec2c37 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Wed, 4 Nov 2009 14:33:00 +0200 Subject: Implemented major task EXT-2054 "Hook up parcel permission icons to parcel profile": - Added icon representation of parcel permissions to Place Profile panel. --HG-- branch : product-engine --- indra/newview/llpanellandmarkinfo.cpp | 14 --- indra/newview/llpanelplaceinfo.cpp | 14 +++ indra/newview/llpanelplaceprofile.cpp | 86 ++++++++------- indra/newview/llpanelplaceprofile.h | 13 ++- .../skins/default/xui/en/panel_place_profile.xml | 116 ++------------------- 5 files changed, 84 insertions(+), 159 deletions(-) (limited to 'indra/newview/llpanellandmarkinfo.cpp') diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index 1152ca6873..fd6a41c505 100644 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -139,20 +139,6 @@ void LLPanelLandmarkInfo::processParcelInfo(const LLParcelData& parcel_data) { LLPanelPlaceInfo::processParcelInfo(parcel_data); - // HACK: Flag 0x2 == adult region, - // Flag 0x1 == mature region, otherwise assume PG - std::string rating = LLViewerRegion::accessToString(SIM_ACCESS_PG); - if (parcel_data.flags & 0x2) - { - rating = LLViewerRegion::accessToString(SIM_ACCESS_ADULT); - } - else if (parcel_data.flags & 0x1) - { - rating = LLViewerRegion::accessToString(SIM_ACCESS_MATURE); - } - - mMaturityRatingText->setValue(rating); - S32 region_x; S32 region_y; S32 region_z; diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp index 2c5f4b5afa..e6d10be858 100644 --- a/indra/newview/llpanelplaceinfo.cpp +++ b/indra/newview/llpanelplaceinfo.cpp @@ -209,6 +209,20 @@ void LLPanelPlaceInfo::processParcelInfo(const LLParcelData& parcel_data) mDescEditor->setText(parcel_data.desc); } + // HACK: Flag 0x2 == adult region, + // Flag 0x1 == mature region, otherwise assume PG + std::string rating = LLViewerRegion::accessToString(SIM_ACCESS_PG); + if (parcel_data.flags & 0x2) + { + rating = LLViewerRegion::accessToString(SIM_ACCESS_ADULT); + } + else if (parcel_data.flags & 0x1) + { + rating = LLViewerRegion::accessToString(SIM_ACCESS_MATURE); + } + + mMaturityRatingText->setValue(rating); + S32 region_x; S32 region_y; S32 region_z; diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index 9ba72fe6cf..814139607c 100644 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -84,16 +84,24 @@ BOOL LLPanelPlaceProfile::postBuild() mParcelOwner = getChild("owner_value"); mLastVisited = getChild("last_visited_value"); - mRatingText = getChild("rating_value"); + mParcelRatingIcon = getChild("rating_icon"); + mParcelRatingText = getChild("rating_value"); + mVoiceIcon = getChild("voice_icon"); mVoiceText = getChild("voice_value"); + mFlyIcon = getChild("fly_icon"); mFlyText = getChild("fly_value"); + mPushIcon = getChild("push_icon"); mPushText = getChild("push_value"); + mBuildIcon = getChild("build_icon"); mBuildText = getChild("build_value"); + mScriptsIcon = getChild("scripts_icon"); mScriptsText = getChild("scripts_value"); + mDamageIcon = getChild("damage_icon"); mDamageText = getChild("damage_value"); mRegionNameText = getChild("region_name"); mRegionTypeText = getChild("region_type"); + mRegionRatingIcon = getChild("region_rating_icon"); mRegionRatingText = getChild("region_rating"); mRegionOwnerText = getChild("region_owner"); mRegionGroupText = getChild("region_group"); @@ -128,16 +136,24 @@ void LLPanelPlaceProfile::resetLocation() mParcelOwner->setValue(not_available); mLastVisited->setValue(not_available); - mRatingText->setText(not_available); + mParcelRatingIcon->setValue(not_available); + mParcelRatingText->setText(not_available); + mVoiceIcon->setValue(not_available); mVoiceText->setText(not_available); + mFlyIcon->setValue(not_available); mFlyText->setText(not_available); + mPushIcon->setValue(not_available); mPushText->setText(not_available); + mBuildIcon->setValue(not_available); mBuildText->setText(not_available); - mParcelScriptsText->setText(not_available); + mScriptsIcon->setValue(not_available); + mScriptsText->setText(not_available); + mDamageIcon->setValue(not_available); mDamageText->setText(not_available); mRegionNameText->setValue(not_available); mRegionTypeText->setValue(not_available); + mRegionRatingIcon->setValue(not_available); mRegionRatingText->setValue(not_available); mRegionOwnerText->setValue(not_available); mRegionGroupText->setValue(not_available); @@ -191,33 +207,6 @@ void LLPanelPlaceProfile::setInfoType(INFO_TYPE type) LLPanelPlaceInfo::setInfoType(type); } -// virtual -void LLPanelPlaceProfile::processParcelInfo(const LLParcelData& parcel_data) -{ - LLPanelPlaceInfo::processParcelInfo(parcel_data); - - // HACK: Flag 0x2 == adult region, - // Flag 0x1 == mature region, otherwise assume PG - std::string rating = LLViewerRegion::accessToString(SIM_ACCESS_PG); - if (parcel_data.flags & 0x2) - { - rating = LLViewerRegion::accessToString(SIM_ACCESS_ADULT); - } - else if (parcel_data.flags & 0x1) - { - rating = LLViewerRegion::accessToString(SIM_ACCESS_MATURE); - } - - mMaturityRatingText->setValue(rating); - mRatingText->setValue(rating); - - //update for_sale banner, here we should use DFQ_FOR_SALE instead of PF_FOR_SALE - //because we deal with remote parcel response format - bool is_for_sale = (parcel_data.flags & DFQ_FOR_SALE) && - mInfoType == AGENT ? TRUE : FALSE; - mForSalePanel->setVisible(is_for_sale); -} - void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, LLViewerRegion* region, const LLVector3d& pos_global, @@ -238,19 +227,34 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, // HACK: Converting sim access flags to the format // returned by remote parcel response. - switch(region->getSimAccess()) + U8 sim_access = region->getSimAccess(); + switch(sim_access) { case SIM_ACCESS_MATURE: parcel_data.flags = 0x1; + + mParcelRatingIcon->setValue("parcel_drk_M"); + mRegionRatingIcon->setValue("parcel_drk_M"); break; case SIM_ACCESS_ADULT: parcel_data.flags = 0x2; + + mParcelRatingIcon->setValue("parcel_drk_R"); + mRegionRatingIcon->setValue("parcel_drk_R"); break; default: parcel_data.flags = 0; + + mParcelRatingIcon->setValue("parcel_drk_PG"); + mRegionRatingIcon->setValue("parcel_drk_PG"); } + + std::string rating = LLViewerRegion::accessToString(sim_access); + mParcelRatingText->setText(rating); + mRegionRatingText->setText(rating); + parcel_data.desc = parcel->getDesc(); parcel_data.name = parcel->getName(); parcel_data.sim_name = region->getName(); @@ -268,37 +272,45 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, // Processing parcel characteristics if (parcel->getParcelFlagAllowVoice()) { + mVoiceIcon->setValue("parcel_drk_Voice"); mVoiceText->setText(on); } else { + mVoiceIcon->setValue("parcel_drk_VoiceNo"); mVoiceText->setText(off); } if (!region->getBlockFly() && parcel->getAllowFly()) { + mFlyIcon->setValue("parcel_drk_Fly"); mFlyText->setText(on); } else { + mFlyIcon->setValue("parcel_drk_FlyNo"); mFlyText->setText(off); } if (region->getRestrictPushObject() || parcel->getRestrictPushObject()) { + mPushIcon->setValue("parcel_drk_PushNo"); mPushText->setText(off); } else { + mPushIcon->setValue("parcel_drk_Push"); mPushText->setText(on); } if (parcel->getAllowModify()) { + mBuildIcon->setValue("parcel_drk_Build"); mBuildText->setText(on); } else { + mBuildIcon->setValue("parcel_drk_BuildNo"); mBuildText->setText(off); } @@ -306,25 +318,28 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, (region->getRegionFlags() & REGION_FLAGS_ESTATE_SKIP_SCRIPTS) || !parcel->getAllowOtherScripts()) { + mScriptsIcon->setValue("parcel_drk_ScriptsNo"); mScriptsText->setText(off); } else { + mScriptsIcon->setValue("parcel_drk_Scripts"); mScriptsText->setText(on); } if (region->getAllowDamage() || parcel->getAllowDamage()) { + mDamageIcon->setValue("parcel_drk_Damage"); mDamageText->setText(on); } else { + mDamageIcon->setValue("parcel_drk_DamageNo"); mDamageText->setText(off); } mRegionNameText->setText(region->getName()); mRegionTypeText->setText(region->getSimProductName()); - mRegionRatingText->setText(region->getSimAccessString()); // Determine parcel owner if (parcel->isPublic()) @@ -383,9 +398,6 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, &dwell); if (for_sale) { - // Adding "For Sale" flag in remote parcel response format. - parcel_data.flags |= DFQ_FOR_SALE; - const LLUUID& auth_buyer_id = parcel->getAuthorizedBuyerID(); if(auth_buyer_id.notNull()) { @@ -403,6 +415,8 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, mSaleToText->setText(getString("anyone")); } + mForSalePanel->setVisible(for_sale); + const U8* sign = (U8*)getString("price_text").c_str(); const U8* sqm = (U8*)getString("area_text").c_str(); @@ -455,7 +469,7 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, mSelectedParcelID = parcel->getLocalID(); mLastSelectedRegionID = region->getRegionID(); - processParcelInfo(parcel_data); + LLPanelPlaceInfo::processParcelInfo(parcel_data); mYouAreHerePanel->setVisible(is_current_parcel); getChild("sales_tab")->setVisible(for_sale); diff --git a/indra/newview/llpanelplaceprofile.h b/indra/newview/llpanelplaceprofile.h index d8e4bcb6bd..db54ff8af9 100644 --- a/indra/newview/llpanelplaceprofile.h +++ b/indra/newview/llpanelplaceprofile.h @@ -35,6 +35,7 @@ #include "llpanelplaceinfo.h" +class LLIconCtrl; class LLTextEditor; class LLPanelPlaceProfile : public LLPanelPlaceInfo @@ -49,8 +50,6 @@ public: /*virtual*/ void setInfoType(INFO_TYPE type); - /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); - // Displays information about the currently selected parcel // without sending a request to the server. // If is_current_parcel true shows "You Are Here" banner. @@ -81,16 +80,24 @@ private: LLTextBox* mParcelOwner; LLTextBox* mLastVisited; - LLTextBox* mRatingText; + LLIconCtrl* mParcelRatingIcon; + LLTextBox* mParcelRatingText; + LLIconCtrl* mVoiceIcon; LLTextBox* mVoiceText; + LLIconCtrl* mFlyIcon; LLTextBox* mFlyText; + LLIconCtrl* mPushIcon; LLTextBox* mPushText; + LLIconCtrl* mBuildIcon; LLTextBox* mBuildText; + LLIconCtrl* mScriptsIcon; LLTextBox* mScriptsText; + LLIconCtrl* mDamageIcon; LLTextBox* mDamageText; LLTextBox* mRegionNameText; LLTextBox* mRegionTypeText; + LLIconCtrl* mRegionRatingIcon; LLTextBox* mRegionRatingText; LLTextBox* mRegionOwnerText; LLTextBox* mRegionGroupText; diff --git a/indra/newview/skins/default/xui/en/panel_place_profile.xml b/indra/newview/skins/default/xui/en/panel_place_profile.xml index 7e073f064d..4dc65fa736 100644 --- a/indra/newview/skins/default/xui/en/panel_place_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_place_profile.xml @@ -289,33 +289,14 @@ left="0" top="0" width="275"> - - - - - - - - - - Date: Wed, 4 Nov 2009 15:24:11 +0200 Subject: No ticket. Removed extra includes. Fixed copyright years. --HG-- branch : product-engine --- indra/newview/llpanellandmarkinfo.cpp | 5 +---- indra/newview/llpanellandmarkinfo.h | 2 +- indra/newview/llpanellandmarks.cpp | 2 +- indra/newview/llpanellandmarks.h | 2 +- indra/newview/llpanelpicks.cpp | 2 +- indra/newview/llpanelpicks.h | 2 +- indra/newview/llpanelplaceinfo.cpp | 7 +------ indra/newview/llpanelplaceinfo.h | 2 +- indra/newview/llpanelplaceprofile.cpp | 4 +--- indra/newview/llpanelplaceprofile.h | 2 +- indra/newview/llpanelplaces.cpp | 2 +- indra/newview/llpanelplaces.h | 2 +- indra/newview/llpanelplacestab.cpp | 2 +- indra/newview/llpanelplacestab.h | 2 +- indra/newview/llpanelteleporthistory.cpp | 2 +- indra/newview/llpanelteleporthistory.h | 2 +- 16 files changed, 16 insertions(+), 26 deletions(-) (limited to 'indra/newview/llpanellandmarkinfo.cpp') diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index fd6a41c505..fe01fc6307 100644 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2009&license=viewergpl$ * - * Copyright (c) 2004-2009, Linden Research, Inc. + * Copyright (c) 2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -34,8 +34,6 @@ #include "llpanellandmarkinfo.h" -#include "llinventory.h" - #include "llcombobox.h" #include "lllineeditor.h" #include "lltextbox.h" @@ -44,7 +42,6 @@ #include "llagent.h" #include "llagentui.h" -#include "llinventorymodel.h" #include "lllandmarkactions.h" #include "llviewerinventory.h" #include "llviewerparcelmgr.h" diff --git a/indra/newview/llpanellandmarkinfo.h b/indra/newview/llpanellandmarkinfo.h index 03377986b3..73e0ddb9cc 100644 --- a/indra/newview/llpanellandmarkinfo.h +++ b/indra/newview/llpanellandmarkinfo.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2009&license=viewergpl$ * - * Copyright (c) 2004-2009, Linden Research, Inc. + * Copyright (c) 2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 5f717b51cc..34c146826f 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2009&license=viewergpl$ * - * Copyright (c) 2001-2009, Linden Research, Inc. + * Copyright (c) 2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/indra/newview/llpanellandmarks.h b/indra/newview/llpanellandmarks.h index 0e7abb4865..d54761ed59 100644 --- a/indra/newview/llpanellandmarks.h +++ b/indra/newview/llpanellandmarks.h @@ -5,7 +5,7 @@ * * $LicenseInfo:firstyear=2009&license=viewergpl$ * - * Copyright (c) 2001-2009, Linden Research, Inc. + * Copyright (c) 2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index 6181531f82..2bf04f9681 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2009&license=viewergpl$ * - * Copyright (c) 2004-2009, Linden Research, Inc. + * Copyright (c) 2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/indra/newview/llpanelpicks.h b/indra/newview/llpanelpicks.h index 06a0f0a0fd..5a2754ad10 100644 --- a/indra/newview/llpanelpicks.h +++ b/indra/newview/llpanelpicks.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2009&license=viewergpl$ * - * Copyright (c) 2004-2009, Linden Research, Inc. + * Copyright (c) 2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp index e6d10be858..c600651015 100644 --- a/indra/newview/llpanelplaceinfo.cpp +++ b/indra/newview/llpanelplaceinfo.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2009&license=viewergpl$ * - * Copyright (c) 2004-2009, Linden Research, Inc. + * Copyright (c) 2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -38,8 +38,6 @@ #include "llsdutil.h" #include "llsecondlifeurls.h" -#include "llinventory.h" - #include "llsdutil_math.h" #include "llscrollcontainer.h" @@ -48,15 +46,12 @@ #include "llagent.h" #include "llavatarpropertiesprocessor.h" #include "llexpandabletextbox.h" -#include "llfloaterworldmap.h" -#include "llinventorymodel.h" #include "llpanelpick.h" #include "lltexturectrl.h" #include "llviewerinventory.h" #include "llviewerparcelmgr.h" #include "llviewerregion.h" #include "llviewertexteditor.h" -#include "llworldmap.h" LLPanelPlaceInfo::LLPanelPlaceInfo() : LLPanel(), diff --git a/indra/newview/llpanelplaceinfo.h b/indra/newview/llpanelplaceinfo.h index c9e1347542..ec30397cff 100644 --- a/indra/newview/llpanelplaceinfo.h +++ b/indra/newview/llpanelplaceinfo.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2009&license=viewergpl$ * - * Copyright (c) 2004-2009, Linden Research, Inc. + * Copyright (c) 2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index 814139607c..b2a9f6f251 100644 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2009&license=viewergpl$ * - * Copyright (c) 2004-2009, Linden Research, Inc. + * Copyright (c) 2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab @@ -36,8 +36,6 @@ #include "llparcel.h" -#include "llqueryflags.h" - #include "lliconctrl.h" #include "lllineeditor.h" #include "lltextbox.h" diff --git a/indra/newview/llpanelplaceprofile.h b/indra/newview/llpanelplaceprofile.h index db54ff8af9..b3ef4acf51 100644 --- a/indra/newview/llpanelplaceprofile.h +++ b/indra/newview/llpanelplaceprofile.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2009&license=viewergpl$ * - * Copyright (c) 2004-2009, Linden Research, Inc. + * Copyright (c) 2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 42e4a6e40b..6f15e53299 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2009&license=viewergpl$ * - * Copyright (c) 2004-2009, Linden Research, Inc. + * Copyright (c) 2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/indra/newview/llpanelplaces.h b/indra/newview/llpanelplaces.h index 39eb5261db..8faed613f4 100644 --- a/indra/newview/llpanelplaces.h +++ b/indra/newview/llpanelplaces.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2009&license=viewergpl$ * - * Copyright (c) 2004-2009, Linden Research, Inc. + * Copyright (c) 2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/indra/newview/llpanelplacestab.cpp b/indra/newview/llpanelplacestab.cpp index 7c0a7b0cc4..f5e7ff3c40 100644 --- a/indra/newview/llpanelplacestab.cpp +++ b/indra/newview/llpanelplacestab.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2009&license=viewergpl$ * - * Copyright (c) 2004-2009, Linden Research, Inc. + * Copyright (c) 2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/indra/newview/llpanelplacestab.h b/indra/newview/llpanelplacestab.h index 1c70869414..3f56dcb283 100644 --- a/indra/newview/llpanelplacestab.h +++ b/indra/newview/llpanelplacestab.h @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2009&license=viewergpl$ * - * Copyright (c) 2004-2009, Linden Research, Inc. + * Copyright (c) 2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index 7dd9df674c..437af1c4e7 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2009&license=viewergpl$ * - * Copyright (c) 2001-2009, Linden Research, Inc. + * Copyright (c) 2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab diff --git a/indra/newview/llpanelteleporthistory.h b/indra/newview/llpanelteleporthistory.h index 7c1b403432..b34d9e876c 100644 --- a/indra/newview/llpanelteleporthistory.h +++ b/indra/newview/llpanelteleporthistory.h @@ -5,7 +5,7 @@ * * $LicenseInfo:firstyear=2009&license=viewergpl$ * - * Copyright (c) 2001-2009, Linden Research, Inc. + * Copyright (c) 2009, Linden Research, Inc. * * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab -- cgit v1.3