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 ++++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 10 deletions(-) (limited to 'indra/newview/llfloatersocial.cpp') 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()) -- cgit v1.2.3