ACME-677 Make the 'Connect...', 'Disconnect' and 'Use another account...' buttons disabled upon clicking
parent
fdb8c2fcdb
commit
66522bb6bd
|
|
@ -181,7 +181,12 @@ class LLFacebookDisconnectResponder : public LLHTTPClient::Responder
|
|||
{
|
||||
LOG_CLASS(LLFacebookDisconnectResponder);
|
||||
public:
|
||||
|
||||
|
||||
LLFacebookDisconnectResponder()
|
||||
{
|
||||
LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_DISCONNECTING);
|
||||
}
|
||||
|
||||
virtual void completed(U32 status, const std::string& reason, const LLSD& content)
|
||||
{
|
||||
if (isGoodStatus(status))
|
||||
|
|
@ -252,6 +257,11 @@ class LLFacebookDisconnectThenConnectResponder : public LLHTTPClient::Responder
|
|||
LOG_CLASS(LLFacebookDisconnectThenConnectResponder);
|
||||
public:
|
||||
|
||||
LLFacebookDisconnectThenConnectResponder()
|
||||
{
|
||||
LLFacebookConnect::instance().setConnectionState(LLFacebookConnect::FB_DISCONNECTING);
|
||||
}
|
||||
|
||||
virtual void completed(U32 status, const std::string& reason, const LLSD& content)
|
||||
{
|
||||
if (isGoodStatus(status))
|
||||
|
|
|
|||
|
|
@ -51,7 +51,8 @@ public:
|
|||
FB_CONNECTION_FAILED = 3,
|
||||
FB_POSTING = 4,
|
||||
FB_POSTED = 5,
|
||||
FB_POST_FAILED = 6
|
||||
FB_POST_FAILED = 6,
|
||||
FB_DISCONNECTING = 7
|
||||
};
|
||||
|
||||
void connectToFacebook(const std::string& auth_code = "", const std::string& auth_state = ""); // Initiate the complete FB connection. Please use checkConnectionToFacebook() in normal use.
|
||||
|
|
@ -73,7 +74,7 @@ public:
|
|||
const LLSD& getContent() const;
|
||||
|
||||
void setConnectionState(EConnectionState connection_state);
|
||||
bool isConnected() { return ((mConnectionState == FB_CONNECTED) || (mConnectionState == FB_POSTING) || (mConnectionState == FB_POSTED)); }
|
||||
bool isConnected() { return ((mConnectionState == FB_CONNECTED) || (mConnectionState == FB_DISCONNECTING) || (mConnectionState == FB_POSTING) || (mConnectionState == FB_POSTED)); }
|
||||
bool isTransactionOngoing() { return ((mConnectionState == FB_CONNECTION_IN_PROGRESS) || (mConnectionState == FB_POSTING)); }
|
||||
EConnectionState getConnectionState() { return mConnectionState; }
|
||||
S32 generation() { return mGeneration; }
|
||||
|
|
|
|||
|
|
@ -641,6 +641,22 @@ BOOL LLSocialAccountPanel::postBuild()
|
|||
return LLPanel::postBuild();
|
||||
}
|
||||
|
||||
void LLSocialAccountPanel::draw()
|
||||
{
|
||||
LLFacebookConnect::EConnectionState connection_state = LLFacebookConnect::instance().getConnectionState();
|
||||
|
||||
//Disable the 'disconnect' button and the 'use another account' button when disconnecting in progress
|
||||
bool disconnecting = connection_state == LLFacebookConnect::FB_DISCONNECTING;
|
||||
mDisconnectButton->setEnabled(!disconnecting);
|
||||
mUseAnotherAccountButton->setEnabled(!disconnecting);
|
||||
|
||||
//Disable the 'connect' button when a connection is in progress
|
||||
bool connecting = connection_state == LLFacebookConnect::FB_CONNECTION_IN_PROGRESS;
|
||||
mConnectButton->setEnabled(!connecting);
|
||||
|
||||
LLPanel::draw();
|
||||
}
|
||||
|
||||
void LLSocialAccountPanel::onVisibilityChange(const LLSD& new_visibility)
|
||||
{
|
||||
bool visible = new_visibility.asBoolean();
|
||||
|
|
@ -862,6 +878,13 @@ void LLFloaterSocial::draw()
|
|||
status_text = LLTrans::getString("SocialFacebookErrorPosting");
|
||||
mStatusErrorText->setValue(status_text);
|
||||
break;
|
||||
case LLFacebookConnect::FB_DISCONNECTING:
|
||||
// Disconnecting loading indicator
|
||||
mStatusLoadingText->setVisible(true);
|
||||
status_text = LLTrans::getString("SocialFacebookDisconnecting");
|
||||
mStatusLoadingText->setValue(status_text);
|
||||
mStatusLoadingIndicator->setVisible(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
LLFloater::draw();
|
||||
|
|
|
|||
|
|
@ -120,6 +120,7 @@ class LLSocialAccountPanel : public LLPanel
|
|||
public:
|
||||
LLSocialAccountPanel();
|
||||
BOOL postBuild();
|
||||
void draw();
|
||||
|
||||
private:
|
||||
void onVisibilityChange(const LLSD& new_visibility);
|
||||
|
|
|
|||
|
|
@ -153,6 +153,7 @@ Please try logging in again in a minute.</string>
|
|||
<string name="SocialFacebookPosting">Posting...</string>
|
||||
<string name="SocialFacebookErrorConnecting">Problem connecting to Facebook</string>
|
||||
<string name="SocialFacebookErrorPosting">Problem posting to Facebook</string>
|
||||
<string name="SocialFacebookDisconnecting">Disconnecting from Facebook...</string>
|
||||
|
||||
<!-- Tooltip -->
|
||||
<string name="TooltipPerson">Person</string><!-- Object under mouse pointer is an avatar -->
|
||||
|
|
|
|||
Loading…
Reference in New Issue