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') 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"> - - - - - - - - - -