summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatersocial.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llfloatersocial.cpp')
-rw-r--r--indra/newview/llfloatersocial.cpp30
1 files changed, 18 insertions, 12 deletions
diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index d64e4273f4..e61d86c474 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -652,15 +652,11 @@ void LLSocialAccountPanel::onVisibilityChange(const LLSD& new_visibility)
if(LLFacebookConnect::instance().isConnected())
{
- hideConnectButton();
- mAccountCaptionLabel->setText(getString("facebook_connected"));
- mAccountNameLabel->setText(std::string("[secondlife:/// Philippe Bossut]"));
-
+ showConnectedLayout();
}
else
{
- mAccountCaptionLabel->setText(getString("facebook_disconnected"));
- mAccountNameLabel->setText(std::string(""));
+ showDisconnectedLayout();
LLFacebookConnect::instance().checkConnectionToFacebook();
}
}
@@ -679,16 +675,12 @@ bool LLSocialAccountPanel::onFacebookConnectStateChange(const LLSD& data)
case LLFacebookConnect::FB_POSTING:
case LLFacebookConnect::FB_POSTED:
case LLFacebookConnect::FB_POST_FAILED:
- mAccountCaptionLabel->setText(getString("facebook_connected"));
- mAccountNameLabel->setText(std::string("[secondlife:/// Philippe Bossut]"));
- hideConnectButton();
+ showConnectedLayout();
break;
case LLFacebookConnect::FB_NOT_CONNECTED:
case LLFacebookConnect::FB_CONNECTION_IN_PROGRESS:
case LLFacebookConnect::FB_CONNECTION_FAILED:
- mAccountCaptionLabel->setText(getString("facebook_disconnected"));
- mAccountNameLabel->setText(std::string(""));
- showConnectButton();
+ showDisconnectedLayout();
break;
}
@@ -725,6 +717,20 @@ void LLSocialAccountPanel::hideConnectButton()
}
}
+void LLSocialAccountPanel::showDisconnectedLayout()
+{
+ mAccountCaptionLabel->setText(getString("facebook_disconnected"));
+ mAccountNameLabel->setText(std::string(""));
+ showConnectButton();
+}
+
+void LLSocialAccountPanel::showConnectedLayout()
+{
+ mAccountCaptionLabel->setText(getString("facebook_connected"));
+ mAccountNameLabel->setText(std::string("[secondlife:/// Philippe Bossut]"));
+ hideConnectButton();
+}
+
void LLSocialAccountPanel::onConnect()
{
LLFacebookConnect::instance().checkConnectionToFacebook(true);