diff options
author | Alexei Arabadji <aarabadji@productengine.com> | 2010-05-12 11:11:02 +0300 |
---|---|---|
committer | Alexei Arabadji <aarabadji@productengine.com> | 2010-05-12 11:11:02 +0300 |
commit | 9ab4d2ca8be2edcafa6cdfc3bd774ebaed444dc8 (patch) | |
tree | b9c98a4b903d16456962927680660ac6e79537ca | |
parent | b24dfb72c54ccf98b8854fa5270e0b28106ad5cb (diff) |
EXT-7120 FIXED Added confirmation about leaving group, ad-hoc and p2p call.
reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/374/
--HG--
branch : product-engine
-rw-r--r-- | indra/newview/llimfloater.cpp | 28 | ||||
-rw-r--r-- | indra/newview/llimfloater.h | 5 | ||||
-rw-r--r-- | indra/newview/llviewermessage.cpp | 16 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 13 |
4 files changed, 62 insertions, 0 deletions
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index c0cc3f1985..8549269a56 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -1155,3 +1155,31 @@ void LLIMFloater::onIMChicletCreated( const LLUUID& session_id ) } } + +void LLIMFloater::onClickCloseBtn() +{ + + LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession( + mSessionID); + + if (session == NULL) + { + llwarns << "Empty session." << llendl; + return; + } + + bool is_call_with_chat = session->isGroupSessionType() + || session->isAdHocSessionType() || session->isP2PSessionType(); + + LLVoiceChannel* voice_channel = LLIMModel::getInstance()->getVoiceChannel(mSessionID); + + if (is_call_with_chat && voice_channel != NULL && voice_channel->isActive()) + { + LLSD payload; + payload["session_id"] = mSessionID; + LLNotificationsUtil::add("ConfirmLeaveCall", LLSD(), payload); + return; + } + + LLFloater::onClickCloseBtn(); +} diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h index f9dd8b9b85..d63246a5cd 100644 --- a/indra/newview/llimfloater.h +++ b/indra/newview/llimfloater.h @@ -50,6 +50,7 @@ class LLInventoryCategory; */ class LLIMFloater : public LLTransientDockableFloater { + LOG_CLASS(LLIMFloater); public: LLIMFloater(const LLUUID& session_id); @@ -120,6 +121,10 @@ public: virtual LLTransientFloaterMgr::ETransientGroup getGroup() { return LLTransientFloaterMgr::IM; } +protected: + /* virtual */ + void onClickCloseBtn(); + private: // process focus events to set a currently active session /* virtual */ void onFocusLost(); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 46adb0a46b..71e50cacfd 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -6472,3 +6472,19 @@ void LLOfferInfo::forceResponse(InventoryOfferResponse response) params.functor.function(boost::bind(&LLOfferInfo::inventory_offer_callback, this, _1, _2)); LLNotifications::instance().forceResponse(params, response); } + +static bool confirm_leave_call_callback(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + const LLSD& payload = notification["payload"]; + LLUUID session_id = payload["session_id"]; + + LLFloater* im_floater = LLFloaterReg::findInstance("impanel", session_id); + if (option == 0 && im_floater != NULL) + { + im_floater->closeFloater(); + } + + return false; +} +static LLNotificationFunctorRegistration confirm_leave_call_cb("ConfirmLeaveCall", confirm_leave_call_callback); diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 149a254f49..cf7cec04de 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -5970,6 +5970,19 @@ Drag items from inventory onto a person in the resident picker Avatar '[NAME]' rezzed in [TIME] seconds. </notification> + <notification + icon="alertmodal.tga" + name="ConfirmLeaveCall" + type="alert"> +Are you sure you want to leave this call? + <usetemplate + ignoretext="Confirm before I leave call" + name="okcancelignore" + notext="No" + yestext="Yes"/> + <unique/> + </notification> + <global name="UnsupportedCPU"> - Your CPU speed does not meet the minimum requirements. </global> |