From 8b6b55e07998e33b624f5f4c6a148017ae87774f Mon Sep 17 00:00:00 2001 From: Dmitry Oleshko Date: Tue, 8 Dec 2009 17:19:09 +0200 Subject: work on normal tasks: (EXT-2803) Create notifications and dialogs to negotiate P2P voice chat (shown over the Speak button) (EXT-2806) Create notification windows and dialogs to negotiate Group Voice Chat (docked to Speak button's chevron) (EXT-2802) Create notifications and dialogs to negotiate AvaLine calls (shown over Speak button) (EXT-2805) Create notifications and dialogs to negotiate Ad-Hoc calls (shown over Speak button) - "NO ANSWER" notification gets closed after specified timeout - added possibility to check direction of call (but it doesn't work for group and ad-hoc calls yet) - adjusted layout for the incoming call dialog --HG-- branch : product-engine --- indra/newview/llimview.cpp | 47 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 41 insertions(+), 6 deletions(-) (limited to 'indra/newview/llimview.cpp') diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 6c4af0522f..b710c41650 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -154,7 +154,6 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& mInitialTargetIDs(ids), mVoiceChannel(NULL), mSpeakers(NULL), - mCallDialogManager(NULL), mSessionInitialized(false), mCallBackEnabled(true), mTextIMPossible(true), @@ -287,9 +286,6 @@ void LLIMModel::LLIMSession::onVoiceChannelStateChanged(const LLVoiceChannel::ES LLIMModel::LLIMSession::~LLIMSession() { - delete mCallDialogManager; - mCallDialogManager = NULL; - delete mSpeakers; mSpeakers = NULL; @@ -1268,6 +1264,7 @@ void LLCallDialogManager::onVoiceChannelStateChanged(const LLVoiceChannel::EStat { LLSD mCallDialogPayload; LLOutgoingCallDialog* ocd; + bool is_incoming; mCallDialogPayload["session_id"] = sSession->mSessionID; mCallDialogPayload["session_name"] = sSession->mName; @@ -1277,8 +1274,10 @@ void LLCallDialogManager::onVoiceChannelStateChanged(const LLVoiceChannel::EStat switch(new_state) { case LLVoiceChannel::STATE_CALL_STARTED : - // do not show "Calling to..." if it is incoming P2P call - if(sSession->mSessionType == LLIMModel::LLIMSession::P2P_SESSION && static_cast(sSession->mVoiceChannel)->isIncomingCall()) + // do not show "Calling to..." if it is incoming call + is_incoming = LLVoiceClient::getInstance()->isSessionIncoming(sSession->mSessionID); + // *TODO: implement for AdHoc and Group voice chats + if(is_incoming) { return; } @@ -1290,6 +1289,7 @@ void LLCallDialogManager::onVoiceChannelStateChanged(const LLVoiceChannel::EStat ocd->getChild("leaving")->setVisible(true); ocd->getChild("connecting")->setVisible(false); ocd->getChild("noanswer")->setVisible(false); + ocd->getChild("Cancel")->setVisible(true); } return; @@ -1301,10 +1301,12 @@ void LLCallDialogManager::onVoiceChannelStateChanged(const LLVoiceChannel::EStat ocd->getChild("leaving")->setVisible(true); ocd->getChild("connecting")->setVisible(true); ocd->getChild("noanswer")->setVisible(false); + ocd->getChild("Cancel")->setVisible(true); } return; case LLVoiceChannel::STATE_ERROR : + mCallDialogPayload["start_timer"] = true; ocd = dynamic_cast(LLFloaterReg::showInstance("outgoing_call", mCallDialogPayload, TRUE)); if (ocd) { @@ -1312,6 +1314,7 @@ void LLCallDialogManager::onVoiceChannelStateChanged(const LLVoiceChannel::EStat ocd->getChild("leaving")->setVisible(false); ocd->getChild("connecting")->setVisible(false); ocd->getChild("noanswer")->setVisible(true); + ocd->getChild("Cancel")->setVisible(false); } return; @@ -1363,6 +1366,33 @@ LLCallDialog(payload) instance->onCancel(instance); } } +void LLOutgoingCallDialog::draw() +{ + if (lifetimeHasExpired()) + { + onLifetimeExpired(); + } + LLDockableFloater::draw(); +} + +bool LLOutgoingCallDialog::lifetimeHasExpired() +{ + if (mLifetimeTimer.getStarted()) + { + F32 elapsed_time = mLifetimeTimer.getElapsedTimeF32(); + if (elapsed_time > LIFETIME) + { + return true; + } + } + return false; +} + +void LLOutgoingCallDialog::onLifetimeExpired() +{ + mLifetimeTimer.stop(); + closeFloater(); +} void LLOutgoingCallDialog::onOpen(const LLSD& key) { @@ -1391,6 +1421,11 @@ void LLOutgoingCallDialog::onOpen(const LLSD& key) childSetTextArg("connecting", "[CALLEE_NAME]", callee_name); LLAvatarIconCtrl* icon = getChild("avatar_icon"); icon->setValue(callee_id); + + if(mPayload.has("start_timer")) + { + mLifetimeTimer.reset(); + } } -- cgit v1.2.3