From f479235aaa94555ee0ea7a663187ae9930d7d5f4 Mon Sep 17 00:00:00 2001 From: pavelkproductengine Date: Tue, 19 May 2015 13:20:46 +0300 Subject: MAINT-4734 (Separate transaction notices from group notice/invites) 1) disabled popup show (toast) when clicking on notification in expanded view; 2) made attachment in Group Notice notification clickable (copied logic from LLToastGroupNotifyPanel); 3) removed border around notification text in expanded view and made lighter background; 4) removed border around attachment field in expanded notification view. --- indra/newview/llfloaternotificationstabbed.cpp | 2 +- indra/newview/llnotificationlistitem.cpp | 55 +++++- indra/newview/llnotificationlistitem.h | 52 +++--- .../xui/en/panel_notification_list_item.xml | 196 ++++++++++----------- 4 files changed, 180 insertions(+), 125 deletions(-) diff --git a/indra/newview/llfloaternotificationstabbed.cpp b/indra/newview/llfloaternotificationstabbed.cpp index fd5f1486d9..70213680f3 100644 --- a/indra/newview/llfloaternotificationstabbed.cpp +++ b/indra/newview/llfloaternotificationstabbed.cpp @@ -402,7 +402,7 @@ void LLFloaterNotificationsTabbed::onStoreToast(LLPanel* info_panel, LLUUID id) void LLFloaterNotificationsTabbed::onItemClick(LLNotificationListItem* item) { LLUUID id = item->getID(); - LLFloaterReg::showInstance("inspect_toast", id); + //LLFloaterReg::showInstance("inspect_toast", id); } //--------------------------------------------------------------------------------- diff --git a/indra/newview/llnotificationlistitem.cpp b/indra/newview/llnotificationlistitem.cpp index 6b674fcc7d..8e7671897d 100644 --- a/indra/newview/llnotificationlistitem.cpp +++ b/indra/newview/llnotificationlistitem.cpp @@ -57,7 +57,7 @@ BOOL LLNotificationListItem::postBuild() BOOL rv = LLPanel::postBuild(); mTitleBox = getChild("notification_title"); mTitleBoxExp = getChild("notification_title_exp"); - mNoticeTextExp = getChild("notification_text_exp"); + mNoticeTextExp = getChild("notification_text_exp"); mTimeBox = getChild("notification_time"); mTimeBoxExp = getChild("notification_time_exp"); @@ -115,6 +115,7 @@ std::string LLNotificationListItem::buildNotificationDate(const LLDate& time_sta void LLNotificationListItem::onClickCloseBtn() { mOnItemClose(this); + close(); } BOOL LLNotificationListItem::handleMouseUp(S32 x, S32 y, MASK mask) @@ -278,14 +279,17 @@ BOOL LLGroupNoticeNotificationListItem::postBuild() if (mInventoryOffer != NULL) { mAttachmentTextBox->setValue(mInventoryOffer->mDesc); + mAttachmentTextBox->setVisible(TRUE); mAttachmentIcon->setVisible(TRUE); std::string icon_name = LLInventoryIcon::getIconName(mInventoryOffer->mType, LLInventoryType::IT_TEXTURE); - mAttachmentIconExp->setValue(icon_name); mAttachmentIconExp->setVisible(TRUE); + mAttachmentTextBox->setClickedCallback(boost::bind( + &LLGroupNoticeNotificationListItem::onClickAttachment, this)); + std::string expanded_height_resize_str = getString("expanded_height_resize_for_attachment"); mExpandedHeightResize = (S32)atoi(expanded_height_resize_str.c_str()); @@ -388,6 +392,53 @@ void LLGroupNoticeNotificationListItem::setSender(std::string sender) mSenderOrFeeBoxExp->setVisible(FALSE); } } +void LLGroupNoticeNotificationListItem::close() +{ + // The group notice dialog may be an inventory offer. + // If it has an inventory save button and that button is still enabled + // Then we need to send the inventory declined message + if (mInventoryOffer != NULL) + { + mInventoryOffer->forceResponse(IOR_DECLINE); + mInventoryOffer = NULL; + } +} + +void LLGroupNoticeNotificationListItem::onClickAttachment() +{ + if (mInventoryOffer != NULL) { + mInventoryOffer->forceResponse(IOR_ACCEPT); + + static const LLUIColor textColor = LLUIColorTable::instance().getColor( + "GroupNotifyDimmedTextColor"); + mAttachmentTextBox->setColor(textColor); + mAttachmentIconExp->setEnabled(FALSE); + + //if attachment isn't openable - notify about saving + if (!isAttachmentOpenable(mInventoryOffer->mType)) { + LLNotifications::instance().add("AttachmentSaved", LLSD(), LLSD()); + } + + mInventoryOffer = NULL; + } +} + +//static +bool LLGroupNoticeNotificationListItem::isAttachmentOpenable(LLAssetType::EType type) +{ + switch (type) + { + case LLAssetType::AT_LANDMARK: + case LLAssetType::AT_NOTECARD: + case LLAssetType::AT_IMAGE_JPEG: + case LLAssetType::AT_IMAGE_TGA: + case LLAssetType::AT_TEXTURE: + case LLAssetType::AT_TEXTURE_TGA: + return true; + default: + return false; + } +} LLTransactionNotificationListItem::LLTransactionNotificationListItem(const Params& p) : LLNotificationListItem(p), diff --git a/indra/newview/llnotificationlistitem.h b/indra/newview/llnotificationlistitem.h index bd76d17fe8..f8d9fc0330 100644 --- a/indra/newview/llnotificationlistitem.h +++ b/indra/newview/llnotificationlistitem.h @@ -30,6 +30,7 @@ #include "llpanel.h" #include "lllayoutstack.h" #include "lltextbox.h" +#include "llviewertexteditor.h" #include "llbutton.h" #include "llgroupiconctrl.h" #include "llavatariconctrl.h" @@ -95,24 +96,25 @@ protected: void onClickExpandBtn(); void onClickCondenseBtn(); void onClickCloseBtn(); - - Params mParams; - LLTextBox* mTitleBox; - LLTextBox* mTitleBoxExp; - LLTextBox* mNoticeTextExp; - LLTextBox* mTimeBox; - LLTextBox* mTimeBoxExp; - LLButton* mExpandBtn; - LLButton* mCondenseBtn; - LLButton* mCloseBtn; - LLButton* mCloseBtnExp; - LLPanel* mCondensedViewPanel; - LLPanel* mExpandedViewPanel; - std::string mTitle; - std::string mNotificationName; - S32 mCondensedHeight; - S32 mExpandedHeight; - S32 mExpandedHeightResize; + virtual void close() {}; + + Params mParams; + LLTextBox* mTitleBox; + LLTextBox* mTitleBoxExp; + LLViewerTextEditor* mNoticeTextExp; + LLTextBox* mTimeBox; + LLTextBox* mTimeBoxExp; + LLButton* mExpandBtn; + LLButton* mCondenseBtn; + LLButton* mCloseBtn; + LLButton* mCloseBtnExp; + LLPanel* mCondensedViewPanel; + LLPanel* mExpandedViewPanel; + std::string mTitle; + std::string mNotificationName; + S32 mCondensedHeight; + S32 mExpandedHeight; + S32 mExpandedHeightResize; }; class LLGroupNotificationListItem @@ -174,12 +176,16 @@ private: LLGroupNoticeNotificationListItem & operator=(LLGroupNoticeNotificationListItem &); void setSender(std::string sender); + void onClickAttachment(); + /*virtual*/ void close(); + + static bool isAttachmentOpenable(LLAssetType::EType); - LLPanel* mAttachmentPanel; - LLTextBox* mAttachmentTextBox; - LLIconCtrl* mAttachmentIcon; - LLIconCtrl* mAttachmentIconExp; - LLOfferInfo* mInventoryOffer; + LLPanel* mAttachmentPanel; + LLTextBox* mAttachmentTextBox; + LLIconCtrl* mAttachmentIcon; + LLIconCtrl* mAttachmentIconExp; + LLOfferInfo* mInventoryOffer; }; class LLTransactionNotificationListItem : public LLNotificationListItem diff --git a/indra/newview/skins/default/xui/en/panel_notification_list_item.xml b/indra/newview/skins/default/xui/en/panel_notification_list_item.xml index 7b57cddd7b..971042eee7 100644 --- a/indra/newview/skins/default/xui/en/panel_notification_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_notification_list_item.xml @@ -11,10 +11,10 @@ height="202" can_resize="true" layout="topleft" - follows="left|top|right|bottom" - background_opaque="false" - background_visible="true" - bg_alpha_color="PanelNotificationListItem" > + follows="left|top|right|bottom" > + + + Sender: "[SENDER_RESIDENT]" @@ -41,105 +41,103 @@ - - - - - - - - - - - - - - Group Name:Notice Title N o t i c e T i t l e N o t i c e T i t l e N o t i c e T i t l e N oticeTitle - - - - - - Sender: "Resident R e s i d e n t R e s i d e n t" - - - - - - - -