From 89e917599b7d24e2fc7ec9c58522756f4877ad92 Mon Sep 17 00:00:00 2001
From: Alexei Arabadji <aarabadji@productengine.com>
Date: Mon, 16 Nov 2009 14:36:09 +0200
Subject: [PATCH] fixed EXT-862 "Add support for Busy mode into notifications";
 disabled showing toasts except alertmodal in busy mode

--HG--
branch : product-engine
---
 indra/newview/llagent.cpp          | 3 +++
 indra/newview/llchannelmanager.cpp | 9 ++++++++-
 indra/newview/llchannelmanager.h   | 7 +++++++
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index ca1688ad1f7..1257cf97897 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -107,6 +107,7 @@
 
 #include "llnavigationbar.h" //to show/hide navigation bar when changing mouse look state
 #include "llagentui.h"
+#include "llchannelmanager.h"
 
 using namespace LLVOAvatarDefines;
 
@@ -2166,6 +2167,7 @@ void LLAgent::setBusy()
 	{
 		gBusyMenu->setLabel(LLTrans::getString("AvatarSetNotBusy"));
 	}
+	LLNotificationsUI::LLChannelManager::getInstance()->muteAllChannels(true);
 }
 
 //-----------------------------------------------------------------------------
@@ -2179,6 +2181,7 @@ void LLAgent::clearBusy()
 	{
 		gBusyMenu->setLabel(LLTrans::getString("AvatarSetBusy"));
 	}
+	LLNotificationsUI::LLChannelManager::getInstance()->muteAllChannels(false);
 }
 
 //-----------------------------------------------------------------------------
diff --git a/indra/newview/llchannelmanager.cpp b/indra/newview/llchannelmanager.cpp
index 914435b6409..3443d8b593a 100644
--- a/indra/newview/llchannelmanager.cpp
+++ b/indra/newview/llchannelmanager.cpp
@@ -220,5 +220,12 @@ void LLChannelManager::removeChannelByID(const LLUUID id)
 }
 
 //--------------------------------------------------------------------------
-
+void LLChannelManager::muteAllChannels(bool mute)
+{
+	for (std::vector<ChannelElem>::iterator it = mChannelList.begin();
+			it != mChannelList.end(); it++)
+	{
+		it->channel->setShowToasts(!mute);
+	}
+}
 
diff --git a/indra/newview/llchannelmanager.h b/indra/newview/llchannelmanager.h
index b927d369cd4..4b66a1ef892 100644
--- a/indra/newview/llchannelmanager.h
+++ b/indra/newview/llchannelmanager.h
@@ -102,6 +102,13 @@ class LLChannelManager : public LLSingleton<LLChannelManager>
 	// remove channel methods
 	void	removeChannelByID(const LLUUID id);
 
+	/**
+	 * Manages toasts showing for all channels.
+	 *
+	 * @param mute Flag to disable/enable toasts showing.
+	 */
+	void muteAllChannels(bool mute);
+
 private:
 
 	LLScreenChannel* createChannel(LLChannelManager::Params& p);
-- 
GitLab