From ba8bced90b0a3e5126e3274ac4d8a9f611a9ded8 Mon Sep 17 00:00:00 2001 From: Gilbert Gonzales Date: Fri, 21 Jun 2013 12:45:20 -0700 Subject: ACME-588 Make 'Post' button post to facebook: Intial commit is just adding callback for clicking the post button --- indra/newview/llfloatersocial.cpp | 37 ++++++++++++++++++++++ indra/newview/llfloatersocial.h | 7 ++++ .../skins/default/xui/en/floater_social.xml | 3 +- 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index fe9cfa592b..0f3a82878b 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -29,7 +29,44 @@ #include "llfloatersocial.h" +#include "llagentui.h" +#include "llfloaterreg.h" +#include "llslurl.h" + +static LLRegisterPanelClassWrapper panel_class("llsocialphotopanel"); + +LLSocialPhotoPanel::LLSocialPhotoPanel() +{ + mCommitCallbackRegistrar.add("PostToFacebook.Send", boost::bind(&LLSocialPhotoPanel::onSend, this)); +} + +void LLSocialPhotoPanel::onSend() +{ + std::string caption = getChild("caption")->getValue().asString(); + bool add_location = getChild("add_location_cb")->getValue().asBoolean(); + + if (add_location) + { + LLSLURL slurl; + LLAgentUI::buildSLURL(slurl); + if (caption.empty()) + caption = slurl.getSLURLString(); + else + caption = caption + " " + slurl.getSLURLString(); + } + //LLFacebookConnect::instance().sharePhoto(LLFloaterSnapshot::getImageData(), caption); + //LLWebProfile::uploadImage(LLFloaterSnapshot::getImageData(), caption, add_location, boost::bind(&LLPanelSnapshotFacebook::onImageUploaded, this, caption, _1)); + //LLFloaterSnapshot::postSave(); +} + + + LLFloaterSocial::LLFloaterSocial(const LLSD& key) : LLFloater(key) { } + +BOOL LLFloaterSocial::postBuild() +{ + return LLFloater::postBuild(); +} diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h index b120fe5804..e946ce7559 100644 --- a/indra/newview/llfloatersocial.h +++ b/indra/newview/llfloatersocial.h @@ -29,11 +29,18 @@ #include "llfloater.h" +class LLSocialPhotoPanel : public LLPanel +{ + public: + LLSocialPhotoPanel(); + void onSend(); +}; class LLFloaterSocial : public LLFloater { public: LLFloaterSocial(const LLSD& key); + BOOL postBuild(); }; #endif // LL_LLFLOATERSOCIAL_H diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml index d446e0c0f6..8141961273 100644 --- a/indra/newview/skins/default/xui/en/floater_social.xml +++ b/indra/newview/skins/default/xui/en/floater_social.xml @@ -31,6 +31,7 @@ help_topic="social_status_tab" name="status_panel"/> + name="social_photo_tab">