From 8c4a39b2025ef64f6218dc112e37f71c65aac446 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 2 Jul 2013 18:34:17 -0700 Subject: ACME-626 : Implement status and progress update text --- indra/newview/llfacebookconnect.h | 1 + indra/newview/llfloatersocial.cpp | 36 +++++++++++++++++++++- indra/newview/llfloatersocial.h | 7 ++++- .../skins/default/xui/en/floater_social.xml | 19 ++++++++++-- 4 files changed, 59 insertions(+), 4 deletions(-) diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index abd6fb385d..1044c05e45 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -73,6 +73,7 @@ public: const LLSD& getContent() const; void setConnectionState(EConnectionState connection_state) { mConnectionState = connection_state; } + EConnectionState getConnectionState() { return mConnectionState; } bool isConnected() { return (mConnectionState == FB_CONNECTED); } S32 generation() { return mGeneration; } diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index 4660644969..ddbaa2d704 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -524,7 +524,10 @@ void LLSocialCheckinPanel::onSend() //////////////////////// LLFloaterSocial::LLFloaterSocial(const LLSD& key) : LLFloater(key), - mSocialPhotoPanel(NULL) + mSocialPhotoPanel(NULL), + mStatusErrorText(NULL), + mStatusLoadingText(NULL), + mStatusLoadingIndicator(NULL) { mCommitCallbackRegistrar.add("SocialSharing.Cancel", boost::bind(&LLFloaterSocial::onCancel, this)); } @@ -540,6 +543,10 @@ BOOL LLFloaterSocial::postBuild() LLFacebookConnect::instance().getConnectionToFacebook(true); // Keep tab of the Photo Panel mSocialPhotoPanel = static_cast(getChild("panel_social_photo")); + // Connection status widgets + mStatusErrorText = getChild("connection_error_text"); + mStatusLoadingText = getChild("connection_loading_text"); + mStatusLoadingIndicator = getChild("connection_loading_indicator"); return LLFloater::postBuild(); } @@ -580,3 +587,30 @@ void LLFloaterSocial::postUpdate() } } + +void LLFloaterSocial::draw() +{ + if (mStatusErrorText && mStatusLoadingText && mStatusLoadingIndicator) + { + mStatusErrorText->setVisible(false); + mStatusLoadingText->setVisible(false); + mStatusLoadingIndicator->setVisible(false); + LLFacebookConnect::EConnectionState connection_state = LLFacebookConnect::instance().getConnectionState(); + switch (connection_state) + { + case LLFacebookConnect::FB_NOT_CONNECTED: + break; + case LLFacebookConnect::FB_CONNECTION_IN_PROGRESS: + mStatusLoadingText->setVisible(true); + mStatusLoadingIndicator->setVisible(true); + break; + case LLFacebookConnect::FB_CONNECTED: + break; + case LLFacebookConnect::FB_CONNECTION_FAILED: + mStatusErrorText->setVisible(true); + break; + } + } + LLFloater::draw(); +} + diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h index 89b9e2016a..f90deb9f85 100644 --- a/indra/newview/llfloatersocial.h +++ b/indra/newview/llfloatersocial.h @@ -28,6 +28,7 @@ #define LL_LLFLOATERSOCIAL_H #include "llfloater.h" +#include "lltextbox.h" #include "llviewertexture.h" class LLIconCtrl; @@ -109,13 +110,17 @@ class LLFloaterSocial : public LLFloater public: LLFloaterSocial(const LLSD& key); BOOL postBuild(); + void draw(); void onCancel(); static void preUpdate(); static void postUpdate(); private: - LLSocialPhotoPanel * mSocialPhotoPanel; + LLSocialPhotoPanel* mSocialPhotoPanel; + LLTextBox* mStatusErrorText; + LLTextBox* mStatusLoadingText; + LLUICtrl* mStatusLoadingIndicator; }; #endif // LL_LLFLOATERSOCIAL_H diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml index c571497769..61210135ee 100644 --- a/indra/newview/skins/default/xui/en/floater_social.xml +++ b/indra/newview/skins/default/xui/en/floater_social.xml @@ -57,6 +57,21 @@ name="connection_status_panel" follows="left|top" height="26"> + + Problem Connecting to Facebook + - Test text + Connecting to Facebook... -- cgit v1.2.3