From b43da6721e538290962cafa7ddd32a8f4c7e21db Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Fri, 6 May 2011 18:29:43 -0700 Subject: [PATCH] Viewer UI work to add icons for the nav bar and places profile to indicate parcel privacy settings. Using engineering art icons. --- indra/newview/lllocationinputctrl.cpp | 13 +++++++ indra/newview/lllocationinputctrl.h | 16 +++++---- indra/newview/llpanelplaceprofile.cpp | 19 ++++++++++ indra/newview/llpanelplaceprofile.h | 2 ++ indra/newview/llpaneltopinfobar.cpp | 8 +++++ indra/newview/llpaneltopinfobar.h | 13 +++---- .../textures/icons/Parcel_PrivacyOff_Dark.png | Bin 0 -> 787 bytes .../textures/icons/Parcel_PrivacyOn_Dark.png | Bin 0 -> 833 bytes .../skins/default/textures/textures.xml | 4 ++- .../skins/default/xui/en/notifications.xml | 11 ++++++ .../default/xui/en/panel_place_profile.xml | 33 ++++++++++++++++++ .../default/xui/en/panel_topinfo_bar.xml | 10 ++++++ .../newview/skins/default/xui/en/strings.xml | 1 + .../default/xui/en/widgets/location_input.xml | 9 +++++ .../minimal/xui/en/widgets/location_input.xml | 9 +++++ 15 files changed, 134 insertions(+), 14 deletions(-) create mode 100644 indra/newview/skins/default/textures/icons/Parcel_PrivacyOff_Dark.png create mode 100644 indra/newview/skins/default/textures/icons/Parcel_PrivacyOn_Dark.png diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index 5c65dcec34..c68d1bb845 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -190,6 +190,7 @@ LLLocationInputCtrl::Params::Params() scripts_icon("scripts_icon"), damage_icon("damage_icon"), damage_text("damage_text"), + privacy_icon("privacy_icon"), maturity_help_topic("maturity_help_topic") { } @@ -342,6 +343,13 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p) mDamageText = LLUICtrlFactory::create(damage_text); addChild(mDamageText); + LLIconCtrl::Params privacy_icon = p.privacy_icon; + privacy_icon.tool_tip = LLTrans::getString("LocationCtrlPrivacyTooltip"); + privacy_icon.mouse_opaque = true; + mParcelIcon[PRIVACY_ICON] = LLUICtrlFactory::create(privacy_icon); + mParcelIcon[PRIVACY_ICON]->setMouseDownCallback(boost::bind(&LLLocationInputCtrl::onParcelIconClick, this, PRIVACY_ICON)); + addChild(mParcelIcon[PRIVACY_ICON]); + // Register callbacks and load the location field context menu (NB: the order matters). LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Navbar.Action", boost::bind(&LLLocationInputCtrl::onLocationContextMenuItemClicked, this, _2)); LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Navbar.EnableMenuItem", boost::bind(&LLLocationInputCtrl::onLocationContextMenuItemEnabled, this, _2)); @@ -810,6 +818,7 @@ void LLLocationInputCtrl::refreshParcelIcons() bool allow_build = vpm->allowAgentBuild(current_parcel); // true when anyone is allowed to build. See EXT-4610. bool allow_scripts = vpm->allowAgentScripts(agent_region, current_parcel); bool allow_damage = vpm->allowAgentDamage(agent_region, current_parcel); + bool privacy = current_parcel->getPrivacy(); // Most icons are "block this ability" mParcelIcon[VOICE_ICON]->setVisible( !allow_voice ); @@ -819,6 +828,7 @@ void LLLocationInputCtrl::refreshParcelIcons() mParcelIcon[SCRIPTS_ICON]->setVisible( !allow_scripts ); mParcelIcon[DAMAGE_ICON]->setVisible( allow_damage ); mDamageText->setVisible(allow_damage); + mParcelIcon[PRIVACY_ICON]->setVisible( privacy ); // Padding goes to left of both landmark star and for sale btn x -= mAddLandmarkHPad; @@ -1175,6 +1185,9 @@ void LLLocationInputCtrl::onParcelIconClick(EParcelIcon icon) case DAMAGE_ICON: LLNotificationsUtil::add("NotSafe"); break; + case PRIVACY_ICON: + LLNotificationsUtil::add("PrivateParcel"); + break; case ICON_COUNT: break; // no default to get compiler warning when a new icon gets added diff --git a/indra/newview/lllocationinputctrl.h b/indra/newview/lllocationinputctrl.h index 6368bf5cf2..ee4e55e829 100644 --- a/indra/newview/lllocationinputctrl.h +++ b/indra/newview/lllocationinputctrl.h @@ -77,7 +77,8 @@ public: push_icon, build_icon, scripts_icon, - damage_icon; + damage_icon, + privacy_icon; Optional damage_text; Params(); }; @@ -109,12 +110,13 @@ private: enum EParcelIcon { VOICE_ICON = 0, - FLY_ICON, - PUSH_ICON, - BUILD_ICON, - SCRIPTS_ICON, - DAMAGE_ICON, - ICON_COUNT + FLY_ICON, // 1 + PUSH_ICON, // 2 + BUILD_ICON, // 3 + SCRIPTS_ICON, // 4 + DAMAGE_ICON, // 5 + PRIVACY_ICON, // 6 + ICON_COUNT // 7 total }; friend class LLUICtrlFactory; diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index 68ecb0165c..da6a9fbbc6 100644 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -70,6 +70,8 @@ static std::string icon_scripts; static std::string icon_scripts_no; static std::string icon_damage; static std::string icon_damage_no; +static std::string icon_privacy_on; +static std::string icon_privacy_off; LLPanelPlaceProfile::LLPanelPlaceProfile() : LLPanelPlaceInfo(), @@ -114,6 +116,8 @@ BOOL LLPanelPlaceProfile::postBuild() mScriptsText = getChild("scripts_value"); mDamageIcon = getChild("damage_icon"); mDamageText = getChild("damage_value"); + mPrivacyIcon = getChild("privacy_icon"); + mPrivacyText = getChild("privacy_value"); mRegionNameText = getChild("region_name"); mRegionTypeText = getChild("region_type"); @@ -153,6 +157,8 @@ BOOL LLPanelPlaceProfile::postBuild() icon_scripts_no = getString("icon_ScriptsNo"); icon_damage = getString("icon_Damage"); icon_damage_no = getString("icon_DamageNo"); + icon_privacy_on = getString("icon_PrivacyOn"); + icon_privacy_off = getString("icon_PrivacyOff"); return TRUE; } @@ -182,6 +188,8 @@ void LLPanelPlaceProfile::resetLocation() mScriptsText->setText(loading); mDamageIcon->setValue(loading); mDamageText->setText(loading); + mPrivacyIcon->setValue(loading); + mPrivacyText->setText(loading); mRegionNameText->setValue(loading); mRegionTypeText->setValue(loading); @@ -414,6 +422,17 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, mDamageText->setText(off); } + if (parcel->getPrivacy()) + { + mPrivacyIcon->setValue(icon_privacy_on); + mPrivacyText->setText(on); + } + else + { + mPrivacyIcon->setValue(icon_privacy_off); + mPrivacyText->setText(off); + } + mRegionNameText->setText(region->getName()); mRegionTypeText->setText(region->getSimProductName()); diff --git a/indra/newview/llpanelplaceprofile.h b/indra/newview/llpanelplaceprofile.h index f28b3b3832..b20107dc4b 100644 --- a/indra/newview/llpanelplaceprofile.h +++ b/indra/newview/llpanelplaceprofile.h @@ -91,6 +91,8 @@ private: LLTextBox* mScriptsText; LLIconCtrl* mDamageIcon; LLTextBox* mDamageText; + LLIconCtrl* mPrivacyIcon; + LLTextBox* mPrivacyText; LLTextBox* mRegionNameText; LLTextBox* mRegionTypeText; diff --git a/indra/newview/llpaneltopinfobar.cpp b/indra/newview/llpaneltopinfobar.cpp index 30949f8f02..c2359b8b23 100644 --- a/indra/newview/llpaneltopinfobar.cpp +++ b/indra/newview/llpaneltopinfobar.cpp @@ -102,6 +102,7 @@ void LLPanelTopInfoBar::initParcelIcons() mParcelIcon[BUILD_ICON] = getChild("build_icon"); mParcelIcon[SCRIPTS_ICON] = getChild("scripts_icon"); mParcelIcon[DAMAGE_ICON] = getChild("damage_icon"); + mParcelIcon[PRIVACY_ICON] = getChild("privacy_icon"); mParcelIcon[VOICE_ICON]->setToolTip(LLTrans::getString("LocationCtrlVoiceTooltip")); mParcelIcon[FLY_ICON]->setToolTip(LLTrans::getString("LocationCtrlFlyTooltip")); @@ -109,6 +110,7 @@ void LLPanelTopInfoBar::initParcelIcons() mParcelIcon[BUILD_ICON]->setToolTip(LLTrans::getString("LocationCtrlBuildTooltip")); mParcelIcon[SCRIPTS_ICON]->setToolTip(LLTrans::getString("LocationCtrlScriptsTooltip")); mParcelIcon[DAMAGE_ICON]->setToolTip(LLTrans::getString("LocationCtrlDamageTooltip")); + mParcelIcon[PRIVACY_ICON]->setToolTip(LLTrans::getString("LocationCtrlPrivacyTooltip")); mParcelIcon[VOICE_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, VOICE_ICON)); mParcelIcon[FLY_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, FLY_ICON)); @@ -116,6 +118,7 @@ void LLPanelTopInfoBar::initParcelIcons() mParcelIcon[BUILD_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, BUILD_ICON)); mParcelIcon[SCRIPTS_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, SCRIPTS_ICON)); mParcelIcon[DAMAGE_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, DAMAGE_ICON)); + mParcelIcon[PRIVACY_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, PRIVACY_ICON)); mDamageText->setText(LLStringExplicit("100%")); } @@ -295,6 +298,7 @@ void LLPanelTopInfoBar::updateParcelIcons() bool allow_build = vpm->allowAgentBuild(current_parcel); // true when anyone is allowed to build. See EXT-4610. bool allow_scripts = vpm->allowAgentScripts(agent_region, current_parcel); bool allow_damage = vpm->allowAgentDamage(agent_region, current_parcel); + bool privacy = current_parcel->getPrivacy(); // Most icons are "block this ability" mParcelIcon[VOICE_ICON]->setVisible( !allow_voice ); @@ -304,6 +308,7 @@ void LLPanelTopInfoBar::updateParcelIcons() mParcelIcon[SCRIPTS_ICON]->setVisible( !allow_scripts ); mParcelIcon[DAMAGE_ICON]->setVisible( allow_damage ); mDamageText->setVisible(allow_damage); + mParcelIcon[PRIVACY_ICON]->setVisible( privacy ); layoutParcelIcons(); } @@ -409,6 +414,9 @@ void LLPanelTopInfoBar::onParcelIconClick(EParcelIcon icon) case DAMAGE_ICON: LLNotificationsUtil::add("NotSafe"); break; + case PRIVACY_ICON: + LLNotificationsUtil::add("PrivateParcel"); + break; case ICON_COUNT: break; // no default to get compiler warning when a new icon gets added diff --git a/indra/newview/llpaneltopinfobar.h b/indra/newview/llpaneltopinfobar.h index db922ef424..f497ce9633 100644 --- a/indra/newview/llpaneltopinfobar.h +++ b/indra/newview/llpaneltopinfobar.h @@ -65,12 +65,13 @@ private: enum EParcelIcon { VOICE_ICON = 0, - FLY_ICON, - PUSH_ICON, - BUILD_ICON, - SCRIPTS_ICON, - DAMAGE_ICON, - ICON_COUNT + FLY_ICON, // 1 + PUSH_ICON, // 2 + BUILD_ICON, // 3 + SCRIPTS_ICON, // 4 + DAMAGE_ICON, // 5 + PRIVACY_ICON, // 6 + ICON_COUNT // 7 total }; /** diff --git a/indra/newview/skins/default/textures/icons/Parcel_PrivacyOff_Dark.png b/indra/newview/skins/default/textures/icons/Parcel_PrivacyOff_Dark.png new file mode 100644 index 0000000000000000000000000000000000000000..5f9fba44470d85f13229ca182769e518a01da19f GIT binary patch literal 787 zcmV+u1MK{XP)Px#24YJ`L;#rpnE;tyL{@5T5w?ahMD1= zVdkAr2*Z&35UFeI?(WJ!0K5X803q<+FpO`V_+!8Ws(%9*hS3*T2*a=oDgz&Z=lOh| zWHQOs)sH3N|8#XC>D!2jzf0`ilQ(* zJxv&f*tU(LD9xp%rO!akFpM|-I^LX}on0Lt9|u5HRnE`PuYm&izK`QLEG{mh>pHe= zk8EviEq6w716bVH*m$SwI;yJDnIV^#m-J&xtJUh+x~?-nKTjkQ={pLs^Lqb7sY<0n zJRbiw2>3&z(dap4Stc5d-bhvy1%O7QK`xi0*=*8ow|@-c@oJ$^SkW|%a=A=8on~fc zhDxP^@B07@4Gobq|Q!FAmPpaBmxP1^$+0JU0;xw$#=`8=^$jJ373yHC19 zsYi#0hwUH;j(~k&-}5|1M@N~On&R~Il%1U&#>U2|*Xsip+w0i2?OT&ttrni=vAw;` zPx#24YJ`L;#rpnE;tyL{@pC-vos!XJ$OOTwnHLef40@1( ztR8lf!5BLZ<}N$!u!DDd@UY_sV;~5N7jN|sXc-i2q?nl$e_n3sWz0DF6T;{N{rXUnoiYPA~e?d`$Qtm_Z_=9a%*;$#5QGj<6uVs4C7n)_PN!L0Tf;O> zf*DAXM1Oxjp65|47Lg?B*Tlrc7vQ_D>n~a{&Sx^2*`A&r0AyL_`1tq?D1hTQn5N12 z_&A!TQ7jfa78e&MeJTC{4$aNYz0oucS(foN7~tUGfO5Hv<2V4cwYAaR-ObU_5w7bZAuy(@^uB#Z==Vu; z|9qlSnic{r4a1n;+S+<02tu!AS!aY(6lK-2tffdKQtIpL8%xDHviF|747N=m2c&>m zf6a+aCZ7l90W8bv0u&&jD9Wm)X;n?rf>-a{T=vdod$R#SJX*;Q|`_E>@W@alZ zD|c<%uDh;lXS3N&V6)X=+IA|Ze1P{r&Q7ZM;0B-z=WS&e#{bMPnwfe!<$wNQqEgzh zlj^*GpZA-kgp1Pcq6WIIV<*)oKFB(tCn}|%c2b?MheEkXqXCc?E{o0c;LTxUC)KY$ zyPDr1_3iepRC@164Hy)zn#Xoh?etxc18xNW1MoaiDeVZ?74&}r=_4f*CKIH%00000 LNkvXXu0mjf4JUuM literal 0 HcmV?d00001 diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 1ca48b01a8..93dab65bcd 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -1,4 +1,4 @@ - diff --git a/indra/newview/skins/default/xui/en/widgets/location_input.xml b/indra/newview/skins/default/xui/en/widgets/location_input.xml index 37d60f1671..c818cdfaeb 100644 --- a/indra/newview/skins/default/xui/en/widgets/location_input.xml +++ b/indra/newview/skins/default/xui/en/widgets/location_input.xml @@ -123,6 +123,15 @@ font="SansSerifSmall" text_color="TextFgColor" /> + +