summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorGilbert Gonzales <gilbert@lindenlab.com>2013-04-01 15:36:05 -0700
committerGilbert Gonzales <gilbert@lindenlab.com>2013-04-01 15:36:05 -0700
commitb37f501a87f91851d8b2d9904d3910e95def1abc (patch)
treef33e4706cabc48865a9d0140f28f6197f98afec7 /indra
parent56939a2a2b9510bd7f5fc43bed460c0d23a743a0 (diff)
CHUI-796 (User doesn't get all messages in 'do not disturb' mode): Now when a conversation is focused by clicking on it's line item, selecting a torn off floater or unminimized a torn off floater the stored notifications for that conversation will be removed.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfloaterimcontainer.cpp62
-rw-r--r--indra/newview/llfloaterimcontainer.h1
-rw-r--r--indra/newview/llfloaterimnearbychat.cpp2
-rw-r--r--indra/newview/llfloaterimsession.cpp30
-rw-r--r--indra/newview/llfloaterimsession.h2
5 files changed, 82 insertions, 15 deletions
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index 7296ec3ced..58817485fb 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -585,6 +585,28 @@ void LLFloaterIMContainer::returnFloaterToHost()
floater->onTearOffClicked();
}
+void LLFloaterIMContainer::setMinimized(BOOL b)
+{
+ bool was_minimized = isMinimized();
+ LLMultiFloater::setMinimized(b);
+
+ //Switching from minimized to un-minimized
+ if(was_minimized && !b)
+ {
+ LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::findConversation(mSelectedSession);
+
+ if(session_floater && !session_floater->isTornOff())
+ {
+ //When in DND mode, remove stored IM notifications
+ //Nearby chat (Null) IMs are not stored while in DND mode, so can ignore removal
+ if(gAgent.isDoNotDisturb() && mSelectedSession.notNull())
+ {
+ LLDoNotDisturbNotificationStorage::getInstance()->removeNotification(LLDoNotDisturbNotificationStorage::toastName, mSelectedSession);
+ }
+ }
+ }
+}
+
void LLFloaterIMContainer::setVisible(BOOL visible)
{ LLFloaterIMNearbyChat* nearby_chat;
if (visible)
@@ -597,10 +619,21 @@ void LLFloaterIMContainer::setVisible(BOOL visible)
// *TODO: find a way to move this to XML as a default panel or something like that
LLSD name("nearby_chat");
LLFloaterReg::toggleInstanceOrBringToFront(name);
- setSelectedSession(LLUUID(NULL));
+ selectConversationPair(LLUUID(NULL), false, false);
}
openNearbyChat();
- selectConversationPair(getSelectedSession(), false, false);
+ flashConversationItemWidget(mSelectedSession,false);
+
+ LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::findConversation(mSelectedSession);
+ if(session_floater && !session_floater->isMinimized())
+ {
+ //When in DND mode, remove stored IM notifications
+ //Nearby chat (Null) IMs are not stored while in DND mode, so can ignore removal
+ if(gAgent.isDoNotDisturb() && mSelectedSession.notNull())
+ {
+ LLDoNotDisturbNotificationStorage::getInstance()->removeNotification(LLDoNotDisturbNotificationStorage::toastName, mSelectedSession);
+ }
+ }
}
nearby_chat = LLFloaterReg::findTypedInstance<LLFloaterIMNearbyChat>("nearby_chat");
@@ -1389,13 +1422,6 @@ BOOL LLFloaterIMContainer::selectConversationPair(const LLUUID& session_id, bool
widget->getParentFolder()->setSelection(widget, FALSE, FALSE);
mConversationsRoot->scrollToShowSelection();
}
-
- //When in DND mode, remove stored IM notifications
- //Nearby chat (Null) IMs are not stored while in DND mode, so can ignore removal
- if(gAgent.isDoNotDisturb() && session_id.notNull())
- {
- LLDoNotDisturbNotificationStorage::getInstance()->removeNotification(LLDoNotDisturbNotificationStorage::toastName, session_id);
- }
}
/* floater processing */
@@ -1420,14 +1446,19 @@ BOOL LLFloaterIMContainer::selectConversationPair(const LLUUID& session_id, bool
{
showStub(true);
}
+
+ //When in DND mode, remove stored IM notifications
+ //Nearby chat (Null) IMs are not stored while in DND mode, so can ignore removal
+ if(gAgent.isDoNotDisturb() && session_id.notNull())
+ {
+ LLDoNotDisturbNotificationStorage::getInstance()->removeNotification(LLDoNotDisturbNotificationStorage::toastName, session_id);
+ }
}
// Set the focus on the selected floater
- if (!session_floater->hasFocus())
+ if (!session_floater->hasFocus() && !session_floater->isMinimized())
{
- BOOL is_minimized = session_floater->isMinimized();
session_floater->setFocus(focus_floater);
- session_floater->setMinimized(is_minimized);
}
}
flashConversationItemWidget(session_id,false);
@@ -1986,8 +2017,11 @@ void LLFloaterIMContainer::closeFloater(bool app_quitting/* = false*/)
{
// Always unminimize before trying to close.
// Most of the time the user will never see this state.
- setMinimized(FALSE);
-
+ if(isMinimized())
+ {
+ LLMultiFloater::setMinimized(FALSE);
+ }
+
LLFloater::closeFloater(app_quitting);
}
diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h
index 52b672241f..e39d20ec35 100644
--- a/indra/newview/llfloaterimcontainer.h
+++ b/indra/newview/llfloaterimcontainer.h
@@ -59,6 +59,7 @@ public:
/*virtual*/ BOOL postBuild();
/*virtual*/ void onOpen(const LLSD& key);
/*virtual*/ void draw();
+ /*virtual*/ void setMinimized(BOOL b);
/*virtual*/ void setVisible(BOOL visible);
/*virtual*/ void setVisibleAndFrontmost(BOOL take_focus=TRUE, const LLSD& key = LLSD());
/*virtual*/ void updateResizeLimits();
diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp
index 56b0c15cb9..49f36a2f32 100644
--- a/indra/newview/llfloaterimnearbychat.cpp
+++ b/indra/newview/llfloaterimnearbychat.cpp
@@ -328,7 +328,7 @@ void LLFloaterIMNearbyChat::onChatFontChange(LLFontGL* fontp)
void LLFloaterIMNearbyChat::show()
{
openFloater(getKey());
- }
+}
bool LLFloaterIMNearbyChat::isChatVisible() const
{
diff --git a/indra/newview/llfloaterimsession.cpp b/indra/newview/llfloaterimsession.cpp
index 6d5145f205..edc25a7d7e 100644
--- a/indra/newview/llfloaterimsession.cpp
+++ b/indra/newview/llfloaterimsession.cpp
@@ -39,6 +39,7 @@
#include "llchannelmanager.h"
#include "llchiclet.h"
#include "llchicletbar.h"
+#include "lldonotdisturbnotificationstorage.h"
#include "llfloaterreg.h"
#include "llfloateravatarpicker.h"
#include "llfloaterimcontainer.h" // to replace separate IM Floaters with multifloater container
@@ -645,6 +646,23 @@ void LLFloaterIMSession::setDocked(bool docked, bool pop_on_undock)
}
}
+void LLFloaterIMSession::setMinimized(BOOL b)
+{
+ bool wasMinimized = isMinimized();
+ LLFloaterIMSessionTab::setMinimized(b);
+
+ //Switching from minimized state to un-minimized state
+ if(wasMinimized && !b)
+ {
+ //When in DND mode, remove stored IM notifications
+ //Nearby chat (Null) IMs are not stored while in DND mode, so can ignore removal
+ if(gAgent.isDoNotDisturb())
+ {
+ LLDoNotDisturbNotificationStorage::getInstance()->removeNotification(LLDoNotDisturbNotificationStorage::toastName, mSessionID);
+ }
+ }
+}
+
void LLFloaterIMSession::setVisible(BOOL visible)
{
LLNotificationsUI::LLScreenChannel* channel = static_cast<LLNotificationsUI::LLScreenChannel*>
@@ -713,6 +731,18 @@ BOOL LLFloaterIMSession::getVisible()
return visible;
}
+void LLFloaterIMSession::setFocus(BOOL focus)
+{
+ LLFloaterIMSessionTab::setFocus(focus);
+
+ //When in DND mode, remove stored IM notifications
+ //Nearby chat (Null) IMs are not stored while in DND mode, so can ignore removal
+ if(focus && gAgent.isDoNotDisturb())
+ {
+ LLDoNotDisturbNotificationStorage::getInstance()->removeNotification(LLDoNotDisturbNotificationStorage::toastName, mSessionID);
+ }
+}
+
//static
bool LLFloaterIMSession::toggle(const LLUUID& session_id)
{
diff --git a/indra/newview/llfloaterimsession.h b/indra/newview/llfloaterimsession.h
index cb330bca0f..a0e0171b34 100644
--- a/indra/newview/llfloaterimsession.h
+++ b/indra/newview/llfloaterimsession.h
@@ -65,8 +65,10 @@ public:
// LLView overrides
/*virtual*/ BOOL postBuild();
+ /*virtual*/ void setMinimized(BOOL b);
/*virtual*/ void setVisible(BOOL visible);
/*virtual*/ BOOL getVisible();
+ /*virtual*/ void setFocus(BOOL focus);
// Check typing timeout timer.
/*virtual*/ void draw();