summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelimcontrolpanel.cpp
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2010-07-02 16:46:25 +0300
committerVadim Savchuk <vsavchuk@productengine.com>2010-07-02 16:46:25 +0300
commit589619d8ccdcc9dfb5b575e602a657c7c59b0b4a (patch)
treedb366e3c51817ecd37ef66bc16f29bb6637118a5 /indra/newview/llpanelimcontrolpanel.cpp
parent04838e411be0c7996fcddff5cccecb0df20db63f (diff)
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
Diffstat (limited to 'indra/newview/llpanelimcontrolpanel.cpp')
-rw-r--r--indra/newview/llpanelimcontrolpanel.cpp12
1 files changed, 11 insertions, 1 deletions
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<LLAvatarIconCtrl>("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);