diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-01-28 12:31:25 -0800 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-01-28 12:31:25 -0800 |
commit | fc8e185fafcfea1ead8b9c064ed38d5ac65f81b6 (patch) | |
tree | 86bd9fff165d9752c5a68af9fa87d05c20a51dc7 /indra/newview | |
parent | 3d8bd2b166b86e9fa1416d20dedc111a42c2a348 (diff) | |
parent | d383adfc92e099676313ed930b2c1c8b1a315ae3 (diff) |
PE merge.
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/lllocationinputctrl.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llpanelavatar.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llpanelplaces.h | 4 | ||||
-rw-r--r-- | indra/newview/lltoastimpanel.cpp | 51 | ||||
-rw-r--r-- | indra/newview/lltoastimpanel.h | 7 | ||||
-rw-r--r-- | indra/newview/llviewerparcelmgr.cpp | 4 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/widgets/location_input.xml | 2 |
7 files changed, 61 insertions, 16 deletions
diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index 7f49a7defb..050cfcc3d9 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -39,6 +39,7 @@ #include "llbutton.h" #include "llfocusmgr.h" #include "llmenugl.h" +#include "llparcel.h" #include "llstring.h" #include "lltrans.h" #include "lluictrlfactory.h" @@ -672,11 +673,12 @@ void LLLocationInputCtrl::refreshParcelIcons() if (show_properties) { LLViewerParcelMgr* vpm = LLViewerParcelMgr::getInstance(); - bool allow_buy = vpm->canAgentBuyParcel( vpm->getAgentParcel(), false); + LLParcel* agent_parcel = vpm->getAgentParcel(); + bool allow_buy = vpm->canAgentBuyParcel( agent_parcel, false); bool allow_voice = vpm->allowAgentVoice(); bool allow_fly = vpm->allowAgentFly(); bool allow_push = vpm->allowAgentPush(); - bool allow_build = vpm->allowAgentBuild(); + bool allow_build = agent_parcel && agent_parcel->getAllowModify(); // true when anyone is allowed to build. See EXT-4610. bool allow_scripts = vpm->allowAgentScripts(); bool allow_damage = vpm->allowAgentDamage(); diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index fe5b20813a..48dd5513bd 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -635,6 +635,9 @@ void LLPanelAvatarProfile::fillCommonData(const LLAvatarData* avatar_data) childSetValue("2nd_life_pic", avatar_data->image_id); childSetValue("real_world_pic", avatar_data->fl_image_id); childSetValue("homepage_edit", avatar_data->profile_url); + + // Hide home page textbox if no page was set to fix "homepage URL appears clickable without URL - EXT-4734" + childSetVisible("homepage_edit", !avatar_data->profile_url.empty()); } void LLPanelAvatarProfile::fillPartnerData(const LLAvatarData* avatar_data) diff --git a/indra/newview/llpanelplaces.h b/indra/newview/llpanelplaces.h index 5de78b1595..110d7a1054 100644 --- a/indra/newview/llpanelplaces.h +++ b/indra/newview/llpanelplaces.h @@ -32,9 +32,9 @@ #ifndef LL_LLPANELPLACES_H #define LL_LLPANELPLACES_H -#include "llpanel.h" +#include "lltimer.h" -class LLTimer; +#include "llpanel.h" class LLInventoryItem; class LLFilterEditor; diff --git a/indra/newview/lltoastimpanel.cpp b/indra/newview/lltoastimpanel.cpp index d62017cc2f..89a58cd736 100644 --- a/indra/newview/lltoastimpanel.cpp +++ b/indra/newview/lltoastimpanel.cpp @@ -33,22 +33,25 @@ #include "llviewerprecompiledheaders.h" #include "lltoastimpanel.h" +#include "llfloaterreg.h" #include "llnotifications.h" #include "llinstantmessage.h" +#include "lltooltip.h" + #include "llviewerchat.h" const S32 LLToastIMPanel::DEFAULT_MESSAGE_MAX_LINE_COUNT = 6; //-------------------------------------------------------------------------- LLToastIMPanel::LLToastIMPanel(LLToastIMPanel::Params &p) : LLToastPanel(p.notification), - mAvatar(NULL), mUserName(NULL), + mAvatarIcon(NULL), mAvatarName(NULL), mTime(NULL), mMessage(NULL) { LLUICtrlFactory::getInstance()->buildPanel(this, "panel_instant_message.xml"); LLIconCtrl* sys_msg_icon = getChild<LLIconCtrl>("sys_msg_icon"); - mAvatar = getChild<LLAvatarIconCtrl>("avatar_icon"); - mUserName = getChild<LLTextBox>("user_name"); + mAvatarIcon = getChild<LLAvatarIconCtrl>("avatar_icon"); + mAvatarName = getChild<LLTextBox>("user_name"); mTime = getChild<LLTextBox>("time_box"); mMessage = getChild<LLTextBox>("message"); @@ -77,22 +80,23 @@ LLToastIMPanel::LLToastIMPanel(LLToastIMPanel::Params &p) : LLToastPanel(p.notif mMessage->setValue(p.message); } - mUserName->setValue(p.from); + mAvatarName->setValue(p.from); mTime->setValue(p.time); mSessionID = p.session_id; + mAvatarID = p.avatar_id; mNotification = p.notification; if(p.from == SYSTEM_FROM) { - mAvatar->setVisible(FALSE); + mAvatarIcon->setVisible(FALSE); sys_msg_icon->setVisible(TRUE); } else { - mAvatar->setVisible(TRUE); + mAvatarIcon->setVisible(TRUE); sys_msg_icon->setVisible(FALSE); - mAvatar->setValue(p.avatar_id); + mAvatarIcon->setValue(p.avatar_id); } S32 maxLinesCount; @@ -119,3 +123,36 @@ BOOL LLToastIMPanel::handleMouseDown(S32 x, S32 y, MASK mask) return TRUE; } + +//virtual +BOOL LLToastIMPanel::handleToolTip(S32 x, S32 y, MASK mask) +{ + // It's not our direct child, so parentPointInView() doesn't work. + LLRect name_rect; + mAvatarName->localRectToOtherView(mAvatarName->getLocalRect(), &name_rect, this); + if (!name_rect.pointInRect(x, y)) + return LLToastPanel::handleToolTip(x, y, mask); + + // Spawn at right side of the name textbox. + LLRect sticky_rect = mAvatarName->calcScreenRect(); + S32 icon_x = llmin(sticky_rect.mLeft + mAvatarName->getTextPixelWidth() + 3, sticky_rect.mRight - 16); + LLCoordGL pos(icon_x, sticky_rect.mTop); + + LLToolTip::Params params; + params.background_visible(false); + params.click_callback(boost::bind(&LLToastIMPanel::showInspector, this)); + params.delay_time(0.0f); // spawn instantly on hover + params.image(LLUI::getUIImage("Info_Small")); + params.message(""); + params.padding(0); + params.pos(pos); + params.sticky_rect(sticky_rect); + + LLToolTipMgr::getInstance()->show(params); + return TRUE; +} + +void LLToastIMPanel::showInspector() +{ + LLFloaterReg::showInstance("inspect_avatar", LLSD().with("avatar_id", mAvatarID)); +} diff --git a/indra/newview/lltoastimpanel.h b/indra/newview/lltoastimpanel.h index 53661f2cf6..154e6dae16 100644 --- a/indra/newview/lltoastimpanel.h +++ b/indra/newview/lltoastimpanel.h @@ -58,13 +58,16 @@ public: LLToastIMPanel(LLToastIMPanel::Params &p); virtual ~LLToastIMPanel(); /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); + /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask); private: + void showInspector(); static const S32 DEFAULT_MESSAGE_MAX_LINE_COUNT; LLNotificationPtr mNotification; LLUUID mSessionID; - LLAvatarIconCtrl* mAvatar; - LLTextBox* mUserName; + LLUUID mAvatarID; + LLAvatarIconCtrl* mAvatarIcon; + LLTextBox* mAvatarName; LLTextBox* mTime; LLTextBox* mMessage; }; diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 10a95443f1..b3450a8f36 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -706,8 +706,8 @@ bool LLViewerParcelMgr::allowAgentScripts() const bool LLViewerParcelMgr::allowAgentDamage() const { LLViewerRegion* region = gAgent.getRegion(); - return region && region->getAllowDamage() - && mAgentParcel && mAgentParcel->getAllowDamage(); + return (region && region->getAllowDamage()) + || (mAgentParcel && mAgentParcel->getAllowDamage()); } BOOL LLViewerParcelMgr::isOwnedAt(const LLVector3d& pos_global) const 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 1c0a8ba7c5..70a58b8e03 100644 --- a/indra/newview/skins/default/xui/en/widgets/location_input.xml +++ b/indra/newview/skins/default/xui/en/widgets/location_input.xml @@ -96,7 +96,7 @@ name="damage_icon" width="14" height="13" - top="25" + top="21" left="2" follows="right|top" image_name="Parcel_Damage_Dark" |