summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llnearbychathandler.cpp1
-rw-r--r--indra/newview/llscreenchannel.cpp125
-rw-r--r--indra/newview/llscreenchannel.h15
3 files changed, 4 insertions, 137 deletions
diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp
index 9e13a626b4..de4249a1dc 100644
--- a/indra/newview/llnearbychathandler.cpp
+++ b/indra/newview/llnearbychathandler.cpp
@@ -302,7 +302,6 @@ LLNearbyChatHandler::LLNearbyChatHandler(e_notification_type type, const LLSD& i
channel->setCreatePanelCallback(callback);
mChannel = LLChannelManager::getInstance()->addChannel(channel);
- mChannel->setOverflowFormatString("You have %d unread nearby chat messages");
}
LLNearbyChatHandler::~LLNearbyChatHandler()
diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp
index d0a0dd877f..027f3daffb 100644
--- a/indra/newview/llscreenchannel.cpp
+++ b/indra/newview/llscreenchannel.cpp
@@ -59,17 +59,14 @@ bool LLScreenChannel::mWasStartUpToastShown = false;
// LLScreenChannelBase
//////////////////////
LLScreenChannelBase::LLScreenChannelBase(const LLUUID& id) :
- mOverflowToastPanel(NULL)
- ,mToastAlignment(NA_BOTTOM)
+ mToastAlignment(NA_BOTTOM)
,mCanStoreToasts(true)
,mHiddenToastsNum(0)
- ,mOverflowToastHidden(false)
,mHoveredToast(NULL)
,mControlHovering(false)
,mShowToasts(true)
{
mID = id;
- mOverflowFormatString = LLTrans::getString("OverflowInfoChannelString");
mWorldViewRectConnection = gViewerWindow->setOnWorldViewRectUpdated(boost::bind(&LLScreenChannelBase::updatePositionAndSize, this, _1, _2));
setMouseOpaque( false );
setVisible(FALSE);
@@ -217,11 +214,6 @@ void LLScreenChannel::addToast(const LLToast::Params& p)
ToastElem new_toast_elem(p);
- // reset HIDDEN flags for the Overflow Toast
- mOverflowToastHidden = false;
- if(mOverflowToastPanel)
- mOverflowToastPanel->setIsHidden(false);
-
new_toast_elem.toast->setOnFadeCallback(boost::bind(&LLScreenChannel::onToastFade, this, _1));
new_toast_elem.toast->setOnToastDestroyedCallback(boost::bind(&LLScreenChannel::onToastDestroyed, this, _1));
if(mControlHovering)
@@ -322,8 +314,6 @@ void LLScreenChannel::loadStoredToastsToChannel()
if(mStoredToastList.size() == 0)
return;
-
- mOverflowToastHidden = false;
for(it = mStoredToastList.begin(); it != mStoredToastList.end(); ++it)
{
@@ -344,8 +334,6 @@ void LLScreenChannel::loadStoredToastByNotificationIDToChannel(LLUUID id)
if( it == mStoredToastList.end() )
return;
- mOverflowToastHidden = false;
-
LLToast* toast = (*it).toast;
if(toast->getVisible())
@@ -490,7 +478,7 @@ void LLScreenChannel::showToastsBottom()
if(floater && floater->overlapsScreenChannel())
{
LLRect world_rect = gViewerWindow->getWorldViewRectScaled();
- if(toast_rect.mTop + getOverflowToastHeight() + toast_margin > world_rect.mTop)
+ if(toast_rect.mTop > world_rect.mTop)
{
break;
}
@@ -526,7 +514,7 @@ void LLScreenChannel::showToastsBottom()
}
}
- if(it != mToastList.rend() && !mOverflowToastHidden)
+ if(it != mToastList.rend())
{
mHiddenToastsNum = 0;
for(; it != mToastList.rend(); it++)
@@ -535,7 +523,6 @@ void LLScreenChannel::showToastsBottom()
(*it).toast->setVisible(FALSE);
mHiddenToastsNum++;
}
- createOverflowToast(bottom, gSavedSettings.getS32("NotificationTipToastLifeTime"));
}
else
{
@@ -566,94 +553,6 @@ void LLScreenChannel::showToastsTop()
}
//--------------------------------------------------------------------------
-void LLScreenChannel::createOverflowToast(S32 bottom, F32 timer)
-{
- LLRect toast_rect;
- LLToast::Params p;
- p.lifetime_secs = timer;
-
- if(!mOverflowToastPanel)
- mOverflowToastPanel = new LLToast(p);
-
- if(!mOverflowToastPanel)
- return;
-
- mOverflowToastPanel->startFading();
- mOverflowToastPanel->setOnFadeCallback(boost::bind(&LLScreenChannel::onOverflowToastHide, this));
-
- LLTextBox* text_box = mOverflowToastPanel->getChild<LLTextBox>("toast_text");
- std::string text = llformat(mOverflowFormatString.c_str(),mHiddenToastsNum);
- if(mHiddenToastsNum == 1)
- {
- text += ".";
- }
- else
- {
- text += "s.";
- }
-
- toast_rect = mOverflowToastPanel->getRect();
- mOverflowToastPanel->reshape(getRect().getWidth(), toast_rect.getHeight(), true);
- toast_rect.setLeftTopAndSize(getRect().mLeft, bottom + toast_rect.getHeight()+gSavedSettings.getS32("ToastGap"), getRect().getWidth(), toast_rect.getHeight());
- mOverflowToastPanel->setRect(toast_rect);
-
- // don't show overflow toast if there is not enough space for it.
- LLDockableFloater* floater = dynamic_cast<LLDockableFloater*>(LLDockableFloater::getInstanceHandle().get());
- if(floater && floater->overlapsScreenChannel())
- {
- LLRect world_rect = gViewerWindow->getWorldViewRectScaled();
- if(toast_rect.mTop > world_rect.mTop)
- {
- closeOverflowToastPanel();
- return;
- }
- }
-
- text_box->setValue(text);
- text_box->setVisible(TRUE);
-
- mOverflowToastPanel->setVisible(TRUE);
-}
-
-//--------------------------------------------------------------------------
-void LLScreenChannel::onOverflowToastHide()
-{
- mOverflowToastHidden = true;
-
- // remove all hidden toasts from channel and save interactive notifications
- for(std::vector<ToastElem>::iterator it = mToastList.begin(); it != mToastList.end();)
- {
- if(!(*it).toast->getVisible())
- {
- if((*it).toast->getCanBeStored())
- {
- storeToast((*it));
- }
- else
- {
- deleteToast((*it).toast);
- }
-
- it = mToastList.erase(it);
- }
- else
- {
- ++it;
- }
- }
-}
-
-//--------------------------------------------------------------------------
-void LLScreenChannel::closeOverflowToastPanel()
-{
- if(mOverflowToastPanel != NULL)
- {
- mOverflowToastPanel->setVisible(FALSE);
- mOverflowToastPanel->stopFading();
- }
-}
-
-//--------------------------------------------------------------------------
void LLScreenChannel::createStartUpToast(S32 notif_num, F32 timer)
{
LLRect toast_rect;
@@ -698,24 +597,6 @@ F32 LLScreenChannel::getHeightRatio()
return ratio;
}
-S32 LLScreenChannel::getOverflowToastHeight()
-{
- if(mOverflowToastPanel)
- {
- return mOverflowToastPanel->getRect().getHeight();
- }
-
- static S32 height = 0;
- if(0 == height)
- {
- LLToast::Params p;
- LLToast* toast = new LLToast(p);
- height = toast->getRect().getHeight();
- delete toast;
- }
- return height;
-}
-
//--------------------------------------------------------------------------
void LLScreenChannel::updateStartUpString(S32 num)
{
diff --git a/indra/newview/llscreenchannel.h b/indra/newview/llscreenchannel.h
index 054f92096c..88053d87d9 100644
--- a/indra/newview/llscreenchannel.h
+++ b/indra/newview/llscreenchannel.h
@@ -72,8 +72,7 @@ public:
virtual void setToastAlignment(EToastAlignment align) {mToastAlignment = align;}
virtual void setChannelAlignment(EChannelAlignment align) {mChannelAlignment = align;}
- virtual void setOverflowFormatString ( const std::string& str) { mOverflowFormatString = str; }
-
+
// kill or modify a toast by its ID
virtual void killToastByNotificationID(LLUUID id) {};
virtual void modifyToastNotificationByID(LLUUID id, LLSD data) {};
@@ -121,17 +120,13 @@ protected:
LLToast* mHoveredToast;
bool mCanStoreToasts;
bool mDisplayToastsAlways;
- bool mOverflowToastHidden;
// controls whether a channel shows toasts or not
bool mShowToasts;
//
EToastAlignment mToastAlignment;
EChannelAlignment mChannelAlignment;
- // attributes for the Overflow Toast
S32 mHiddenToastsNum;
- LLToast* mOverflowToastPanel;
- std::string mOverflowFormatString;
// channel's ID
LLUUID mID;
@@ -192,8 +187,6 @@ public:
void removeToastsBySessionID(LLUUID id);
// remove all storable toasts from screen and store them
void removeAndStoreAllStorableToasts();
- // close the Overflow Toast
- void closeOverflowToastPanel();
// close the StartUp Toast
void closeStartUpToast();
@@ -261,7 +254,6 @@ private:
void onToastHover(LLToast* toast, bool mouse_enter);
void onToastFade(LLToast* toast);
void onToastDestroyed(LLToast* toast);
- void onOverflowToastHide();
void onStartUpToastHide();
//
@@ -274,9 +266,6 @@ private:
void showToastsCentre();
void showToastsTop();
- // create the Overflow Toast
- void createOverflowToast(S32 bottom, F32 timer);
-
// create the StartUp Toast
void createStartUpToast(S32 notif_num, F32 timer);
@@ -285,8 +274,6 @@ private:
*/
static F32 getHeightRatio();
- S32 getOverflowToastHeight();
-
// Channel's flags
static bool mWasStartUpToastShown;