diff options
-rw-r--r-- | indra/newview/llimview.cpp | 53 | ||||
-rw-r--r-- | indra/newview/llimview.h | 17 | ||||
-rw-r--r-- | indra/newview/llviewerfloaterreg.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llvoicechannel.cpp | 12 |
4 files changed, 57 insertions, 26 deletions
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 32b0cbff38..1b1e6501c0 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1577,7 +1577,7 @@ void LLCallDialog::setIcon(const LLSD& session_id, const LLSD& participant_id) } } -bool LLOutgoingCallDialog::lifetimeHasExpired() +bool LLCallDialog::lifetimeHasExpired() { if (mLifetimeTimer.getStarted()) { @@ -1590,7 +1590,7 @@ bool LLOutgoingCallDialog::lifetimeHasExpired() return false; } -void LLOutgoingCallDialog::onLifetimeExpired() +void LLCallDialog::onLifetimeExpired() { mLifetimeTimer.stop(); closeFloater(); @@ -1744,19 +1744,6 @@ LLCallDialog(payload) { } -bool LLIncomingCallDialog::lifetimeHasExpired() -{ - if (mLifetimeTimer.getStarted()) - { - F32 elapsed_time = mLifetimeTimer.getElapsedTimeF32(); - if (elapsed_time > mLifetime) - { - return true; - } - } - return false; -} - void LLIncomingCallDialog::onLifetimeExpired() { // check whether a call is valid or not @@ -3218,6 +3205,42 @@ public: } }; +LLCallInfoDialog::LLCallInfoDialog(const LLSD& payload) : LLCallDialog(payload) +{ +} + +BOOL LLCallInfoDialog::postBuild() +{ + // init notification's lifetime + std::istringstream ss( getString("lifetime") ); + if (!(ss >> mLifetime)) + { + mLifetime = DEFAULT_LIFETIME; + } + return LLCallDialog::postBuild(); +} + +void LLCallInfoDialog::onOpen(const LLSD& key) +{ + if(key.has("msg")) + { + std::string msg = key["msg"]; + getChild<LLTextBox>("msg")->setValue(msg); + } + + mLifetimeTimer.start(); +} + +void LLCallInfoDialog::show(const std::string& status_name, const LLSD& args) +{ + LLUIString message = LLTrans::getString(status_name); + message.setArgs(args); + + LLSD payload; + payload["msg"] = message; + LLFloaterReg::showInstance("call_info", payload); +} + LLHTTPRegistration<LLViewerChatterBoxSessionStartReply> gHTTPRegistrationMessageChatterboxsessionstartreply( "/message/ChatterBoxSessionStartReply"); diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index a3b4f78af0..0386ff234d 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -512,8 +512,8 @@ protected: // notification's lifetime in seconds S32 mLifetime; static const S32 DEFAULT_LIFETIME = 5; - virtual bool lifetimeHasExpired() {return false;}; - virtual void onLifetimeExpired() {}; + virtual bool lifetimeHasExpired(); + virtual void onLifetimeExpired(); virtual void getAllowedRect(LLRect& rect); @@ -543,7 +543,6 @@ public: static void onStartIM(void* user_data); private: - /*virtual*/ bool lifetimeHasExpired(); /*virtual*/ void onLifetimeExpired(); void processCallResponse(S32 response); }; @@ -562,8 +561,16 @@ public: private: // hide all text boxes void hideAllText(); - /*virtual*/ bool lifetimeHasExpired(); - /*virtual*/ void onLifetimeExpired(); +}; + +class LLCallInfoDialog : public LLCallDialog +{ +public: + LLCallInfoDialog(const LLSD& payload); + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + + static void show(const std::string& status_name, const LLSD& args); }; // Globals diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 3a834e7532..e87d380e4d 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -204,6 +204,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("openobject", "floater_openobject.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterOpenObject>); LLFloaterReg::add("outgoing_call", "floater_outgoing_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLOutgoingCallDialog>); + LLFloaterReg::add("call_info", "floater_call_info.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLCallInfoDialog>); LLFloaterReg::add("parcel_info", "floater_preview_url.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterParcelInfo>); LLFloaterPayUtil::registerFloater(); diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index 917d69fe16..589999c026 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -389,13 +389,13 @@ void LLVoiceChannel::setState(EState state) switch(state) { case STATE_RINGING: - gIMMgr->addSystemMessage(mSessionID, "ringing", mNotifyArgs); + LLCallInfoDialog::show("ringing", mNotifyArgs); break; case STATE_CONNECTED: - gIMMgr->addSystemMessage(mSessionID, "connected", mNotifyArgs); + LLCallInfoDialog::show("connected", mNotifyArgs); break; case STATE_HUNG_UP: - gIMMgr->addSystemMessage(mSessionID, "hang_up", mNotifyArgs); + LLCallInfoDialog::show("hang_up", mNotifyArgs); break; default: break; @@ -635,7 +635,7 @@ void LLVoiceChannelGroup::setState(EState state) case STATE_RINGING: if ( !mIsRetrying ) { - gIMMgr->addSystemMessage(mSessionID, "ringing", mNotifyArgs); + LLCallInfoDialog::show("ringing", mNotifyArgs); } doSetState(state); @@ -698,7 +698,7 @@ void LLVoiceChannelProximal::handleStatusChange(EStatusType status) // do not notify user when leaving proximal channel return; case STATUS_VOICE_DISABLED: - gIMMgr->addSystemMessage(LLUUID::null, "unavailable", mNotifyArgs); + LLCallInfoDialog::show("unavailable", mNotifyArgs); return; default: break; @@ -897,7 +897,7 @@ void LLVoiceChannelP2P::setState(EState state) // so provide a special purpose message here if (mReceivedCall && state == STATE_RINGING) { - gIMMgr->addSystemMessage(mSessionID, "answering", mNotifyArgs); + LLCallInfoDialog::show("answering", mNotifyArgs); doSetState(state); return; } |