From 4a8579462c464bd73d79256435d08ebc4112ccf7 Mon Sep 17 00:00:00 2001 From: Cho Date: Tue, 25 Jun 2013 19:49:13 +0100 Subject: made status update post button disabled for ACME-571 --- indra/newview/llfloatersocial.cpp | 45 +++++++++++++++++----- indra/newview/llfloatersocial.h | 6 +++ .../skins/default/xui/en/floater_social.xml | 4 +- 3 files changed, 43 insertions(+), 12 deletions(-) diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index f2110e09c1..92a291e51c 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -57,21 +57,48 @@ std::string get_map_url() return map_url; } -LLSocialStatusPanel::LLSocialStatusPanel() +LLSocialStatusPanel::LLSocialStatusPanel() : + mMessageTextEditor(NULL), + mPostStatusButton(NULL) { mCommitCallbackRegistrar.add("SocialSharing.SendStatus", boost::bind(&LLSocialStatusPanel::onSend, this)); } +BOOL LLSocialStatusPanel::postBuild() +{ + mMessageTextEditor = getChild("status_message"); + mPostStatusButton = getChild("post_status_btn"); + + return LLPanel::postBuild(); +} + +void LLSocialStatusPanel::draw() +{ + if (mMessageTextEditor && mPostStatusButton) + { + std::string message = mMessageTextEditor->getValue().asString(); + mPostStatusButton->setEnabled(!message.empty()); + } + + LLPanel::draw(); +} + void LLSocialStatusPanel::onSend() { - std::string message = getChild("message")->getValue().asString(); - LLFacebookConnect::instance().updateStatus(message); + if (mMessageTextEditor) + { + std::string message = mMessageTextEditor->getValue().asString(); + if (!message.empty()) + { + LLFacebookConnect::instance().updateStatus(message); - LLFloater* floater = getParentByType(); - if (floater) - { - floater->closeFloater(); - } + LLFloater* floater = getParentByType(); + if (floater) + { + floater->closeFloater(); + } + } + } } LLSocialPhotoPanel::LLSocialPhotoPanel() : @@ -84,8 +111,6 @@ mThumbnailPlaceholder(NULL) mCommitCallbackRegistrar.add("PostToFacebook.Send", boost::bind(&LLSocialPhotoPanel::onSend, this)); } - - LLSocialPhotoPanel::~LLSocialPhotoPanel() { if(mPreviewHandle.get()) diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h index 7b8db2d64a..1e28e3cb7e 100644 --- a/indra/newview/llfloatersocial.h +++ b/indra/newview/llfloatersocial.h @@ -36,7 +36,13 @@ class LLSocialStatusPanel : public LLPanel { public: LLSocialStatusPanel(); + BOOL postBuild(); + void draw(); void onSend(); + +private: + LLUICtrl* mMessageTextEditor; + LLUICtrl* mPostStatusButton; }; class LLSocialPhotoPanel : public LLPanel diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml index 1ae8f7ed65..3b19a2f4cb 100644 --- a/indra/newview/skins/default/xui/en/floater_social.xml +++ b/indra/newview/skins/default/xui/en/floater_social.xml @@ -49,7 +49,7 @@ left="9" length="1" max_length="700" - name="message" + name="status_message" type="string" word_wrap="true"> @@ -57,7 +57,7 @@ follows="left|top" height="23" label="Post" - name="post_btn" + name="post_status_btn" top_pad="18" width="100"> Date: Tue, 25 Jun 2013 12:43:37 -0700 Subject: ACME-580, ACME-572, ACME-591 : Added a toast notification when posting to Facebook successfully --- indra/newview/llfacebookconnect.cpp | 11 ++++++++++- indra/newview/skins/default/xui/en/strings.xml | 3 +++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfacebookconnect.cpp b/indra/newview/llfacebookconnect.cpp index 64fc81cc93..fe4e7fe69e 100644 --- a/indra/newview/llfacebookconnect.cpp +++ b/indra/newview/llfacebookconnect.cpp @@ -36,9 +36,10 @@ #include "llnotificationsutil.h" #include "llurlaction.h" #include "llimagepng.h" +#include "lltrans.h" -// Local function +// Local functions void prompt_user_for_error(U32 status, const std::string& reason, const std::string& code, const std::string& description) { // Note: 302 (redirect) is *not* an error that warrants prompting the user @@ -55,6 +56,13 @@ void prompt_user_for_error(U32 status, const std::string& reason, const std::str } } +void toast_user_for_success() +{ + LLSD args; + args["MESSAGE"] = LLTrans::getString("facebook_post_success"); + LLNotificationsUtil::add("SystemMessage", args); +} + /////////////////////////////////////////////////////////////////////////////// // class LLFacebookConnectHandler : public LLCommandHandler @@ -133,6 +141,7 @@ public: { if (isGoodStatus(status)) { + toast_user_for_success(); LL_DEBUGS("FacebookConnect") << "Post successful. content: " << content << LL_ENDL; } else diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index f7b33b0a4a..4613ae054f 100755 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3421,6 +3421,9 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. Drag items from inventory here + + Posting to Facebook was successful. + (IM Session Doesn't Exist) -- cgit v1.2.3