summaryrefslogtreecommitdiff
path: root/indra/newview/llscreenchannel.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2009-08-26 20:47:27 +0000
committerSteven Bennetts <steve@lindenlab.com>2009-08-26 20:47:27 +0000
commitaf98aad98d43ec8b128ecac3089426d6ae6edc3f (patch)
tree5971f87afc04580df470a003793dcc8c974e29a7 /indra/newview/llscreenchannel.cpp
parent6a364e6f32c12c1ab2c0f33e8ef07d885a8765a2 (diff)
svn merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0@1471 https://svn.aws.productengine.com/secondlife/pe/stable-1@1476 -> viewer-2.0.0-3
EXT-65 EXT-270 EXT-359 EXT-361 EXT-367 EXT-367 EXT-368 EXT-455 EXT-468 EXT-530 EXT-539 EXT-540 EXT-542 EXT-545 EXT-555 EXT-557 EXT-558 EXT-559 EXT-559 EXT-560 EXT-561 EXT-562 EXT-563 EXT-564 EXT-566 EXT-568 EXT-569 EXT-570 EXT-571 EXT-581 EXT-590 EXT-594 EXT-596 EXT-597 EXT-601 EXT-602 EXT-603 EXT-613 EXT-620 EXT-624 EXT-628 EXT-630 EXT-631 EXT-632 EXT-639 EXT-640 EXT-641 EXT-642 EXT-662 EXT-671 EXT-672 EXT-676 EXT-682 EXT-692 EXT-703 EXT-717
Diffstat (limited to 'indra/newview/llscreenchannel.cpp')
-rw-r--r--indra/newview/llscreenchannel.cpp47
1 files changed, 15 insertions, 32 deletions
diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp
index 50110da70c..68996673be 100644
--- a/indra/newview/llscreenchannel.cpp
+++ b/indra/newview/llscreenchannel.cpp
@@ -49,15 +49,14 @@ using namespace LLNotificationsUI;
bool LLScreenChannel::mWasStartUpToastShown = false;
//--------------------------------------------------------------------------
-LLScreenChannel::LLScreenChannel(): mOverflowToastPanel(NULL),
- mStartUpToastPanel(NULL),
- mToastAlignment(NA_BOTTOM),
- mCanStoreToasts(true),
- mHiddenToastsNum(0),
- mOverflowToastHidden(false),
- mIsHovering(false),
- mControlHovering(false)
+LLScreenChannel::LLScreenChannel(LLUUID& id): mOverflowToastPanel(NULL), mStartUpToastPanel(NULL),
+ mToastAlignment(NA_BOTTOM), mCanStoreToasts(true),
+ mHiddenToastsNum(0), mOverflowToastHidden(false),
+ mIsHovering(false), mControlHovering(false),
+ mShowToasts(false)
{
+ mID = id;
+
setFollows(FOLLOWS_RIGHT | FOLLOWS_BOTTOM | FOLLOWS_TOP);
mOverflowFormatString = LLTrans::getString("OverflowInfoChannelString");
@@ -89,22 +88,11 @@ void LLScreenChannel::reshape(S32 width, S32 height, BOOL called_from_parent)
//--------------------------------------------------------------------------
void LLScreenChannel::addToast(LLToast::Params p)
{
- bool isSysWellWndShown = LLFloaterReg::getInstance("syswell_window")->getVisible();
- // we show toast in the following cases:
- // - the StartUp Toast is already hidden and the SysWell's window is hidden
- // - the SysWell's window is shown, but notification is a tip. We can't store it, so we show it
- // - the channel is intended for displaying of toasts always, e.g. alerts
- bool show_toast = (mWasStartUpToastShown && !isSysWellWndShown) || (isSysWellWndShown && p.is_tip) || mDisplayToastsAlways;
- bool store_toast = !show_toast && !p.is_tip && mCanStoreToasts;
+ bool store_toast = !mShowToasts && p.can_be_stored && mCanStoreToasts;
- // if we can't show or store a toast, then do nothing, just send ignore to a notification
- if(!show_toast && !store_toast)
+ if(!mShowToasts && !store_toast)
{
- if(p.notification)
- {
- p.notification->setIgnored(TRUE);
- p.notification->respond(p.notification->getResponseTemplate());
- }
+ mOnRejectToast(p);
return;
}
@@ -112,14 +100,13 @@ void LLScreenChannel::addToast(LLToast::Params p)
mOverflowToastHidden = false;
- getRootView()->addChild(new_toast_elem.toast);
new_toast_elem.toast->setOnFadeCallback(boost::bind(&LLScreenChannel::onToastFade, this, new_toast_elem.toast));
if(mControlHovering)
{
new_toast_elem.toast->setOnToastHoverCallback(boost::bind(&LLScreenChannel::onToastHover, this, _1, _2));
}
- if(show_toast)
+ if(mShowToasts)
{
mToastList.push_back(new_toast_elem);
showToasts();
@@ -393,7 +380,6 @@ void LLScreenChannel::createOverflowToast(S32 bottom, F32 timer)
mOverflowToastPanel->reshape(getRect().getWidth(), toast_rect.getHeight(), true);
toast_rect.setLeftTopAndSize(getRect().mLeft, bottom + toast_rect.getHeight()+gSavedSettings.getS32("ToastMargin"), getRect().getWidth(), toast_rect.getHeight());
mOverflowToastPanel->setRect(toast_rect);
- getRootView()->addChild(mOverflowToastPanel);
text_box->setValue(text);
text_box->setVisible(TRUE);
@@ -406,7 +392,6 @@ void LLScreenChannel::createOverflowToast(S32 bottom, F32 timer)
void LLScreenChannel::onOverflowToastHide()
{
mOverflowToastHidden = true;
- // *TODO: check whether it is needed: closeOverflowToastPanel();
}
//--------------------------------------------------------------------------
@@ -414,7 +399,7 @@ void LLScreenChannel::closeOverflowToastPanel()
{
if(mOverflowToastPanel != NULL)
{
- mOverflowToastPanel->close();
+ mOverflowToastPanel->closeFloater();
mOverflowToastPanel = NULL;
}
}
@@ -453,7 +438,6 @@ void LLScreenChannel::createStartUpToast(S32 notif_num, S32 bottom, F32 timer)
mStartUpToastPanel->reshape(getRect().getWidth(), toast_rect.getHeight(), true);
toast_rect.setLeftTopAndSize(getRect().mLeft, bottom + toast_rect.getHeight()+gSavedSettings.getS32("ToastMargin"), getRect().getWidth(), toast_rect.getHeight());
mStartUpToastPanel->setRect(toast_rect);
- getRootView()->addChild(mStartUpToastPanel);
text_box->setValue(text);
text_box->setVisible(TRUE);
@@ -479,8 +463,7 @@ void LLScreenChannel::closeStartUpToast()
{
if(mStartUpToastPanel != NULL)
{
- LLScreenChannel::setStartUpToastShown();
- mStartUpToastPanel->close();
+ mStartUpToastPanel->closeFloater();
mStartUpToastPanel = NULL;
}
}
@@ -499,8 +482,8 @@ void LLScreenChannel::removeToastsFromChannel()
hideToastsFromScreen();
for(std::vector<ToastElem>::iterator it = mToastList.begin(); it != mToastList.end(); it++)
{
- (*it).toast->close();
- //toast->mOnToastDestroy(toast, LLSD()); //TODO: check OnToastDestroy handler for chat
+ // *TODO: ivestigate mOnToastDestroy callback - change name or/and place
+ (*it).toast->mOnToastDestroy((*it).toast);
}
mToastList.clear();
}