From e6ac587f372559c4c84f8b1e4bc5ab94d9a665c3 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 8 Jul 2013 17:12:31 -0700 Subject: ACME-651 : Use localizable strings and simplify the xml for status and error fields --- indra/newview/llfloatersocial.cpp | 33 +++++++++++---------- indra/newview/llfloatersocial.h | 2 -- .../skins/default/xui/en/floater_social.xml | 34 ++-------------------- indra/newview/skins/default/xui/en/strings.xml | 6 ++++ 4 files changed, 26 insertions(+), 49 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index 1d47213a3a..b90cc004d3 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -40,6 +40,7 @@ #include "llsdserialize.h" #include "llloadingindicator.h" #include "llslurl.h" +#include "lltrans.h" #include "llsnapshotlivepreview.h" #include "llviewerregion.h" #include "llviewercontrol.h" @@ -591,9 +592,7 @@ void LLSocialCheckinPanel::clearAndClose() LLFloaterSocial::LLFloaterSocial(const LLSD& key) : LLFloater(key), mSocialPhotoPanel(NULL), mStatusErrorText(NULL), - mStatusPostingErrorText(NULL), mStatusLoadingText(NULL), - mStatusPostingText(NULL), mStatusLoadingIndicator(NULL) { mCommitCallbackRegistrar.add("SocialSharing.Cancel", boost::bind(&LLFloaterSocial::onCancel, this)); @@ -610,9 +609,7 @@ BOOL LLFloaterSocial::postBuild() mSocialPhotoPanel = static_cast(getChild("panel_social_photo")); // Connection status widgets mStatusErrorText = getChild("connection_error_text"); - mStatusPostingErrorText = getChild("connection_error_posting_text"); mStatusLoadingText = getChild("connection_loading_text"); - mStatusPostingText = getChild("connection_posting_text"); mStatusLoadingIndicator = getChild("connection_loading_indicator"); return LLFloater::postBuild(); } @@ -651,42 +648,48 @@ void LLFloaterSocial::postUpdate() void LLFloaterSocial::draw() { - if (mStatusErrorText && mStatusPostingErrorText && mStatusLoadingText && mStatusPostingText && mStatusLoadingIndicator) + if (mStatusErrorText && mStatusLoadingText && mStatusLoadingIndicator) { mStatusErrorText->setVisible(false); - mStatusPostingErrorText->setVisible(false); mStatusLoadingText->setVisible(false); - mStatusPostingText->setVisible(false); mStatusLoadingIndicator->setVisible(false); LLFacebookConnect::EConnectionState connection_state = LLFacebookConnect::instance().getConnectionState(); + std::string status_text; + switch (connection_state) { case LLFacebookConnect::FB_NOT_CONNECTED: // No status displayed when first opening the panel and no connection done + case LLFacebookConnect::FB_CONNECTED: + // When successfully connected, no message is displayed + case LLFacebookConnect::FB_POSTED: + // No success message to show since we actually close the floater after successful posting completion break; case LLFacebookConnect::FB_CONNECTION_IN_PROGRESS: // Connection loading indicator mStatusLoadingText->setVisible(true); + status_text = LLTrans::getString("SocialFacebookConnecting"); + mStatusLoadingText->setValue(status_text); mStatusLoadingIndicator->setVisible(true); break; case LLFacebookConnect::FB_POSTING: // Posting indicator - mStatusPostingText->setVisible(true); + mStatusLoadingText->setVisible(true); + status_text = LLTrans::getString("SocialFacebookPosting"); + mStatusLoadingText->setValue(status_text); mStatusLoadingIndicator->setVisible(true); - break; - case LLFacebookConnect::FB_CONNECTED: - // When successfully connected, no message is displayed break; - case LLFacebookConnect::FB_POSTED: - // No success message to show since we actually close the floater after successful posting completion - break; case LLFacebookConnect::FB_CONNECTION_FAILED: // Error connecting to the service mStatusErrorText->setVisible(true); + status_text = LLTrans::getString("SocialFacebookErrorConnecting"); + mStatusErrorText->setValue(status_text); break; case LLFacebookConnect::FB_POST_FAILED: // Error posting to the service - mStatusPostingErrorText->setVisible(true); + mStatusErrorText->setVisible(true); + status_text = LLTrans::getString("SocialFacebookErrorPosting"); + mStatusErrorText->setValue(status_text); break; } } diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h index 76f7d080cc..0fc5ea520a 100644 --- a/indra/newview/llfloatersocial.h +++ b/indra/newview/llfloatersocial.h @@ -125,9 +125,7 @@ public: private: LLSocialPhotoPanel* mSocialPhotoPanel; LLTextBox* mStatusErrorText; - LLTextBox* mStatusPostingErrorText; LLTextBox* mStatusLoadingText; - LLTextBox* mStatusPostingText; LLUICtrl* mStatusLoadingIndicator; }; diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml index 52840c5435..781c48729c 100644 --- a/indra/newview/skins/default/xui/en/floater_social.xml +++ b/indra/newview/skins/default/xui/en/floater_social.xml @@ -67,22 +67,7 @@ valign="center" text_color="DrYellow" font="SansSerif"> - Problem connecting to Facebook - - - Problem posting to Facebook + Error - Connecting to Facebook... - - - Posting... + Loading... diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 0f3f4619f6..5067922b88 100755 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -148,6 +148,12 @@ Please try logging in again in a minute. You were sent to an invalid region. Testing viewer disconnect + + Connecting to Facebook... + Posting... + Problem connecting to Facebook + Problem posting to Facebook + Person (no name) -- cgit v1.2.3