From c3c61018cd2d6547c4976c04edc4d3212cf3fb31 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 19 Jul 2013 16:36:55 -0700 Subject: ACME-732 Create the viewer side info route responder --- indra/newview/llfloatersocial.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfloatersocial.cpp') diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index e61d86c474..d734518cbb 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -650,6 +650,11 @@ void LLSocialAccountPanel::onVisibilityChange(const LLSD& new_visibility) LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialAccountPanel"); LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialAccountPanel", boost::bind(&LLSocialAccountPanel::onFacebookConnectStateChange, this, _1)); + LLFacebookConnect::instance().loadFacebookInfo(); + + LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLSocialAccountPanel"); + LLEventPumps::instance().obtain("FacebookConnectInfo").listen("LLSocialAccountPanel", boost::bind(&LLSocialAccountPanel::onFacebookConnectInfoChange, this)); + if(LLFacebookConnect::instance().isConnected()) { showConnectedLayout(); @@ -663,6 +668,7 @@ void LLSocialAccountPanel::onVisibilityChange(const LLSD& new_visibility) else { LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialAccountPanel"); + LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLSocialAccountPanel"); } } @@ -687,6 +693,21 @@ bool LLSocialAccountPanel::onFacebookConnectStateChange(const LLSD& data) return false; } +bool LLSocialAccountPanel::onFacebookConnectInfoChange() +{ + LLSD info = LLFacebookConnect::instance().getInfo(); + std::string clickable_name; + + if(info.has("link") && info.has("name")) + { + clickable_name = "[" + info["link"].asString() + " " + info["name"].asString() + "]"; + } + + mAccountNameLabel->setText(clickable_name); + + return false; +} + void LLSocialAccountPanel::showConnectButton() { if(!mConnectButton->getVisible()) @@ -726,8 +747,9 @@ void LLSocialAccountPanel::showDisconnectedLayout() void LLSocialAccountPanel::showConnectedLayout() { + LLFacebookConnect::instance().loadFacebookInfo(); + mAccountCaptionLabel->setText(getString("facebook_connected")); - mAccountNameLabel->setText(std::string("[secondlife:/// Philippe Bossut]")); hideConnectButton(); } -- cgit v1.2.3