summaryrefslogtreecommitdiff
path: root/indra/newview/llnotificationlistitem.cpp
diff options
context:
space:
mode:
authorpavelkproductengine <pavelkproductengine@lindenlab.com>2015-05-19 13:20:46 +0300
committerpavelkproductengine <pavelkproductengine@lindenlab.com>2015-05-19 13:20:46 +0300
commitf479235aaa94555ee0ea7a663187ae9930d7d5f4 (patch)
tree85bd6b19b66e5f03ba5e0dd9fa8fe1faa15cce22 /indra/newview/llnotificationlistitem.cpp
parent9a93bb1861219175d24610a3055131782096dd69 (diff)
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.
Diffstat (limited to 'indra/newview/llnotificationlistitem.cpp')
-rw-r--r--indra/newview/llnotificationlistitem.cpp55
1 files changed, 53 insertions, 2 deletions
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<LLTextBox>("notification_title");
mTitleBoxExp = getChild<LLTextBox>("notification_title_exp");
- mNoticeTextExp = getChild<LLTextBox>("notification_text_exp");
+ mNoticeTextExp = getChild<LLViewerTextEditor>("notification_text_exp");
mTimeBox = getChild<LLTextBox>("notification_time");
mTimeBoxExp = getChild<LLTextBox>("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),