diff options
-rw-r--r-- | indra/newview/llfacebookconnect.h | 1 | ||||
-rw-r--r-- | indra/newview/llfloatersocial.cpp | 38 | ||||
-rw-r--r-- | indra/newview/llfloatersocial.h | 7 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_social.xml | 44 |
4 files changed, 87 insertions, 3 deletions
diff --git a/indra/newview/llfacebookconnect.h b/indra/newview/llfacebookconnect.h index 7d6bca5a25..ddff87385e 100644 --- a/indra/newview/llfacebookconnect.h +++ b/indra/newview/llfacebookconnect.h @@ -77,6 +77,7 @@ public: void setConnectionState(EConnectionState connection_state); bool isConnected() { return ((mConnectionState == FB_CONNECTED) || (mConnectionState == FB_POSTING)); } + EConnectionState getConnectionState() { return mConnectionState; } S32 generation() { return mGeneration; } void openFacebookWeb(std::string url); diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index 061bcf246d..684b177f24 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -586,7 +586,10 @@ bool LLSocialCheckinPanel::onConnectedToFacebook(const LLSD& data, const std::st //////////////////////// 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)); } @@ -600,6 +603,10 @@ BOOL LLFloaterSocial::postBuild() { // Keep tab of the Photo Panel mSocialPhotoPanel = static_cast<LLSocialPhotoPanel*>(getChild<LLUICtrl>("panel_social_photo")); + // Connection status widgets + mStatusErrorText = getChild<LLTextBox>("connection_error_text"); + mStatusLoadingText = getChild<LLTextBox>("connection_loading_text"); + mStatusLoadingIndicator = getChild<LLUICtrl>("connection_loading_indicator"); return LLFloater::postBuild(); } @@ -640,3 +647,32 @@ 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: + case LLFacebookConnect::FB_POSTING: + mStatusLoadingText->setVisible(true); + mStatusLoadingIndicator->setVisible(true); + break; + case LLFacebookConnect::FB_CONNECTED: + break; + case LLFacebookConnect::FB_CONNECTION_FAILED: + case LLFacebookConnect::FB_POST_FAILED: + mStatusErrorText->setVisible(true); + break; + } + } + LLFloater::draw(); +} + diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h index 4970f95e89..07236c2838 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; @@ -111,13 +112,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 27c01eec4d..61210135ee 100644 --- a/indra/newview/skins/default/xui/en/floater_social.xml +++ b/indra/newview/skins/default/xui/en/floater_social.xml @@ -20,7 +20,7 @@ tab_height="30" tab_position="top" top="7" - height="430" + height="395" halign="center"> <panel filename="panel_social_status.xml" @@ -53,4 +53,46 @@ help_topic="panel_social_place" name="panel_social_place"/> </tab_container> + <panel + name="connection_status_panel" + follows="left|top" + height="26"> + <text + name="connection_error_text" + type="string" + follows="left|top" + top="3" + left="12" + width="250" + height="20" + wrap="true" + halign="left" + valign="center" + text_color="Yellow" + font="SansSerif"> + Problem Connecting to Facebook + </text> + <loading_indicator + follows="left|top" + height="24" + width="24" + name="connection_loading_indicator" + top="0" + left="9" + visible="true"/> + <text + name="connection_loading_text" + type="string" + follows="left|top" + top="3" + left_pad="5" + width="250" + height="20" + wrap="true" + halign="left" + valign="center" + font="SansSerif"> + Connecting to Facebook... + </text> + </panel> </floater> |