summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llpanelimcontrolpanel.cpp12
-rw-r--r--indra/newview/llpanelimcontrolpanel.h1
2 files changed, 12 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);
diff --git a/indra/newview/llpanelimcontrolpanel.h b/indra/newview/llpanelimcontrolpanel.h
index ce8fc58e56..0a1fd70c08 100644
--- a/indra/newview/llpanelimcontrolpanel.h
+++ b/indra/newview/llpanelimcontrolpanel.h
@@ -95,6 +95,7 @@ private:
void onShareButtonClicked();
void onTeleportButtonClicked();
void onPayButtonClicked();
+ void onFocusReceived();
LLUUID mAvatarID;
};