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
master
Alexei Arabadji 2010-05-12 11:11:02 +03:00
parent b24dfb72c5
commit 9ab4d2ca8b
4 changed files with 62 additions and 0 deletions

View File

@ -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();
}

View File

@ -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();

View File

@ -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);

View File

@ -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>