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.

meow-7.2.2
Gilbert Gonzales 2013-04-01 15:36:05 -07:00
parent 56939a2a2b
commit b37f501a87
5 changed files with 82 additions and 15 deletions

View File

@ -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);
}

View File

@ -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();

View File

@ -328,7 +328,7 @@ void LLFloaterIMNearbyChat::onChatFontChange(LLFontGL* fontp)
void LLFloaterIMNearbyChat::show()
{
openFloater(getKey());
}
}
bool LLFloaterIMNearbyChat::isChatVisible() const
{

View File

@ -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)
{

View File

@ -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();