diff options
author | Dmitry Oleshko <doleshko@productengine.com> | 2009-12-08 17:19:09 +0200 |
---|---|---|
committer | Dmitry Oleshko <doleshko@productengine.com> | 2009-12-08 17:19:09 +0200 |
commit | 8b6b55e07998e33b624f5f4c6a148017ae87774f (patch) | |
tree | e9c4dd3e8fb423d8cd48da251502ec9d9228f757 /indra/newview/llimview.cpp | |
parent | dcb786b5a477acd74ed7450a4975de0a7a1d66bd (diff) |
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
Diffstat (limited to 'indra/newview/llimview.cpp')
-rw-r--r-- | indra/newview/llimview.cpp | 47 |
1 files changed, 41 insertions, 6 deletions
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<LLVoiceChannelP2P*>(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<LLTextBox>("leaving")->setVisible(true); ocd->getChild<LLTextBox>("connecting")->setVisible(false); ocd->getChild<LLTextBox>("noanswer")->setVisible(false); + ocd->getChild<LLButton>("Cancel")->setVisible(true); } return; @@ -1301,10 +1301,12 @@ void LLCallDialogManager::onVoiceChannelStateChanged(const LLVoiceChannel::EStat ocd->getChild<LLTextBox>("leaving")->setVisible(true); ocd->getChild<LLTextBox>("connecting")->setVisible(true); ocd->getChild<LLTextBox>("noanswer")->setVisible(false); + ocd->getChild<LLButton>("Cancel")->setVisible(true); } return; case LLVoiceChannel::STATE_ERROR : + mCallDialogPayload["start_timer"] = true; ocd = dynamic_cast<LLOutgoingCallDialog*>(LLFloaterReg::showInstance("outgoing_call", mCallDialogPayload, TRUE)); if (ocd) { @@ -1312,6 +1314,7 @@ void LLCallDialogManager::onVoiceChannelStateChanged(const LLVoiceChannel::EStat ocd->getChild<LLTextBox>("leaving")->setVisible(false); ocd->getChild<LLTextBox>("connecting")->setVisible(false); ocd->getChild<LLTextBox>("noanswer")->setVisible(true); + ocd->getChild<LLButton>("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<LLAvatarIconCtrl>("avatar_icon"); icon->setValue(callee_id); + + if(mPayload.has("start_timer")) + { + mLifetimeTimer.reset(); + } } |