Skip to content
Snippets Groups Projects
Commit b147d659 authored by pavelk_productengine's avatar pavelk_productengine
Browse files

MAINT-4734 (Separate transaction notices from group notice/invites)

 1) stripped off attachment field;
 2) made logos (group's, sender's, etc) in expanded view the same size as in condensed view;
 3) turned on notification showing upon click;
 4) fixed cropped right border of Invite and Transactions notifications;
 5) enabled "Collapse All" button;
 6) stripped off unnecessary icons.
parent 1891c5a8
No related branches found
No related tags found
No related merge requests found
Showing
with 193 additions and 403 deletions
......@@ -311,6 +311,7 @@ bool LLAvatarIconCtrl::updateFromCache()
else
{
LLIconCtrl::setValue(mDefaultIconName);
return false;
}
return true;
......
......@@ -132,8 +132,7 @@ void LLChannelManager::onLoginCompleted()
S32 channel_right_bound = gViewerWindow->getWorldViewRectScaled().mRight - gSavedSettings.getS32("NotificationChannelRightMargin");
S32 channel_width = gSavedSettings.getS32("NotifyBoxWidth");
mStartUpChannel->init(channel_right_bound - channel_width, channel_right_bound);
//mStartUpChannel->setMouseDownCallback(boost::bind(&LLNotificationWellWindow::onStartUpToastClick, LLNotificationWellWindow::getInstance(), _2, _3, _4));
mStartUpChannel->setMouseDownCallback(boost::bind(&LLFloaterNotificationsTabbed::onStartUpToastClick, LLFloaterNotificationsTabbed::getInstance(), _2, _3, _4));
mStartUpChannel->setMouseDownCallback(boost::bind(&LLFloaterNotificationsTabbed::onStartUpToastClick, LLFloaterNotificationsTabbed::getInstance(), _2, _3, _4));
mStartUpChannel->setCommitCallback(boost::bind(&LLChannelManager::onStartUpToastClose, this));
mStartUpChannel->createStartUpToast(away_notifications, gSavedSettings.getS32("StartUpToastLifeTime"));
......
......@@ -166,8 +166,7 @@ LLNotificationChiclet::LLNotificationChiclet(const Params& p)
mNotificationChannel.reset(new ChicletNotificationChannel(this));
// ensure that notification well window exists, to synchronously
// handle toast add/delete events.
//LLNotificationWellWindow::getInstance()->setSysWellChiclet(this);
LLFloaterNotificationsTabbed::getInstance()->setSysWellChiclet(this);
LLFloaterNotificationsTabbed::getInstance()->setSysWellChiclet(this);
}
void LLNotificationChiclet::onMenuItemClicked(const LLSD& user_data)
......@@ -175,8 +174,7 @@ void LLNotificationChiclet::onMenuItemClicked(const LLSD& user_data)
std::string action = user_data.asString();
if("close all" == action)
{
//LLNotificationWellWindow::getInstance()->closeAll();
LLFloaterNotificationsTabbed::getInstance()->closeAll();
LLFloaterNotificationsTabbed::getInstance()->closeAll();
LLIMWellWindow::getInstance()->closeAll();
}
}
......
......@@ -60,8 +60,7 @@ BOOL LLChicletBar::postBuild()
mToolbarStack = getChild<LLLayoutStack>("toolbar_stack");
mChicletPanel = getChild<LLChicletPanel>("chiclet_list");
//showWellButton("notification_well", !LLNotificationWellWindow::getInstance()->isWindowEmpty());
showWellButton("notification_well", !LLFloaterNotificationsTabbed::getInstance()->isWindowEmpty());
showWellButton("notification_well", !LLFloaterNotificationsTabbed::getInstance()->isWindowEmpty());
LLPanelTopInfoBar::instance().setResizeCallback(boost::bind(&LLChicletBar::fitWithTopInfoBar, this));
LLPanelTopInfoBar::instance().setVisibleCallback(boost::bind(&LLChicletBar::fitWithTopInfoBar, this));
......
/**
* @file llfloaternotificationstabbed.cpp
* @brief
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
* $LicenseInfo:firstyear=2015&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
* Copyright (C) 2015, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -51,7 +51,7 @@ LLFloaterNotificationsTabbed::LLFloaterNotificationsTabbed(const LLSD& key) : LL
mIsReshapedByUser(false)
{
setOverlapsScreenChannel(true);
setOverlapsScreenChannel(true);
mNotificationUpdates.reset(new NotificationTabbedChannel(this));
mNotificationsSeparator = new LLNotificationSeparator();
}
......@@ -70,12 +70,15 @@ BOOL LLFloaterNotificationsTabbed::postBuild()
mDeleteAllBtn = getChild<LLButton>("delete_all_button");
mDeleteAllBtn->setClickedCallback(boost::bind(&LLFloaterNotificationsTabbed::onClickDeleteAllBtn,this));
mCollapseAllBtn = getChild<LLButton>("collapse_all_button");
mCollapseAllBtn->setClickedCallback(boost::bind(&LLFloaterNotificationsTabbed::onClickCollapseAllBtn,this));
// get a corresponding channel
initChannel();
BOOL rv = LLTransientDockableFloater::postBuild();
setTitle(getString("title_notification_tabbed_window"));
return rv;
return rv;
}
//---------------------------------------------------------------------------------
......@@ -98,6 +101,7 @@ void LLFloaterNotificationsTabbed::onStartUpToastClick(S32 x, S32 y, MASK mask)
setVisible(TRUE);
}
//---------------------------------------------------------------------------------
void LLFloaterNotificationsTabbed::setSysWellChiclet(LLSysWellChiclet* chiclet)
{
mSysWellChiclet = chiclet;
......@@ -208,29 +212,6 @@ void LLFloaterNotificationsTabbed::setDocked(bool docked, bool pop_on_undock)
//---------------------------------------------------------------------------------
void LLFloaterNotificationsTabbed::reshapeWindow()
{
// save difference between floater height and the list height to take it into account while calculating new window height
// it includes height from floater top to list top and from floater bottom and list bottom
//static S32 parent_list_delta_height = getRect().getHeight() - mInviteMessageList->getRect().getHeight();
//if (!mIsReshapedByUser) // Don't reshape Well window, if it ever was reshaped by user. See EXT-5715.
//{
// S32 notif_list_height = mInviteMessageList->getItemsRect().getHeight() + 2 * mInviteMessageList->getBorderWidth();
// LLRect curRect = getRect();
// S32 new_window_height = notif_list_height + parent_list_delta_height;
// if (new_window_height > MAX_WINDOW_HEIGHT)
// {
// new_window_height = MAX_WINDOW_HEIGHT;
// }
// S32 newWidth = curRect.getWidth() < MIN_WINDOW_WIDTH ? MIN_WINDOW_WIDTH : curRect.getWidth();
// curRect.setLeftTopAndSize(curRect.mLeft, curRect.mTop, newWidth, new_window_height);
// reshape(curRect.getWidth(), curRect.getHeight(), TRUE);
// setRect(curRect);
//}
// update notification channel state
// update on a window reshape is important only when a window is visible and docked
if(mChannel && getVisible() && isDocked())
......@@ -245,8 +226,9 @@ bool LLFloaterNotificationsTabbed::isWindowEmpty()
return mNotificationsSeparator->size() == 0;
}
//---------------------------------------------------------------------------------
LLFloaterNotificationsTabbed::NotificationTabbedChannel::NotificationTabbedChannel(LLFloaterNotificationsTabbed* notifications_tabbed_window)
: LLNotificationChannel(LLNotificationChannel::Params().name(notifications_tabbed_window->getPathname())),
: LLNotificationChannel(LLNotificationChannel::Params().name(notifications_tabbed_window->getPathname())),
mNotificationsTabbedWindow(notifications_tabbed_window)
{
connectToChannel("Notifications");
......@@ -255,11 +237,13 @@ LLFloaterNotificationsTabbed::NotificationTabbedChannel::NotificationTabbedChann
}
// static
//---------------------------------------------------------------------------------
LLFloaterNotificationsTabbed* LLFloaterNotificationsTabbed::getInstance(const LLSD& key /*= LLSD()*/)
{
return LLFloaterReg::getTypedInstance<LLFloaterNotificationsTabbed>("notification_well_window", key);
}
//---------------------------------------------------------------------------------
void LLFloaterNotificationsTabbed::updateNotificationCounter(S32 panelIndex, S32 counterValue, std::string stringName)
{
LLStringUtil::format_map_t string_args;
......@@ -268,6 +252,7 @@ void LLFloaterNotificationsTabbed::updateNotificationCounter(S32 panelIndex, S32
mNotificationsTabContainer->setPanelTitle(panelIndex, label);
}
//---------------------------------------------------------------------------------
void LLFloaterNotificationsTabbed::updateNotificationCounters()
{
updateNotificationCounter(0, mSystemMessageList->size(), "system_tab_title");
......@@ -304,6 +289,7 @@ void LLFloaterNotificationsTabbed::addItem(LLNotificationListItem::Params p)
}
}
//---------------------------------------------------------------------------------
void LLFloaterNotificationsTabbed::closeAll()
{
// Need to clear notification channel, to add storable toasts into the list.
......@@ -319,11 +305,8 @@ void LLFloaterNotificationsTabbed::closeAll()
}
//---------------------------------------------------------------------------------
void LLFloaterNotificationsTabbed::closeAllOnCurrentTab()
void LLFloaterNotificationsTabbed::getAllItemsOnCurrentTab(std::vector<LLPanel*>& items) const
{
// Need to clear notification channel, to add storable toasts into the list.
clearScreenChannels();
std::vector<LLPanel*> items;
switch (mNotificationsTabContainer->getCurrentPanelIndex())
{
case 0:
......@@ -336,8 +319,17 @@ void LLFloaterNotificationsTabbed::closeAllOnCurrentTab()
mInviteMessageList->getItems(items);
break;
default:
return;
break;
}
}
//---------------------------------------------------------------------------------
void LLFloaterNotificationsTabbed::closeAllOnCurrentTab()
{
// Need to clear notification channel, to add storable toasts into the list.
clearScreenChannels();
std::vector<LLPanel*> items;
getAllItemsOnCurrentTab(items);
std::vector<LLPanel*>::iterator iter = items.begin();
for (; iter != items.end(); ++iter)
{
......@@ -347,6 +339,20 @@ void LLFloaterNotificationsTabbed::closeAllOnCurrentTab()
}
}
//---------------------------------------------------------------------------------
void LLFloaterNotificationsTabbed::collapseAllOnCurrentTab()
{
std::vector<LLPanel*> items;
getAllItemsOnCurrentTab(items);
std::vector<LLPanel*>::iterator iter = items.begin();
for (; iter != items.end(); ++iter)
{
LLNotificationListItem* notify_item = dynamic_cast<LLNotificationListItem*>(*iter);
if (notify_item)
notify_item->setExpanded(FALSE);
}
}
//---------------------------------------------------------------------------------
void LLFloaterNotificationsTabbed::clearScreenChannels()
{
......@@ -375,6 +381,8 @@ void LLFloaterNotificationsTabbed::onStoreToast(LLPanel* info_panel, LLUUID id)
p.group_id = payload["group_id"];
p.sender = payload["name"].asString();
p.time_stamp = notify->getDate();
p.paid_from_id = payload["from_id"];
p.paid_to_id = payload["dest_id"];
addItem(p);
}
......@@ -403,22 +411,32 @@ void LLFloaterNotificationsTabbed::onItemClose(LLNotificationListItem* item)
}
//---------------------------------------------------------------------------------
void LLFloaterNotificationsTabbed::onAdd( LLNotificationPtr notify )
{
removeItemByID(notify->getID(), notify->getName());
}
//---------------------------------------------------------------------------------
void LLFloaterNotificationsTabbed::onClickDeleteAllBtn()
{
closeAllOnCurrentTab();
}
//---------------------------------------------------------------------------------
void LLFloaterNotificationsTabbed::onClickCollapseAllBtn()
{
collapseAllOnCurrentTab();
}
//---------------------------------------------------------------------------------
void LLNotificationSeparator::initTaggedList(const std::string& tag, LLNotificationListView* list)
{
mNotificationListMap.insert(notification_list_map_t::value_type(tag, list));
mNotificationLists.push_back(list);
}
//---------------------------------------------------------------------------------
void LLNotificationSeparator::initTaggedList(const std::set<std::string>& tags, LLNotificationListView* list)
{
std::set<std::string>::const_iterator it = tags.begin();
......@@ -428,11 +446,13 @@ void LLNotificationSeparator::initTaggedList(const std::set<std::string>& tags,
}
}
//---------------------------------------------------------------------------------
void LLNotificationSeparator::initUnTaggedList(LLNotificationListView* list)
{
mUnTaggedList = list;
}
//---------------------------------------------------------------------------------
bool LLNotificationSeparator::addItem(std::string& tag, LLNotificationListItem* item)
{
notification_list_map_t::iterator it = mNotificationListMap.find(tag);
......@@ -447,6 +467,7 @@ bool LLNotificationSeparator::addItem(std::string& tag, LLNotificationListItem*
return false;
}
//---------------------------------------------------------------------------------
bool LLNotificationSeparator::removeItemByID(std::string& tag, const LLUUID& id)
{
notification_list_map_t::iterator it = mNotificationListMap.find(tag);
......@@ -461,6 +482,7 @@ bool LLNotificationSeparator::removeItemByID(std::string& tag, const LLUUID& id)
return false;
}
//---------------------------------------------------------------------------------
U32 LLNotificationSeparator::size() const
{
U32 size = 0;
......@@ -476,6 +498,7 @@ U32 LLNotificationSeparator::size() const
return size;
}
//---------------------------------------------------------------------------------
LLPanel* LLNotificationSeparator::findItemByID(std::string& tag, const LLUUID& id)
{
notification_list_map_t::iterator it = mNotificationListMap.find(tag);
......@@ -492,6 +515,7 @@ LLPanel* LLNotificationSeparator::findItemByID(std::string& tag, const LLUUID& i
}
//static
//---------------------------------------------------------------------------------
void LLNotificationSeparator::getItemsFromList(std::vector<LLNotificationListItem*>& items, LLNotificationListView* list)
{
std::vector<LLPanel*> list_items;
......@@ -505,6 +529,7 @@ void LLNotificationSeparator::getItemsFromList(std::vector<LLNotificationListIte
}
}
//---------------------------------------------------------------------------------
void LLNotificationSeparator::getItems(std::vector<LLNotificationListItem*>& items) const
{
items.clear();
......@@ -519,9 +544,11 @@ void LLNotificationSeparator::getItems(std::vector<LLNotificationListItem*>& ite
}
}
//---------------------------------------------------------------------------------
LLNotificationSeparator::LLNotificationSeparator()
: mUnTaggedList(NULL)
{}
//---------------------------------------------------------------------------------
LLNotificationSeparator::~LLNotificationSeparator()
{}
......@@ -2,9 +2,9 @@
* @file llfloaternotificationstabbed.h
* @brief
*
* $LicenseInfo:firstyear=2003&license=viewerlgpl$
* $LicenseInfo:firstyear=2015&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
* Copyright (C) 2015, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -68,11 +68,11 @@ class LLNotificationSeparator
class LLFloaterNotificationsTabbed : public LLTransientDockableFloater
{
public:
LOG_CLASS(LLFloaterNotificationsTabbed);
LOG_CLASS(LLFloaterNotificationsTabbed);
LLFloaterNotificationsTabbed(const LLSD& key);
virtual ~LLFloaterNotificationsTabbed();
BOOL postBuild();
BOOL postBuild();
// other interface functions
// check is window empty
......@@ -86,12 +86,11 @@ class LLFloaterNotificationsTabbed : public LLTransientDockableFloater
// Operating with outfit
virtual void setVisible(BOOL visible);
void adjustWindowPosition();//not used - ?
/*virtual*/ void setDocked(bool docked, bool pop_on_undock = true);
/*virtual*/ void setDocked(bool docked, bool pop_on_undock = true);
// override LLFloater's minimization according to EXT-1216
/*virtual*/ void setMinimized(BOOL minimize);
/*virtual*/ void handleReshape(const LLRect& rect, bool by_user);
/*virtual*/ void setMinimized(BOOL minimize);
/*virtual*/ void handleReshape(const LLRect& rect, bool by_user);
void onStartUpToastClick(S32 x, S32 y, MASK mask);
/*virtual*/ void onAdd(LLNotificationPtr notify);
......@@ -102,8 +101,8 @@ class LLFloaterNotificationsTabbed : public LLTransientDockableFloater
static LLFloaterNotificationsTabbed* getInstance(const LLSD& key = LLSD());
// size constants for the window and for its elements
static const S32 MAX_WINDOW_HEIGHT = 200;
static const S32 MIN_WINDOW_WIDTH = 318;
static const S32 MAX_WINDOW_HEIGHT = 200;
static const S32 MIN_WINDOW_WIDTH = 318;
private:
// init Window's channel
......@@ -119,9 +118,9 @@ class LLFloaterNotificationsTabbed : public LLTransientDockableFloater
LLNotificationsUI::LLScreenChannel* mChannel;
/**
* Reference to an appropriate Well chiclet to release "new message" state. EXT-3147
*/
LLSysWellChiclet* mSysWellChiclet;
* Reference to an appropriate Well chiclet to release "new message" state. EXT-3147
*/
LLSysWellChiclet* mSysWellChiclet;
bool mIsReshapedByUser;
......@@ -144,12 +143,15 @@ class LLFloaterNotificationsTabbed : public LLTransientDockableFloater
void clearScreenChannels();
// Operating with items
void addItem(LLNotificationListItem::Params p);
void getAllItemsOnCurrentTab(std::vector<LLPanel*>& items) const;
// Closes all notifications and removes them from the Notification Well
void closeAllOnCurrentTab();
void collapseAllOnCurrentTab();
void onStoreToast(LLPanel* info_panel, LLUUID id);
void onClickDeleteAllBtn();
void onClickCollapseAllBtn();
// Handlers
void onItemClick(LLNotificationListItem* item);
void onItemClose(LLNotificationListItem* item);
......@@ -162,6 +164,7 @@ class LLFloaterNotificationsTabbed : public LLTransientDockableFloater
LLNotificationSeparator* mNotificationsSeparator;
LLTabContainer* mNotificationsTabContainer;
LLButton* mDeleteAllBtn;
LLButton* mCollapseAllBtn;
};
#endif // LL_FLOATERNOTIFICATIONSTABBED_H
......
......@@ -52,7 +52,7 @@ LLGroupIconCtrl::LLGroupIconCtrl(const LLGroupIconCtrl::Params& p)
{
LLSD value(p.group_id);
setValue(value);
}
}
else
{
LLIconCtrl::setValue(mDefaultIconName);
......
/**
* @file llnotificationlistitem.cpp
* @brief // TODO
* @brief
*
* $LicenseInfo:firstyear=2000&license=viewerlgpl$
* $LicenseInfo:firstyear=2015&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2015, Linden Research, Inc.
*
......@@ -109,37 +109,18 @@ std::string LLNotificationListItem::buildNotificationDate(const LLDate& time_sta
return timeStr;
}
//---------------------------------------------------------------------------------
//void LLNotificationTabbedItem::setTitle( std::string title )
//{
// mTitleBox->setValue(title);
//}
void LLNotificationListItem::onClickCloseBtn()
{
mOnItemClose(this);
}
BOOL LLNotificationListItem::handleMouseDown(S32 x, S32 y, MASK mask)
BOOL LLNotificationListItem::handleMouseUp(S32 x, S32 y, MASK mask)
{
BOOL res = LLPanel::handleMouseDown(x, y, mask);
//if(!mCloseBtn->getRect().pointInRect(x, y))
//if(!mCloseBtn->getLocalRect().pointInRect(x, y))
//mOnItemClick(this);
BOOL res = LLPanel::handleMouseUp(x, y, mask);
mOnItemClick(this);
return res;
}
void LLNotificationListItem::onMouseEnter(S32 x, S32 y, MASK mask)
{
//setTransparentColor(LLUIColorTable::instance().getColor( "SysWellItemSelected" ));
}
void LLNotificationListItem::onMouseLeave(S32 x, S32 y, MASK mask)
{
//setTransparentColor(LLUIColorTable::instance().getColor( "SysWellItemUnselected" ));
}
//static
LLNotificationListItem* LLNotificationListItem::create(const Params& p)
{
......@@ -176,23 +157,18 @@ void LLNotificationListItem::onClickCondenseBtn()
setExpanded(FALSE);
}
void setPanelSize(LLView* panel, S32 width, S32 height, BOOL called_from_parent)
{
LLRect rect = panel->getRect();
panel->reshape(width, height, called_from_parent);
}
void LLNotificationListItem::setExpanded(BOOL value)
{
mCondensedViewPanel->setVisible(!value);
mExpandedViewPanel->setVisible(value);
S32 width = this->getRect().getWidth();
if (value)
{
setPanelSize(this, 331, mExpandedHeight, FALSE);
this->reshape(width, mExpandedHeight, FALSE);
}
else
else
{
setPanelSize(this, 331, mCondensedHeight, FALSE);
this->reshape(width, mCondensedHeight, FALSE);
}
}
......@@ -211,31 +187,11 @@ std::set<std::string> LLTransactionNotificationListItem::getTypes()
return types;
}
std::set<std::string> LLSystemNotificationListItem::getTypes()
{
std::set<std::string> types;
//types.insert("AddPrimitiveFailure");
//types.insert("AddToNavMeshNoCopy");
//types.insert("AssetServerTimeoutObjReturn");
//types.insert("AvatarEjected");
//types.insert("AutoUnmuteByIM");
//types.insert("AutoUnmuteByInventory");
//types.insert("AutoUnmuteByMoney");
//types.insert("BuyInventoryFailedNoMoney");
//types.insert("DeactivatedGesturesTrigger");
//types.insert("DeedFailedNoPermToDeedForGroup");
//types.insert("WhyAreYouTryingToWearShrubbery");
//types.insert("YouDiedAndGotTPHome");
//types.insert("YouFrozeAvatar");
//types.insert("OfferCallingCard");
return types;
}
LLInviteNotificationListItem::LLInviteNotificationListItem(const Params& p)
: LLNotificationListItem(p),
mSenderBox(NULL)
: LLNotificationListItem(p),
mSenderBox(NULL)
{
buildFromFile("panel_notification_list_item.xml");
buildFromFile("panel_notification_list_item.xml");
}
BOOL LLInviteNotificationListItem::postBuild()
......@@ -256,19 +212,8 @@ BOOL LLInviteNotificationListItem::postBuild()
mSenderBox = getChild<LLTextBox>("sender_resident");
mSenderBoxExp = getChild<LLTextBox>("sender_resident_exp");
if (!mParams.sender.empty())
{
LLStringUtil::format_map_t string_args;
string_args["[SENDER_RESIDENT]"] = llformat("%s", mParams.sender.c_str());
std::string sender_text = getString("sender_resident_text", string_args);
mSenderBox->setValue(sender_text);
mSenderBox->setVisible(TRUE);
mSenderBoxExp->setValue(sender_text);
mSenderBoxExp->setVisible(TRUE);
} else {
mSenderBox->setVisible(FALSE);
mSenderBoxExp->setVisible(FALSE);
}
setSender(mParams.sender);
LLSD value(mParams.group_id);
setGroupId(value);
......@@ -288,18 +233,7 @@ bool LLInviteNotificationListItem::updateFromCache()
{
LLGroupMgrGroupData* group_data = LLGroupMgr::getInstance()->getGroupData(mGroupId);
if (!group_data) return false;
if (!group_data->mName.empty())
{
LLStringUtil::format_map_t string_args;
string_args["[GROUP_NAME]"] = llformat("%s", group_data->mName.c_str());
std::string group_name = getString("group_name_text", string_args);
mGroupNameBoxExp->setValue(group_name);
mGroupNameBoxExp->setVisible(TRUE);
}
else
{
mGroupNameBoxExp->setValue(LLStringUtil::null);
}
setGroupName(group_data->mName);
return true;
}
......@@ -311,7 +245,7 @@ void LLInviteNotificationListItem::setGroupId(const LLUUID& value)
gm->removeObserver(this);
}
mID = mGroupId; // set LLGroupMgrObserver::mID to make callbacks work
mID = mGroupId;
// Check if cache already contains image_id for that group
if (!updateFromCache())
......@@ -321,9 +255,45 @@ void LLInviteNotificationListItem::setGroupId(const LLUUID& value)
}
}
void LLInviteNotificationListItem::setGroupName(std::string name)
{
if (!name.empty())
{
LLStringUtil::format_map_t string_args;
string_args["[GROUP_NAME]"] = llformat("%s", name.c_str());
std::string group_box_str = getString("group_name_text", string_args);
mGroupNameBoxExp->setValue(group_box_str);
mGroupNameBoxExp->setVisible(TRUE);
}
else
{
mGroupNameBoxExp->setValue(LLStringUtil::null);
mGroupNameBoxExp->setVisible(FALSE);
}
}
void LLInviteNotificationListItem::setSender(std::string sender)
{
if (!sender.empty())
{
LLStringUtil::format_map_t string_args;
string_args["[SENDER_RESIDENT]"] = llformat("%s", sender.c_str());
std::string sender_text = getString("sender_resident_text", string_args);
mSenderBox->setValue(sender_text);
mSenderBox->setVisible(TRUE);
mSenderBoxExp->setValue(sender_text);
mSenderBoxExp->setVisible(TRUE);
} else {
mSenderBox->setValue(LLStringUtil::null);
mSenderBoxExp->setValue(LLStringUtil::null);
mSenderBox->setVisible(FALSE);
mSenderBoxExp->setVisible(FALSE);
}
}
LLTransactionNotificationListItem::LLTransactionNotificationListItem(const Params& p)
: LLNotificationListItem(p),
mTransactionIcon(NULL)
mAvatarIcon(NULL)
{
buildFromFile("panel_notification_list_item.xml");
}
......@@ -331,20 +301,20 @@ LLTransactionNotificationListItem::LLTransactionNotificationListItem(const Param
BOOL LLTransactionNotificationListItem::postBuild()
{
BOOL rv = LLNotificationListItem::postBuild();
mAvatarIcon = getChild<LLAvatarIconCtrl>("avatar_icon");
mAvatarIconExp = getChild<LLAvatarIconCtrl>("avatar_icon_exp");
if (mParams.notification_name == "PaymentReceived")
{
mTransactionIcon = getChild<LLIconCtrl>("incoming_transaction_icon");
mTransactionIconExp = getChild<LLIconCtrl>("incoming_transaction_icon_exp");
mAvatarIcon->setValue(mParams.paid_from_id);
mAvatarIconExp->setValue(mParams.paid_from_id);
}
else if (mParams.notification_name == "PaymentSent")
{
mTransactionIcon = getChild<LLIconCtrl>("outcoming_transaction_icon");
mTransactionIconExp = getChild<LLIconCtrl>("outcoming_transaction_icon_exp");
mAvatarIcon->setValue(mParams.paid_to_id);
mAvatarIconExp->setValue(mParams.paid_to_id);
}
if(mTransactionIcon)
mTransactionIcon->setVisible(TRUE);
if(mTransactionIconExp)
mTransactionIconExp->setVisible(TRUE);
mAvatarIcon->setVisible(TRUE);
mAvatarIconExp->setVisible(TRUE);
return rv;
}
......
/**
* @file llnotificationlistitem.h
* @brief // TODO
* @brief
*
* $LicenseInfo:firstyear=2003&license=viewerlgpl$
* $LicenseInfo:firstyear=2015&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2015, Linden Research, Inc.
*
......@@ -32,6 +32,7 @@
#include "lltextbox.h"
#include "llbutton.h"
#include "llgroupiconctrl.h"
#include "llavatariconctrl.h"
#include "llgroupmgr.h"
......@@ -40,13 +41,15 @@
class LLNotificationListItem : public LLPanel
{
public:
struct Params : public LLInitParam::Block<Params, LLPanel::Params>
struct Params : public LLInitParam::Block<Params, LLPanel::Params>
{
LLUUID notification_id;
LLUUID notification_id;
LLUUID group_id;
std::string notification_name;
std::string title;
std::string sender;
LLUUID paid_from_id;
LLUUID paid_to_id;
std::string notification_name;
std::string title;
std::string sender;
LLDate time_stamp;
Params() {};
};
......@@ -65,44 +68,41 @@ class LLNotificationListItem : public LLPanel
std::string& getNotificationName() { return mNotificationName; }
// handlers
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask);
virtual void onMouseEnter(S32 x, S32 y, MASK mask);
virtual void onMouseLeave(S32 x, S32 y, MASK mask);
virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);
//callbacks
typedef boost::function<void (LLNotificationListItem* item)> item_callback_t;
typedef boost::signals2::signal<void (LLNotificationListItem* item)> item_signal_t;
item_signal_t mOnItemClose;
item_signal_t mOnItemClick;
item_signal_t mOnItemClose;
item_signal_t mOnItemClick;
boost::signals2::connection setOnItemCloseCallback(item_callback_t cb) { return mOnItemClose.connect(cb); }
boost::signals2::connection setOnItemClickCallback(item_callback_t cb) { return mOnItemClick.connect(cb); }
void setExpanded(BOOL value);
virtual BOOL postBuild();
protected:
LLNotificationListItem(const Params& p);
virtual ~LLNotificationListItem();
virtual ~LLNotificationListItem();
static std::string buildNotificationDate(const LLDate&);
void setExpanded(BOOL value);
void onClickExpandBtn();
void onClickCondenseBtn();
void onClickExpandBtn();
void onClickCondenseBtn();
void onClickCloseBtn();
Params mParams;
LLTextBox* mTitleBox;
LLTextBox* mTitleBoxExp;
LLTextBox* mNoticeTextExp;
LLTextBox* mTitleBox;
LLTextBox* mTitleBoxExp;
LLTextBox* mNoticeTextExp;
LLTextBox* mTimeBox;
LLTextBox* mTimeBoxExp;
LLButton* mExpandBtn;
LLButton* mCondenseBtn;
LLButton* mCloseBtn;
LLButton* mCloseBtnExp;
LLButton* mExpandBtn;
LLButton* mCondenseBtn;
LLButton* mCloseBtn;
LLButton* mCloseBtnExp;
LLLayoutStack* mVerticalStack;
LLPanel* mCondensedViewPanel;
LLPanel* mExpandedViewPanel;
LLPanel* mExpandedViewPanel;
LLPanel* mMainPanel;
//LLUUID mID;
std::string mTitle;
std::string mNotificationName;
S32 mCondensedHeight;
......@@ -113,11 +113,7 @@ class LLInviteNotificationListItem
: public LLNotificationListItem, public LLGroupMgrObserver
{
public:
//void setGroupID(const LLUUID& group_id);
//void setGroupIconID(const LLUUID& group_icon_id);
//void setGroupName(const std::string& group_name);
static std::set<std::string> getTypes();
virtual BOOL postBuild();
void setGroupId(const LLUUID& value);
......@@ -129,41 +125,43 @@ class LLInviteNotificationListItem
LLInviteNotificationListItem(const LLInviteNotificationListItem &);
LLInviteNotificationListItem & operator=(LLInviteNotificationListItem &);
void setSender(std::string sender);
void setGroupName(std::string name);
bool updateFromCache();
LLGroupIconCtrl* mGroupIcon;
LLGroupIconCtrl* mGroupIconExp;
LLUUID mGroupId;
LLTextBox* mSenderBox;
LLTextBox* mSenderBoxExp;
LLTextBox* mGroupNameBoxExp;
LLUUID mGroupId;
LLTextBox* mSenderBox;
LLTextBox* mSenderBoxExp;
LLTextBox* mGroupNameBoxExp;
};
class LLTransactionNotificationListItem : public LLNotificationListItem
{
public:
static std::set<std::string> getTypes();
virtual BOOL postBuild();
virtual BOOL postBuild();
private:
friend class LLNotificationListItem;
LLTransactionNotificationListItem(const Params& p);
LLTransactionNotificationListItem(const LLTransactionNotificationListItem &);
LLTransactionNotificationListItem & operator=(LLTransactionNotificationListItem &);
LLIconCtrl* mTransactionIcon;
LLIconCtrl* mTransactionIconExp;
LLAvatarIconCtrl* mAvatarIcon;
LLAvatarIconCtrl* mAvatarIconExp;
};
class LLSystemNotificationListItem : public LLNotificationListItem
{
public:
static std::set<std::string> getTypes();
virtual BOOL postBuild();
virtual BOOL postBuild();
private:
friend class LLNotificationListItem;
LLSystemNotificationListItem(const Params& p);
LLSystemNotificationListItem(const LLSystemNotificationListItem &);
LLSystemNotificationListItem & operator=(LLSystemNotificationListItem &);
LLIconCtrl* mSystemNotificationIcon;
LLIconCtrl* mSystemNotificationIcon;
LLIconCtrl* mSystemNotificationIconExp;
};
......
......@@ -2,9 +2,9 @@
* @file llnotificationlistview.cpp
* @brief
*
* $LicenseInfo:firstyear=2009&license=viewerlgpl$
* $LicenseInfo:firstyear=2015&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
* Copyright (C) 2015, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......
/**
* @file llflatlistview.h
* @brief LLFlatListView base class and extension to support messages for several cases of an empty list.
* @file llnotificationlistview.h
* @brief LLNotificationListView class to support notifications list contained in enclosing floater.
*
* $LicenseInfo:firstyear=2009&license=viewerlgpl$
* $LicenseInfo:firstyear=2015&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
* Copyright (C) 2015, Linden Research, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -46,4 +46,4 @@ class LLNotificationListView : public LLFlatListView
virtual bool addNotification(LLNotificationListItem * item);
};
#endif
\ No newline at end of file
#endif
......@@ -31,7 +31,6 @@
#include "llwindow.h"
#include "v4color.h"
#include "lltrans.h"
#include "lluicolortable.h"
//---------------------------------------------------------------------------------
......@@ -89,4 +88,6 @@ void LLSysWellItem::onMouseLeave(S32 x, S32 y, MASK mask)
setTransparentColor(LLUIColorTable::instance().getColor( "SysWellItemUnselected" ));
}
//---------------------------------------------------------------------------------
\ No newline at end of file
//---------------------------------------------------------------------------------
......@@ -32,8 +32,6 @@
#include "llbutton.h"
#include "lliconctrl.h"
#include "llgroupmgr.h"
#include <string>
class LLSysWellItem : public LLPanel
......
......@@ -295,158 +295,6 @@ BOOL LLIMWellWindow::ObjectRowPanel::handleRightMouseDown(S32 x, S32 y, MASK mas
return mChiclet->handleRightMouseDown(x, y, mask);
}
/************************************************************************/
/* LLNotificationWellWindow implementation */
/************************************************************************/
//////////////////////////////////////////////////////////////////////////
// PUBLIC METHODS
LLNotificationWellWindow::WellNotificationChannel::WellNotificationChannel(LLNotificationWellWindow* well_window)
: LLNotificationChannel(LLNotificationChannel::Params().name(well_window->getPathname())),
mWellWindow(well_window)
{
connectToChannel("Notifications");
connectToChannel("Group Notifications");
connectToChannel("Offer");
}
LLNotificationWellWindow::LLNotificationWellWindow(const LLSD& key)
: LLSysWellWindow(key)
{
mNotificationUpdates.reset(new WellNotificationChannel(this));
}
// static
LLNotificationWellWindow* LLNotificationWellWindow::getInstance(const LLSD& key /*= LLSD()*/)
{
return LLFloaterReg::getTypedInstance<LLNotificationWellWindow>("notification_well_window", key);
}
// virtual
BOOL LLNotificationWellWindow::postBuild()
{
BOOL rv = LLSysWellWindow::postBuild();
setTitle(getString("title_notification_well_window"));
return rv;
}
// virtual
void LLNotificationWellWindow::setVisible(BOOL visible)
{
if (visible)
{
// when Notification channel is cleared, storable toasts will be added into the list.
clearScreenChannels();
}
LLSysWellWindow::setVisible(visible);
}
//---------------------------------------------------------------------------------
void LLNotificationWellWindow::addItem(LLSysWellItem::Params p)
{
LLSD value = p.notification_id;
// do not add clones
if( mMessageList->getItemByValue(value))
return;
LLSysWellItem* new_item = new LLSysWellItem(p);
if (mMessageList->addItem(new_item, value, ADD_TOP))
{
mSysWellChiclet->updateWidget(isWindowEmpty());
reshapeWindow();
new_item->setOnItemCloseCallback(boost::bind(&LLNotificationWellWindow::onItemClose, this, _1));
new_item->setOnItemClickCallback(boost::bind(&LLNotificationWellWindow::onItemClick, this, _1));
}
else
{
LL_WARNS() << "Unable to add Notification into the list, notification ID: " << p.notification_id
<< ", title: " << p.title
<< LL_ENDL;
new_item->die();
}
}
void LLNotificationWellWindow::closeAll()
{
// Need to clear notification channel, to add storable toasts into the list.
clearScreenChannels();
std::vector<LLPanel*> items;
mMessageList->getItems(items);
for (std::vector<LLPanel*>::iterator
iter = items.begin(),
iter_end = items.end();
iter != iter_end; ++iter)
{
LLSysWellItem* sys_well_item = dynamic_cast<LLSysWellItem*>(*iter);
if (sys_well_item)
onItemClose(sys_well_item);
}
}
//////////////////////////////////////////////////////////////////////////
// PRIVATE METHODS
void LLNotificationWellWindow::initChannel()
{
LLSysWellWindow::initChannel();
if(mChannel)
{
mChannel->addOnStoreToastCallback(boost::bind(&LLNotificationWellWindow::onStoreToast, this, _1, _2));
}
}
void LLNotificationWellWindow::clearScreenChannels()
{
// 1 - remove StartUp toast and channel if present
if(!LLNotificationsUI::LLScreenChannel::getStartUpToastShown())
{
LLNotificationsUI::LLChannelManager::getInstance()->onStartUpToastClose();
}
// 2 - remove toasts in Notification channel
if(mChannel)
{
mChannel->removeAndStoreAllStorableToasts();
}
}
void LLNotificationWellWindow::onStoreToast(LLPanel* info_panel, LLUUID id)
{
LLSysWellItem::Params p;
p.notification_id = id;
p.title = static_cast<LLToastPanel*>(info_panel)->getTitle();
addItem(p);
}
void LLNotificationWellWindow::onItemClick(LLSysWellItem* item)
{
LLUUID id = item->getID();
LLFloaterReg::showInstance("inspect_toast", id);
}
void LLNotificationWellWindow::onItemClose(LLSysWellItem* item)
{
LLUUID id = item->getID();
if(mChannel)
{
// removeItemByID() is invoked from killToastByNotificationID() and item will removed;
mChannel->killToastByNotificationID(id);
}
else
{
// removeItemByID() should be called one time for each item to remove it from notification well
removeItemByID(id);
}
}
void LLNotificationWellWindow::onAdd( LLNotificationPtr notify )
{
removeItemByID(notify->getID());
}
/************************************************************************/
/* LLIMWellWindow implementation */
/************************************************************************/
......
......@@ -95,57 +95,6 @@ class LLSysWellWindow : public LLTransientDockableFloater
bool mIsReshapedByUser;
};
/**
* Class intended to manage incoming notifications.
*
* It contains a list of notifications that have not been responded to.
*/
class LLNotificationWellWindow : public LLSysWellWindow
{
public:
LLNotificationWellWindow(const LLSD& key);
static LLNotificationWellWindow* getInstance(const LLSD& key = LLSD());
/*virtual*/ BOOL postBuild();
/*virtual*/ void setVisible(BOOL visible);
/*virtual*/ void onAdd(LLNotificationPtr notify);
// Operating with items
void addItem(LLSysWellItem::Params p);
// Closes all notifications and removes them from the Notification Well
void closeAll();
protected:
struct WellNotificationChannel : public LLNotificationChannel
{
WellNotificationChannel(LLNotificationWellWindow*);
void onDelete(LLNotificationPtr notify)
{
mWellWindow->removeItemByID(notify->getID());
}
LLNotificationWellWindow* mWellWindow;
};
LLNotificationChannelPtr mNotificationUpdates;
/*virtual*/ const std::string& getAnchorViewName() { return NOTIFICATION_WELL_ANCHOR_NAME; }
private:
// init Window's channel
void initChannel();
void clearScreenChannels();
void onStoreToast(LLPanel* info_panel, LLUUID id);
// Handlers
void onItemClick(LLSysWellItem* item);
void onItemClose(LLSysWellItem* item);
// ID of a toast loaded by user (by clicking notification well item)
LLUUID mLoadedToastId;
};
/**
* Class intended to manage incoming messages in IM chats.
*
......
......@@ -257,9 +257,7 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("notifications_console", "floater_notifications_console.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterNotificationConsole>);
LLFloaterReg::add("notification_well_window", "floater_notifications_tabbed.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterNotificationsTabbed>);
//LLFloaterReg::add("notification_well_window", "floater_sys_well.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLNotificationWellWindow>);
//LLFloaterReg::add("notifications_tabbed", "floater_notifications_tabbed.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterNotificationsTabbed>);
LLFloaterReg::add("notification_well_window", "floater_notifications_tabbed.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterNotificationsTabbed>);
LLFloaterReg::add("object_weights", "floater_object_weights.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterObjectWeights>);
LLFloaterReg::add("openobject", "floater_openobject.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterOpenObject>);
......
......@@ -5622,6 +5622,7 @@ static void process_money_balance_reply_extended(LLMessageSystem* msg)
}
}
final_args["MESSAGE"] = message;
payload["dest_id"] = dest_id;
notification = success ? "PaymentSent" : "PaymentFailure";
}
else {
......
indra/newview/skins/default/textures/icons/Icon_Group_Large.png

12 KiB

indra/newview/skins/default/textures/icons/Icon_Group_Small.png

4.37 KiB

indra/newview/skins/default/textures/icons/Incoming_Transaction_Large.png

4.82 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment