diff options
-rw-r--r-- | indra/newview/llfloatersocial.cpp | 45 | ||||
-rw-r--r-- | indra/newview/llfloatersocial.h | 6 | ||||
-rw-r--r-- | indra/newview/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<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()) 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 f8ab2000cf..76c15b9624 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"> </text_editor> @@ -57,7 +57,7 @@ follows="left|top" height="23" label="Post" - name="post_btn" + name="post_status_btn" top_pad="18" width="100"> <button.commit_callback |