summaryrefslogtreecommitdiff
path: root/indra/newview/llimfloater.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llimfloater.cpp')
-rw-r--r--indra/newview/llimfloater.cpp39
1 files changed, 30 insertions, 9 deletions
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index a35c04440b..8f0186ce24 100644
--- a/indra/newview/llimfloater.cpp
+++ b/indra/newview/llimfloater.cpp
@@ -55,7 +55,7 @@
LLIMFloater::LLIMFloater(const LLUUID& session_id)
- : LLDockableFloater(NULL, session_id),
+ : LLTransientDockableFloater(NULL, true, session_id),
mControlPanel(NULL),
mSessionID(session_id),
mLastMessageIndex(-1),
@@ -81,17 +81,22 @@ LLIMFloater::LLIMFloater(const LLUUID& session_id)
mFactoryMap["panel_im_control_panel"] = LLCallbackMap(createPanelGroupControl, this);
}
}
+}
+
+void LLIMFloater::onFocusLost()
+{
+ LLIMModel::getInstance()->resetActiveSessionID();
+}
- LLTransientFloaterMgr::getInstance()->registerTransientFloater(this);
+void LLIMFloater::onFocusReceived()
+{
+ LLIMModel::getInstance()->setActiveSessionID(mSessionID);
}
// virtual
void LLIMFloater::onClose(bool app_quitting)
{
- LLIMModel::instance().sendLeaveSession(mSessionID, mOtherParticipantUUID);
-
- //*TODO - move to the IMModel::sendLeaveSession() for the integrity (IB)
- gIMMgr->removeSession(mSessionID);
+ gIMMgr->leaveSession(mSessionID);
}
/* static */
@@ -116,6 +121,23 @@ void LLIMFloater::newIMCallback(const LLSD& data){
}
}
+void LLIMFloater::onVisibilityChange(const LLSD& new_visibility)
+{
+ bool visible = new_visibility.asBoolean();
+
+ LLVoiceChannel* voice_channel = LLIMModel::getInstance()->getVoiceChannel(mSessionID);
+
+ if (visible && voice_channel &&
+ voice_channel->getState() == LLVoiceChannel::STATE_CONNECTED)
+ {
+ LLFloaterReg::showInstance("voice_call", mSessionID);
+ }
+ else
+ {
+ LLFloaterReg::hideInstance("voice_call", mSessionID);
+ }
+}
+
void LLIMFloater::onSendMsg( LLUICtrl* ctrl, void* userdata )
{
LLIMFloater* self = (LLIMFloater*) userdata;
@@ -163,7 +185,6 @@ void LLIMFloater::sendMsg()
LLIMFloater::~LLIMFloater()
{
- LLTransientFloaterMgr::getInstance()->unregisterTransientFloater(this);
}
//virtual
@@ -297,7 +318,7 @@ void LLIMFloater::setDocked(bool docked, bool pop_on_undock)
(LLNotificationsUI::LLChannelManager::getInstance()->
findChannelByID(LLUUID(gSavedSettings.getString("NotificationChannelUUID"))));
- LLDockableFloater::setDocked(docked, pop_on_undock);
+ LLTransientDockableFloater::setDocked(docked, pop_on_undock);
// update notification channel state
if(channel)
@@ -311,7 +332,7 @@ void LLIMFloater::setVisible(BOOL visible)
LLNotificationsUI::LLScreenChannel* channel = dynamic_cast<LLNotificationsUI::LLScreenChannel*>
(LLNotificationsUI::LLChannelManager::getInstance()->
findChannelByID(LLUUID(gSavedSettings.getString("NotificationChannelUUID"))));
- LLDockableFloater::setVisible(visible);
+ LLTransientDockableFloater::setVisible(visible);
// update notification channel state
if(channel)