diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfloatersocial.cpp | 30 | ||||
-rw-r--r-- | indra/newview/llfloatersocial.h | 2 |
2 files changed, 20 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); diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h index 48245e34ea..e49445a39f 100644 --- a/indra/newview/llfloatersocial.h +++ b/indra/newview/llfloatersocial.h @@ -130,6 +130,8 @@ private: void showConnectButton(); void hideConnectButton(); + void showDisconnectedLayout(); + void showConnectedLayout(); LLTextBox * mAccountCaptionLabel; LLTextBox * mAccountNameLabel; |