summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatersocial.cpp
diff options
context:
space:
mode:
authorGilbert Gonzales <gilbert@lindenlab.com>2013-06-25 13:44:36 -0700
committerGilbert Gonzales <gilbert@lindenlab.com>2013-06-25 13:44:36 -0700
commit7b79b455d0b3b60669bbe8978732fe7db62d678b (patch)
treea5bb7b00a63572ae2162a313c7b6f3ca36d8f2d5 /indra/newview/llfloatersocial.cpp
parentd63dd9d442a2c30b26163cdaf475ed31070aa92b (diff)
parentfa48ae87415d7e5d5bf7549af30832a14d6a7de2 (diff)
merge
Diffstat (limited to 'indra/newview/llfloatersocial.cpp')
-rw-r--r--indra/newview/llfloatersocial.cpp45
1 files changed, 35 insertions, 10 deletions
diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 52a4e090f3..23e3d35c22 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<LLUICtrl>("status_message");
+ mPostStatusButton = getChild<LLUICtrl>("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<LLUICtrl>("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<LLFloater>();
- if (floater)
- {
- floater->closeFloater();
- }
+ LLFloater* floater = getParentByType<LLFloater>();
+ 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())