diff options
author | Sergei Litovchuk <slitovchuk@productengine.com> | 2009-11-04 14:33:00 +0200 |
---|---|---|
committer | Sergei Litovchuk <slitovchuk@productengine.com> | 2009-11-04 14:33:00 +0200 |
commit | 2715e94a5ae969956f493609561f0cc144ec2c37 (patch) | |
tree | cbf2c2e184c15a0bed0bfdbbde30d6867564ce76 /indra/newview | |
parent | 6698c134b2c83b317df302f7b2f8f94124fc12e0 (diff) |
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
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llpanellandmarkinfo.cpp | 14 | ||||
-rw-r--r-- | indra/newview/llpanelplaceinfo.cpp | 14 | ||||
-rw-r--r-- | indra/newview/llpanelplaceprofile.cpp | 86 | ||||
-rw-r--r-- | indra/newview/llpanelplaceprofile.h | 13 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_place_profile.xml | 116 |
5 files changed, 84 insertions, 159 deletions
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<LLTextBox>("owner_value"); mLastVisited = getChild<LLTextBox>("last_visited_value"); - mRatingText = getChild<LLTextBox>("rating_value"); + mParcelRatingIcon = getChild<LLIconCtrl>("rating_icon"); + mParcelRatingText = getChild<LLTextBox>("rating_value"); + mVoiceIcon = getChild<LLIconCtrl>("voice_icon"); mVoiceText = getChild<LLTextBox>("voice_value"); + mFlyIcon = getChild<LLIconCtrl>("fly_icon"); mFlyText = getChild<LLTextBox>("fly_value"); + mPushIcon = getChild<LLIconCtrl>("push_icon"); mPushText = getChild<LLTextBox>("push_value"); + mBuildIcon = getChild<LLIconCtrl>("build_icon"); mBuildText = getChild<LLTextBox>("build_value"); + mScriptsIcon = getChild<LLIconCtrl>("scripts_icon"); mScriptsText = getChild<LLTextBox>("scripts_value"); + mDamageIcon = getChild<LLIconCtrl>("damage_icon"); mDamageText = getChild<LLTextBox>("damage_value"); mRegionNameText = getChild<LLTextBox>("region_name"); mRegionTypeText = getChild<LLTextBox>("region_type"); + mRegionRatingIcon = getChild<LLIconCtrl>("region_rating_icon"); mRegionRatingText = getChild<LLTextBox>("region_rating"); mRegionOwnerText = getChild<LLTextBox>("region_owner"); mRegionGroupText = getChild<LLTextBox>("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<LLAccordionCtrlTab>("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 @@ -292,30 +292,11 @@ <icon follows="top|left" height="16" - image_name="parcel_drk_M" - layout="topleft" - left="20" - name="icon_M" - top="0" - width="18" /> - <icon - follows="top|left" - height="16" - image_name="parcel_drk_R" - layout="topleft" - left="20" - name="icon_R" - top="0" - width="18" /> - <icon - follows="top|left" - height="16" image_name="parcel_drk_PG" layout="topleft" left="20" - name="icon_PG" + name="rating_icon" top="0" - visible="false" width="18" /> <text follows="left|top" @@ -332,7 +313,7 @@ left_pad="0" name="rating_value" top_delta="0" - value="Mature" + value="unknown" width="120" /> <icon follows="top|left" @@ -340,19 +321,9 @@ image_name="parcel_drk_Voice" layout="topleft" left="20" - name="icon_Voice" + name="voice_icon" top_pad="5" width="22" /> - <icon - follows="top|left" - height="18" - image_name="parcel_drk_VoiceNo" - layout="topleft" - left="20" - name="icon_VoiceNo" - top_delta="0" - visible="false" - width="22" /> <text follows="left|top" height="18" @@ -377,19 +348,9 @@ image_name="parcel_drk_Fly" layout="topleft" left="20" - name="icon_Fly" + name="fly_icon" top_pad="3" width="22" /> - <icon - follows="top|left" - height="18" - image_name="parcel_drk_FlyNo" - layout="topleft" - left="20" - name="icon_FlyNo" - top_delta="0" - visible="false" - width="22" /> <text follows="left|top" height="16" @@ -413,18 +374,8 @@ image_name="parcel_drk_Push" layout="topleft" left="20" - name="icon_Push" + name="push_icon" top_pad="3" - visible="false" - width="22" /> - <icon - follows="top|left" - height="18" - image_name="parcel_drk_PushNo" - layout="topleft" - left="20" - name="icon_PushNo" - top_delta="0" width="22" /> <text follows="left|top" @@ -449,18 +400,9 @@ image_name="parcel_drk_Build" layout="topleft" left="20" - name="icon_Build" + name="build_icon" top_pad="3" width="22" /> - <icon - follows="top|left" - height="18" - image_name="parcel_drk_BuildNo" - layout="topleft" - left="20" - name="icon_BuildNo" - top_delta="0" - visible="false" /> <text follows="left|top" height="14" @@ -484,18 +426,9 @@ image_name="parcel_drk_Scripts" layout="topleft" left="20" - name="icon_Scripts" + name="scripts_icon" top_pad="3" width="22" /> - <icon - follows="top|left" - height="18" - image_name="parcel_drk_ScriptsNo" - layout="topleft" - left="20" - name="icon_ScriptsNo" - top_delta="0" - visible="false" /> <text follows="left|top" height="14" @@ -519,18 +452,9 @@ image_name="parcel_drk_Damage" layout="topleft" left="20" - name="icon_Damage" + name="damage_icon" top_pad="7" - visible="false" width="22" /> - <icon - follows="top|left" - height="18" - image_name="parcel_drk_DamageNo" - layout="topleft" - left="20" - name="icon_DamageNo" - top_delta="0" /> <text follows="left|top" height="14" @@ -625,30 +549,10 @@ <icon follows="top|left" height="16" - image_name="parcel_drk_M" - layout="topleft" - left_pad="0" - name="icon_M" - width="18" /> - <icon - follows="top|left" - height="16" - image_name="parcel_drk_R" - layout="topleft" - left_delta="0" - name="icon_R" - top_delta="0" - visible="false" - width="18" /> - <icon - follows="top|left" - height="16" image_name="parcel_drk_PG" layout="topleft" - left_delta="0" - name="icon_PG" - top_delta="0" - visible="false" + left_pad="0" + name="region_rating_icon" width="18" /> <text follows="left|top|right" |