From 589619d8ccdcc9dfb5b575e602a657c7c59b0b4a Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Fri, 2 Jul 2010 16:46:25 +0300 Subject: EXT-7304 Disable "Share", "Pay", "Call", etc buttons in IM window when viewer gets disconnected. I haven't found a better way to do that than binding to focus received signal (borrowed the idea from the nearby chat input field implementation). Reviewed by Sergey Litovchuk at https://codereview.productengine.com/secondlife/r/686/ --HG-- branch : product-engine --- indra/newview/llpanelimcontrolpanel.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'indra/newview/llpanelimcontrolpanel.cpp') diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index 709bb83fe4..b79a4f359a 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -37,6 +37,7 @@ #include "llpanelimcontrolpanel.h" #include "llagent.h" +#include "llappviewer.h" // for gDisconnected #include "llavataractions.h" #include "llavatariconctrl.h" #include "llbutton.h" @@ -163,7 +164,7 @@ BOOL LLPanelIMControlPanel::postBuild() childSetAction("pay_btn", boost::bind(&LLPanelIMControlPanel::onPayButtonClicked, this)); childSetEnabled("add_friend_btn", !LLAvatarActions::isFriend(getChild("avatar_icon")->getAvatarId())); - + setFocusReceivedCallback(boost::bind(&LLPanelIMControlPanel::onFocusReceived, this)); return LLPanelChatControlPanel::postBuild(); } @@ -194,6 +195,15 @@ void LLPanelIMControlPanel::onShareButtonClicked() LLAvatarActions::share(mAvatarID); } +void LLPanelIMControlPanel::onFocusReceived() +{ + // Disable all the buttons (Call, Teleport, etc) if disconnected. + if (gDisconnected) + { + setAllChildrenEnabled(FALSE); + } +} + void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id) { LLPanelChatControlPanel::setSessionId(session_id); -- cgit v1.2.3