From 9108354e9d39d93dadbad34ff5ba7ecb7abc7bf9 Mon Sep 17 00:00:00 2001 From: Cho Date: Thu, 5 Dec 2013 00:28:28 +0000 Subject: Renamed floater_social to floater_facebook for ACME-1205 --- indra/newview/CMakeLists.txt | 4 +- indra/newview/app_settings/commands.xml | 12 +- indra/newview/app_settings/settings.xml | 2 +- indra/newview/app_settings/toolbars.xml | 2 +- indra/newview/llfloaterfacebook.cpp | 939 +++++++++++++++++++++ indra/newview/llfloaterfacebook.h | 167 ++++ indra/newview/llfloaterflickr.cpp | 14 +- indra/newview/llfloaterflickr.h | 2 +- indra/newview/llfloatersnapshot.cpp | 6 +- indra/newview/llfloatersocial.cpp | 939 --------------------- indra/newview/llfloatersocial.h | 167 ---- indra/newview/llfloatertwitter.cpp | 14 +- indra/newview/llfloatertwitter.h | 2 +- indra/newview/llpanelsnapshotoptions.cpp | 10 +- indra/newview/llsnapshotlivepreview.cpp | 6 +- indra/newview/llviewerfloaterreg.cpp | 10 +- indra/newview/skins/default/textures/textures.xml | 6 +- .../skins/default/xui/en/floater_facebook.xml | 101 +++ .../skins/default/xui/en/floater_social.xml | 101 --- indra/newview/skins/default/xui/en/menu_viewer.xml | 2 +- .../default/xui/en/panel_facebook_account.xml | 75 ++ .../skins/default/xui/en/panel_facebook_photo.xml | 152 ++++ .../skins/default/xui/en/panel_facebook_place.xml | 132 +++ .../skins/default/xui/en/panel_facebook_status.xml | 67 ++ .../skins/default/xui/en/panel_social_account.xml | 75 -- .../skins/default/xui/en/panel_social_photo.xml | 152 ---- .../skins/default/xui/en/panel_social_place.xml | 132 --- .../skins/default/xui/en/panel_social_status.xml | 67 -- indra/newview/skins/default/xui/en/strings.xml | 12 +- 29 files changed, 1686 insertions(+), 1684 deletions(-) create mode 100644 indra/newview/llfloaterfacebook.cpp create mode 100644 indra/newview/llfloaterfacebook.h delete mode 100644 indra/newview/llfloatersocial.cpp delete mode 100644 indra/newview/llfloatersocial.h create mode 100644 indra/newview/skins/default/xui/en/floater_facebook.xml delete mode 100644 indra/newview/skins/default/xui/en/floater_social.xml create mode 100644 indra/newview/skins/default/xui/en/panel_facebook_account.xml create mode 100644 indra/newview/skins/default/xui/en/panel_facebook_photo.xml create mode 100644 indra/newview/skins/default/xui/en/panel_facebook_place.xml create mode 100644 indra/newview/skins/default/xui/en/panel_facebook_status.xml delete mode 100644 indra/newview/skins/default/xui/en/panel_social_account.xml delete mode 100644 indra/newview/skins/default/xui/en/panel_social_photo.xml delete mode 100644 indra/newview/skins/default/xui/en/panel_social_place.xml delete mode 100644 indra/newview/skins/default/xui/en/panel_social_status.xml diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 746991a6f0..b937d53bd8 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -229,6 +229,7 @@ set(viewer_SOURCE_FILES llfloatereditwater.cpp llfloaterenvironmentsettings.cpp llfloaterevent.cpp + llfloaterfacebook.cpp llfloaterflickr.cpp llfloaterfonttest.cpp llfloatergesture.cpp @@ -276,7 +277,6 @@ set(viewer_SOURCE_FILES llfloatersettingsdebug.cpp llfloatersidepanelcontainer.cpp llfloatersnapshot.cpp - llfloatersocial.cpp llfloatersounddevices.cpp llfloaterspellchecksettings.cpp llfloatertelehub.cpp @@ -821,6 +821,7 @@ set(viewer_HEADER_FILES llfloatereditwater.h llfloaterenvironmentsettings.h llfloaterevent.h + llfloaterfacebook.h llfloaterflickr.h llfloaterfonttest.h llfloatergesture.h @@ -868,7 +869,6 @@ set(viewer_HEADER_FILES llfloatersettingsdebug.h llfloatersidepanelcontainer.h llfloatersnapshot.h - llfloatersocial.h llfloatersounddevices.h llfloaterspellchecksettings.h llfloatertelehub.h diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index f4e9cc0136..7b329e2092 100755 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -216,15 +216,15 @@ is_running_function="Floater.IsOpen" is_running_parameters="snapshot" /> - SocialPhotoResolution Comment - Default resolution when sharing photo using the social floater + Default resolution when sharing photo using the social floaters Persist 1 Type diff --git a/indra/newview/app_settings/toolbars.xml b/indra/newview/app_settings/toolbars.xml index c65b79affb..d61aee9a14 100755 --- a/indra/newview/app_settings/toolbars.xml +++ b/indra/newview/app_settings/toolbars.xml @@ -21,6 +21,6 @@ - + diff --git a/indra/newview/llfloaterfacebook.cpp b/indra/newview/llfloaterfacebook.cpp new file mode 100644 index 0000000000..6488e7ea00 --- /dev/null +++ b/indra/newview/llfloaterfacebook.cpp @@ -0,0 +1,939 @@ +/** +* @file llfloaterfacebook.cpp +* @brief Implementation of llfloaterfacebook +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + +#include "llviewerprecompiledheaders.h" + +#include "llfloaterfacebook.h" + +#include "llagent.h" +#include "llagentui.h" +#include "llcheckboxctrl.h" +#include "llcombobox.h" +#include "llfacebookconnect.h" +#include "llfloaterreg.h" +#include "lliconctrl.h" +#include "llresmgr.h" // LLLocale +#include "llsdserialize.h" +#include "llloadingindicator.h" +#include "llplugincookiestore.h" +#include "llslurl.h" +#include "lltrans.h" +#include "llsnapshotlivepreview.h" +#include "llviewerregion.h" +#include "llviewercontrol.h" +#include "llviewermedia.h" +#include "lltabcontainer.h" + +static LLRegisterPanelClassWrapper t_panel_status("llfacebookstatuspanel"); +static LLRegisterPanelClassWrapper t_panel_photo("llfacebookphotopanel"); +static LLRegisterPanelClassWrapper t_panel_checkin("llfacebookcheckinpanel"); +static LLRegisterPanelClassWrapper t_panel_account("llfacebookaccountpanel"); + +const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte +const std::string DEFAULT_CHECKIN_LOCATION_URL = "http://maps.secondlife.com/"; +const std::string DEFAULT_CHECKIN_ICON_URL = "http://map.secondlife.com.s3.amazonaws.com/map_placeholder.png"; +const std::string DEFAULT_CHECKIN_QUERY_PARAMETERS = "?sourceid=slshare_checkin&utm_source=facebook&utm_medium=checkin&utm_campaign=slshare"; +const std::string DEFAULT_PHOTO_QUERY_PARAMETERS = "?sourceid=slshare_photo&utm_source=facebook&utm_medium=photo&utm_campaign=slshare"; + +std::string get_map_url() +{ + LLVector3d center_agent; + LLViewerRegion *regionp = gAgent.getRegion(); + if (regionp) + { + center_agent = regionp->getCenterGlobal(); + } + int x_pos = center_agent[0] / 256.0; + int y_pos = center_agent[1] / 256.0; + std::string map_url = gSavedSettings.getString("CurrentMapServerURL") + llformat("map-1-%d-%d-objects.jpg", x_pos, y_pos); + return map_url; +} + +/////////////////////////// +//LLFacebookStatusPanel////// +/////////////////////////// + +LLFacebookStatusPanel::LLFacebookStatusPanel() : + mMessageTextEditor(NULL), + mPostButton(NULL), + mCancelButton(NULL) +{ + mCommitCallbackRegistrar.add("SocialSharing.SendStatus", boost::bind(&LLFacebookStatusPanel::onSend, this)); +} + +BOOL LLFacebookStatusPanel::postBuild() +{ + mMessageTextEditor = getChild("status_message"); + mPostButton = getChild("post_status_btn"); + mCancelButton = getChild("cancel_status_btn"); + + return LLPanel::postBuild(); +} + +void LLFacebookStatusPanel::draw() +{ + if (mMessageTextEditor && mPostButton && mCancelButton) + { + bool no_ongoing_connection = !(LLFacebookConnect::instance().isTransactionOngoing()); + std::string message = mMessageTextEditor->getValue().asString(); + mMessageTextEditor->setEnabled(no_ongoing_connection); + mCancelButton->setEnabled(no_ongoing_connection); + mPostButton->setEnabled(no_ongoing_connection && !message.empty()); + } + + LLPanel::draw(); +} + +void LLFacebookStatusPanel::onSend() +{ + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookStatusPanel"); // just in case it is already listening + LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookStatusPanel", boost::bind(&LLFacebookStatusPanel::onFacebookConnectStateChange, this, _1)); + + // Connect to Facebook if necessary and then post + if (LLFacebookConnect::instance().isConnected()) + { + sendStatus(); + } + else + { + LLFacebookConnect::instance().checkConnectionToFacebook(true); + } +} + +bool LLFacebookStatusPanel::onFacebookConnectStateChange(const LLSD& data) +{ + switch (data.get("enum").asInteger()) + { + case LLFacebookConnect::FB_CONNECTED: + sendStatus(); + break; + + case LLFacebookConnect::FB_POSTED: + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookStatusPanel"); + clearAndClose(); + break; + } + + return false; +} + +void LLFacebookStatusPanel::sendStatus() +{ + std::string message = mMessageTextEditor->getValue().asString(); + if (!message.empty()) + { + LLFacebookConnect::instance().updateStatus(message); + } +} + +void LLFacebookStatusPanel::clearAndClose() +{ + mMessageTextEditor->setValue(""); + + LLFloater* floater = getParentByType(); + if (floater) + { + floater->closeFloater(); + } +} + +/////////////////////////// +//LLFacebookPhotoPanel/////// +/////////////////////////// + +LLFacebookPhotoPanel::LLFacebookPhotoPanel() : +mSnapshotPanel(NULL), +mResolutionComboBox(NULL), +mRefreshBtn(NULL), +mWorkingLabel(NULL), +mThumbnailPlaceholder(NULL), +mCaptionTextBox(NULL), +mLocationCheckbox(NULL), +mPostButton(NULL) +{ + mCommitCallbackRegistrar.add("SocialSharing.SendPhoto", boost::bind(&LLFacebookPhotoPanel::onSend, this)); + mCommitCallbackRegistrar.add("SocialSharing.RefreshPhoto", boost::bind(&LLFacebookPhotoPanel::onClickNewSnapshot, this)); +} + +LLFacebookPhotoPanel::~LLFacebookPhotoPanel() +{ + if(mPreviewHandle.get()) + { + mPreviewHandle.get()->die(); + } +} + +BOOL LLFacebookPhotoPanel::postBuild() +{ + setVisibleCallback(boost::bind(&LLFacebookPhotoPanel::onVisibilityChange, this, _2)); + + mSnapshotPanel = getChild("snapshot_panel"); + mResolutionComboBox = getChild("resolution_combobox"); + mResolutionComboBox->setCommitCallback(boost::bind(&LLFacebookPhotoPanel::updateResolution, this, TRUE)); + mRefreshBtn = getChild("new_snapshot_btn"); + mWorkingLabel = getChild("working_lbl"); + mThumbnailPlaceholder = getChild("thumbnail_placeholder"); + mCaptionTextBox = getChild("photo_caption"); + mLocationCheckbox = getChild("add_location_cb"); + mPostButton = getChild("post_photo_btn"); + mCancelButton = getChild("cancel_photo_btn"); + + return LLPanel::postBuild(); +} + +void LLFacebookPhotoPanel::draw() +{ + LLSnapshotLivePreview * previewp = static_cast(mPreviewHandle.get()); + + // Enable interaction only if no transaction with the service is on-going (prevent duplicated posts) + bool no_ongoing_connection = !(LLFacebookConnect::instance().isTransactionOngoing()); + mCancelButton->setEnabled(no_ongoing_connection); + mCaptionTextBox->setEnabled(no_ongoing_connection); + mResolutionComboBox->setEnabled(no_ongoing_connection); + mRefreshBtn->setEnabled(no_ongoing_connection); + mLocationCheckbox->setEnabled(no_ongoing_connection); + + // Display the preview if one is available + if (previewp && previewp->getThumbnailImage()) + { + const LLRect& thumbnail_rect = mThumbnailPlaceholder->getRect(); + const S32 thumbnail_w = previewp->getThumbnailWidth(); + const S32 thumbnail_h = previewp->getThumbnailHeight(); + + // calc preview offset within the preview rect + const S32 local_offset_x = (thumbnail_rect.getWidth() - thumbnail_w) / 2 ; + const S32 local_offset_y = (thumbnail_rect.getHeight() - thumbnail_h) / 2 ; + + // calc preview offset within the floater rect + // Hack : To get the full offset, we need to take into account each and every offset of each widgets up to the floater. + // This is almost as arbitrary as using a fixed offset so that's what we do here for the sake of simplicity. + // *TODO : Get the offset looking through the hierarchy of widgets, should be done in postBuild() so to avoid traversing the hierarchy each time. + S32 offset_x = thumbnail_rect.mLeft + local_offset_x - 1; + S32 offset_y = thumbnail_rect.mBottom + local_offset_y - 39; + + mSnapshotPanel->localPointToOtherView(offset_x, offset_y, &offset_x, &offset_y, getParentByType()); + + gGL.matrixMode(LLRender::MM_MODELVIEW); + // Apply floater transparency to the texture unless the floater is focused. + F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency(); + LLColor4 color = LLColor4::white; + gl_draw_scaled_image(offset_x, offset_y, + thumbnail_w, thumbnail_h, + previewp->getThumbnailImage(), color % alpha); + + previewp->drawPreviewRect(offset_x, offset_y) ; + } + + // Update the visibility of the working (computing preview) label + mWorkingLabel->setVisible(!(previewp && previewp->getSnapshotUpToDate())); + + // Enable Post if we have a preview to send and no on going connection being processed + mPostButton->setEnabled(no_ongoing_connection && (previewp && previewp->getSnapshotUpToDate())); + + // Draw the rest of the panel on top of it + LLPanel::draw(); +} + +LLSnapshotLivePreview* LLFacebookPhotoPanel::getPreviewView() +{ + LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)mPreviewHandle.get(); + return previewp; +} + +void LLFacebookPhotoPanel::onVisibilityChange(const LLSD& new_visibility) +{ + bool visible = new_visibility.asBoolean(); + if (visible) + { + if (mPreviewHandle.get()) + { + LLSnapshotLivePreview* preview = getPreviewView(); + if(preview) + { + lldebugs << "opened, updating snapshot" << llendl; + preview->updateSnapshot(TRUE); + } + } + else + { + LLRect full_screen_rect = getRootView()->getRect(); + LLSnapshotLivePreview::Params p; + p.rect(full_screen_rect); + LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(p); + mPreviewHandle = previewp->getHandle(); + + previewp->setSnapshotType(previewp->SNAPSHOT_WEB); + previewp->setSnapshotFormat(LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG); + //previewp->setSnapshotQuality(98); + previewp->setThumbnailPlaceholderRect(mThumbnailPlaceholder->getRect()); + + updateControls(); + } + } +} + +void LLFacebookPhotoPanel::onClickNewSnapshot() +{ + LLSnapshotLivePreview* previewp = getPreviewView(); + if (previewp) + { + //setStatus(Impl::STATUS_READY); + lldebugs << "updating snapshot" << llendl; + previewp->updateSnapshot(TRUE); + } +} + +void LLFacebookPhotoPanel::onSend() +{ + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookPhotoPanel"); // just in case it is already listening + LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookPhotoPanel", boost::bind(&LLFacebookPhotoPanel::onFacebookConnectStateChange, this, _1)); + + // Connect to Facebook if necessary and then post + if (LLFacebookConnect::instance().isConnected()) + { + sendPhoto(); + } + else + { + LLFacebookConnect::instance().checkConnectionToFacebook(true); + } +} + +bool LLFacebookPhotoPanel::onFacebookConnectStateChange(const LLSD& data) +{ + switch (data.get("enum").asInteger()) + { + case LLFacebookConnect::FB_CONNECTED: + sendPhoto(); + break; + + case LLFacebookConnect::FB_POSTED: + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookPhotoPanel"); + clearAndClose(); + break; + } + + return false; +} + +void LLFacebookPhotoPanel::sendPhoto() +{ + // Get the caption + std::string caption = mCaptionTextBox->getValue().asString(); + + // Add the location if required + bool add_location = mLocationCheckbox->getValue().asBoolean(); + if (add_location) + { + // Get the SLURL for the location + LLSLURL slurl; + LLAgentUI::buildSLURL(slurl); + std::string slurl_string = slurl.getSLURLString(); + + // Add query parameters so Google Analytics can track incoming clicks! + slurl_string += DEFAULT_PHOTO_QUERY_PARAMETERS; + + // Add it to the caption (pretty crude, but we don't have a better option with photos) + if (caption.empty()) + caption = slurl_string; + else + caption = caption + " " + slurl_string; + } + + // Get the image + LLSnapshotLivePreview* previewp = getPreviewView(); + + // Post to Facebook + LLFacebookConnect::instance().sharePhoto(previewp->getFormattedImage(), caption); + + updateControls(); +} + +void LLFacebookPhotoPanel::clearAndClose() +{ + mCaptionTextBox->setValue(""); + + LLFloater* floater = getParentByType(); + if (floater) + { + floater->closeFloater(); + } +} + +void LLFacebookPhotoPanel::updateControls() +{ + LLSnapshotLivePreview* previewp = getPreviewView(); + BOOL got_bytes = previewp && previewp->getDataSize() > 0; + BOOL got_snap = previewp && previewp->getSnapshotUpToDate(); + LLSnapshotLivePreview::ESnapshotType shot_type = (previewp ? previewp->getSnapshotType() : LLSnapshotLivePreview::SNAPSHOT_POSTCARD); + + // *TODO: Separate maximum size for Web images from postcards + lldebugs << "Is snapshot up-to-date? " << got_snap << llendl; + + LLLocale locale(LLLocale::USER_LOCALE); + std::string bytes_string; + if (got_snap) + { + LLResMgr::getInstance()->getIntegerString(bytes_string, (previewp->getDataSize()) >> 10 ); + } + + //getChild("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : getString("unknown")); <---uses localized string + getChild("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : "unknown"); + getChild("file_size_label")->setColor( + shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD + && got_bytes + && previewp->getDataSize() > MAX_POSTCARD_DATASIZE ? LLUIColor(LLColor4::red) : LLUIColorTable::instance().getColor( "LabelTextColor" )); + + updateResolution(FALSE); +} + +void LLFacebookPhotoPanel::updateResolution(BOOL do_update) +{ + LLComboBox* combobox = static_cast(mResolutionComboBox); + + std::string sdstring = combobox->getSelectedValue(); + LLSD sdres; + std::stringstream sstream(sdstring); + LLSDSerialize::fromNotation(sdres, sstream, sdstring.size()); + + S32 width = sdres[0]; + S32 height = sdres[1]; + + LLSnapshotLivePreview * previewp = static_cast(mPreviewHandle.get()); + if (previewp && combobox->getCurrentIndex() >= 0) + { + S32 original_width = 0 , original_height = 0 ; + previewp->getSize(original_width, original_height) ; + + if (width == 0 || height == 0) + { + // take resolution from current window size + lldebugs << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << llendl; + previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw()); + } + else + { + // use the resolution from the selected pre-canned drop-down choice + lldebugs << "Setting preview res selected from combo: " << width << "x" << height << llendl; + previewp->setSize(width, height); + } + + checkAspectRatio(width); + + previewp->getSize(width, height); + + if(original_width != width || original_height != height) + { + previewp->setSize(width, height); + + // hide old preview as the aspect ratio could be wrong + lldebugs << "updating thumbnail" << llendl; + + previewp->updateSnapshot(FALSE, TRUE); + if(do_update) + { + lldebugs << "Will update controls" << llendl; + updateControls(); + LLFacebookPhotoPanel::onClickNewSnapshot(); + } + } + + } +} + +void LLFacebookPhotoPanel::checkAspectRatio(S32 index) +{ + LLSnapshotLivePreview *previewp = getPreviewView() ; + + BOOL keep_aspect = FALSE; + + if (0 == index) // current window size + { + keep_aspect = TRUE; + } + else // predefined resolution + { + keep_aspect = FALSE; + } + + if (previewp) + { + previewp->mKeepAspectRatio = keep_aspect; + } +} + +LLUICtrl* LLFacebookPhotoPanel::getRefreshBtn() +{ + return mRefreshBtn; +} + +//////////////////////// +//LLFacebookCheckinPanel// +//////////////////////// + +LLFacebookCheckinPanel::LLFacebookCheckinPanel() : + mMapUrl(""), + mReloadingMapTexture(false) +{ + mCommitCallbackRegistrar.add("SocialSharing.SendCheckin", boost::bind(&LLFacebookCheckinPanel::onSend, this)); +} + +BOOL LLFacebookCheckinPanel::postBuild() +{ + // Keep pointers to widgets so we don't traverse the UI hierarchy too often + mPostButton = getChild("post_place_btn"); + mCancelButton = getChild("cancel_place_btn"); + mMessageTextEditor = getChild("place_caption"); + mMapLoadingIndicator = getChild("map_loading_indicator"); + mMapPlaceholder = getChild("map_placeholder"); + mMapDefault = getChild("map_default"); + mMapCheckBox = getChild("add_place_view_cb"); + + return LLPanel::postBuild(); +} + +void LLFacebookCheckinPanel::draw() +{ + bool no_ongoing_connection = !(LLFacebookConnect::instance().isTransactionOngoing()); + mPostButton->setEnabled(no_ongoing_connection); + mCancelButton->setEnabled(no_ongoing_connection); + mMessageTextEditor->setEnabled(no_ongoing_connection); + mMapCheckBox->setEnabled(no_ongoing_connection); + + std::string map_url = get_map_url(); + // Did we change location? + if (map_url != mMapUrl) + { + mMapUrl = map_url; + // Load the map tile + mMapTexture = LLViewerTextureManager::getFetchedTextureFromUrl(mMapUrl, FTT_MAP_TILE, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); + mMapTexture->setBoostLevel(LLGLTexture::BOOST_MAP); + mReloadingMapTexture = true; + // In the meantime, put the "loading" indicator on, hide the tile map and disable the checkbox + mMapLoadingIndicator->setVisible(true); + mMapPlaceholder->setVisible(false); + } + // Are we done loading the map tile? + if (mReloadingMapTexture && mMapTexture->isFullyLoaded()) + { + // Don't do it again next time around + mReloadingMapTexture = false; + // Convert the map texture to the appropriate image object + LLPointer ui_image = new LLUIImage(mMapUrl, mMapTexture); + // Load the map widget with the correct map tile image + mMapPlaceholder->setImage(ui_image); + // Now hide the loading indicator, bring the tile in view and reenable the checkbox with its previous value + mMapLoadingIndicator->setVisible(false); + mMapPlaceholder->setVisible(true); + } + // Show the default icon if that's the checkbox value (the real one...) + // This will hide/show the loading indicator and/or tile underneath + mMapDefault->setVisible(!(mMapCheckBox->get())); + + LLPanel::draw(); +} + +void LLFacebookCheckinPanel::onSend() +{ + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookCheckinPanel"); // just in case it is already listening + LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookCheckinPanel", boost::bind(&LLFacebookCheckinPanel::onFacebookConnectStateChange, this, _1)); + + // Connect to Facebook if necessary and then post + if (LLFacebookConnect::instance().isConnected()) + { + sendCheckin(); + } + else + { + LLFacebookConnect::instance().checkConnectionToFacebook(true); + } +} + +bool LLFacebookCheckinPanel::onFacebookConnectStateChange(const LLSD& data) +{ + switch (data.get("enum").asInteger()) + { + case LLFacebookConnect::FB_CONNECTED: + sendCheckin(); + break; + + case LLFacebookConnect::FB_POSTED: + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookCheckinPanel"); + clearAndClose(); + break; + } + + return false; +} + +void LLFacebookCheckinPanel::sendCheckin() +{ + // Get the location SLURL + LLSLURL slurl; + LLAgentUI::buildSLURL(slurl); + std::string slurl_string = slurl.getSLURLString(); + + // Use a valid http:// URL if the scheme is secondlife:// + LLURI slurl_uri(slurl_string); + if (slurl_uri.scheme() == LLSLURL::SLURL_SECONDLIFE_SCHEME) + { + slurl_string = DEFAULT_CHECKIN_LOCATION_URL; + } + + // Add query parameters so Google Analytics can track incoming clicks! + slurl_string += DEFAULT_CHECKIN_QUERY_PARAMETERS; + + // Get the region name + std::string region_name(""); + LLViewerRegion *regionp = gAgent.getRegion(); + if (regionp) + { + region_name = regionp->getName(); + } + + // Get the region description + std::string description; + LLAgentUI::buildLocationString(description, LLAgentUI::LOCATION_FORMAT_NORMAL_COORDS, gAgent.getPositionAgent()); + + // Optionally add the region map view + bool add_map_view = mMapCheckBox->getValue().asBoolean(); + std::string map_url = (add_map_view ? get_map_url() : DEFAULT_CHECKIN_ICON_URL); + + // Get the caption + std::string caption = mMessageTextEditor->getValue().asString(); + + // Post to Facebook + LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, map_url, caption); +} + +void LLFacebookCheckinPanel::clearAndClose() +{ + mMessageTextEditor->setValue(""); + + LLFloater* floater = getParentByType(); + if (floater) + { + floater->closeFloater(); + } +} + +/////////////////////////// +//LLFacebookAccountPanel////// +/////////////////////////// + +LLFacebookAccountPanel::LLFacebookAccountPanel() : +mAccountCaptionLabel(NULL), +mAccountNameLabel(NULL), +mPanelButtons(NULL), +mConnectButton(NULL), +mDisconnectButton(NULL) +{ + mCommitCallbackRegistrar.add("SocialSharing.Connect", boost::bind(&LLFacebookAccountPanel::onConnect, this)); + mCommitCallbackRegistrar.add("SocialSharing.Disconnect", boost::bind(&LLFacebookAccountPanel::onDisconnect, this)); + + setVisibleCallback(boost::bind(&LLFacebookAccountPanel::onVisibilityChange, this, _2)); +} + +BOOL LLFacebookAccountPanel::postBuild() +{ + mAccountCaptionLabel = getChild("account_caption_label"); + mAccountNameLabel = getChild("account_name_label"); + mPanelButtons = getChild("panel_buttons"); + mConnectButton = getChild("connect_btn"); + mDisconnectButton = getChild("disconnect_btn"); + + return LLPanel::postBuild(); +} + +void LLFacebookAccountPanel::draw() +{ + LLFacebookConnect::EConnectionState connection_state = LLFacebookConnect::instance().getConnectionState(); + + //Disable the 'disconnect' button and the 'use another account' button when disconnecting in progress + bool disconnecting = connection_state == LLFacebookConnect::FB_DISCONNECTING; + mDisconnectButton->setEnabled(!disconnecting); + + //Disable the 'connect' button when a connection is in progress + bool connecting = connection_state == LLFacebookConnect::FB_CONNECTION_IN_PROGRESS; + mConnectButton->setEnabled(!connecting); + + LLPanel::draw(); +} + +void LLFacebookAccountPanel::onVisibilityChange(const LLSD& new_visibility) +{ + bool visible = new_visibility.asBoolean(); + + if(visible) + { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel"); + LLEventPumps::instance().obtain("FacebookConnectState").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookAccountPanel::onFacebookConnectStateChange, this, _1)); + + LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel"); + LLEventPumps::instance().obtain("FacebookConnectInfo").listen("LLFacebookAccountPanel", boost::bind(&LLFacebookAccountPanel::onFacebookConnectInfoChange, this)); + + //Connected + if(LLFacebookConnect::instance().isConnected()) + { + showConnectedLayout(); + } + //Check if connected (show disconnected layout in meantime) + else + { + showDisconnectedLayout(); + } + if ((LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_NOT_CONNECTED) || + (LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_CONNECTION_FAILED)) + { + LLFacebookConnect::instance().checkConnectionToFacebook(); + } + } + else + { + LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLFacebookAccountPanel"); + LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLFacebookAccountPanel"); + } +} + +bool LLFacebookAccountPanel::onFacebookConnectStateChange(const LLSD& data) +{ + if(LLFacebookConnect::instance().isConnected()) + { + //In process of disconnecting so leave the layout as is + if(data.get("enum").asInteger() != LLFacebookConnect::FB_DISCONNECTING) + { + showConnectedLayout(); + } + } + else + { + showDisconnectedLayout(); + } + + return false; +} + +bool LLFacebookAccountPanel::onFacebookConnectInfoChange() +{ + LLSD info = LLFacebookConnect::instance().getInfo(); + std::string clickable_name; + + //Strings of format [http://www.somewebsite.com Click Me] become clickable text + if(info.has("link") && info.has("name")) + { + clickable_name = "[" + info["link"].asString() + " " + info["name"].asString() + "]"; + } + + mAccountNameLabel->setText(clickable_name); + + return false; +} + +void LLFacebookAccountPanel::showConnectButton() +{ + if(!mConnectButton->getVisible()) + { + mConnectButton->setVisible(TRUE); + mDisconnectButton->setVisible(FALSE); + } +} + +void LLFacebookAccountPanel::hideConnectButton() +{ + if(mConnectButton->getVisible()) + { + mConnectButton->setVisible(FALSE); + mDisconnectButton->setVisible(TRUE); + } +} + +void LLFacebookAccountPanel::showDisconnectedLayout() +{ + mAccountCaptionLabel->setText(getString("facebook_disconnected")); + mAccountNameLabel->setText(std::string("")); + showConnectButton(); +} + +void LLFacebookAccountPanel::showConnectedLayout() +{ + LLFacebookConnect::instance().loadFacebookInfo(); + + mAccountCaptionLabel->setText(getString("facebook_connected")); + hideConnectButton(); +} + +void LLFacebookAccountPanel::onConnect() +{ + LLFacebookConnect::instance().checkConnectionToFacebook(true); + + //Clear only the facebook browser cookies so that the facebook login screen appears + LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com"); +} + +void LLFacebookAccountPanel::onDisconnect() +{ + LLFacebookConnect::instance().disconnectFromFacebook(); + + LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com"); +} + +//////////////////////// +//LLFloaterFacebook/////// +//////////////////////// + +LLFloaterFacebook::LLFloaterFacebook(const LLSD& key) : LLFloater(key), + mFacebookPhotoPanel(NULL), + mStatusErrorText(NULL), + mStatusLoadingText(NULL), + mStatusLoadingIndicator(NULL) +{ + mCommitCallbackRegistrar.add("SocialSharing.Cancel", boost::bind(&LLFloaterFacebook::onCancel, this)); +} + +void LLFloaterFacebook::onCancel() +{ + closeFloater(); +} + +BOOL LLFloaterFacebook::postBuild() +{ + // Keep tab of the Photo Panel + mFacebookPhotoPanel = static_cast(getChild("panel_facebook_photo")); + // Connection status widgets + mStatusErrorText = getChild("connection_error_text"); + mStatusLoadingText = getChild("connection_loading_text"); + mStatusLoadingIndicator = getChild("connection_loading_indicator"); + return LLFloater::postBuild(); +} + +void LLFloaterFacebook::showPhotoPanel() +{ + LLTabContainer* parent = dynamic_cast(mFacebookPhotoPanel->getParent()); + if (!parent) + { + llwarns << "Cannot find panel container" << llendl; + return; + } + + parent->selectTabPanel(mFacebookPhotoPanel); +} + +// static +void LLFloaterFacebook::preUpdate() +{ + LLFloaterFacebook* instance = LLFloaterReg::findTypedInstance("facebook"); + if (instance) + { + //Will set file size text to 'unknown' + instance->mFacebookPhotoPanel->updateControls(); + } +} + +// static +void LLFloaterFacebook::postUpdate() +{ + LLFloaterFacebook* instance = LLFloaterReg::findTypedInstance("facebook"); + if (instance) + { + //Will set the file size text + instance->mFacebookPhotoPanel->updateControls(); + + // The refresh button is initially hidden. We show it after the first update, + // i.e. after snapshot is taken + LLUICtrl * refresh_button = instance->mFacebookPhotoPanel->getRefreshBtn(); + + if (!refresh_button->getVisible()) + { + refresh_button->setVisible(true); + } + + } +} + +void LLFloaterFacebook::draw() +{ + if (mStatusErrorText && mStatusLoadingText && mStatusLoadingIndicator) + { + mStatusErrorText->setVisible(false); + mStatusLoadingText->setVisible(false); + mStatusLoadingIndicator->setVisible(false); + LLFacebookConnect::EConnectionState connection_state = LLFacebookConnect::instance().getConnectionState(); + std::string status_text; + + switch (connection_state) + { + case LLFacebookConnect::FB_NOT_CONNECTED: + // No status displayed when first opening the panel and no connection done + case LLFacebookConnect::FB_CONNECTED: + // When successfully connected, no message is displayed + case LLFacebookConnect::FB_POSTED: + // No success message to show since we actually close the floater after successful posting completion + break; + case LLFacebookConnect::FB_CONNECTION_IN_PROGRESS: + // Connection loading indicator + mStatusLoadingText->setVisible(true); + status_text = LLTrans::getString("SocialFacebookConnecting"); + mStatusLoadingText->setValue(status_text); + mStatusLoadingIndicator->setVisible(true); + break; + case LLFacebookConnect::FB_POSTING: + // Posting indicator + mStatusLoadingText->setVisible(true); + status_text = LLTrans::getString("SocialFacebookPosting"); + mStatusLoadingText->setValue(status_text); + mStatusLoadingIndicator->setVisible(true); + break; + case LLFacebookConnect::FB_CONNECTION_FAILED: + // Error connecting to the service + mStatusErrorText->setVisible(true); + status_text = LLTrans::getString("SocialFacebookErrorConnecting"); + mStatusErrorText->setValue(status_text); + break; + case LLFacebookConnect::FB_POST_FAILED: + // Error posting to the service + mStatusErrorText->setVisible(true); + status_text = LLTrans::getString("SocialFacebookErrorPosting"); + mStatusErrorText->setValue(status_text); + break; + case LLFacebookConnect::FB_DISCONNECTING: + // Disconnecting loading indicator + mStatusLoadingText->setVisible(true); + status_text = LLTrans::getString("SocialFacebookDisconnecting"); + mStatusLoadingText->setValue(status_text); + mStatusLoadingIndicator->setVisible(true); + break; + case LLFacebookConnect::FB_DISCONNECT_FAILED: + // Error disconnecting from the service + mStatusErrorText->setVisible(true); + status_text = LLTrans::getString("SocialFacebookErrorDisconnecting"); + mStatusErrorText->setValue(status_text); + break; + } + } + LLFloater::draw(); +} + diff --git a/indra/newview/llfloaterfacebook.h b/indra/newview/llfloaterfacebook.h new file mode 100644 index 0000000000..ab6420264b --- /dev/null +++ b/indra/newview/llfloaterfacebook.h @@ -0,0 +1,167 @@ +/** +* @file llfloaterfacebook.h +* @brief Header file for llfloaterfacebook +* @author Gilbert@lindenlab.com +* +* $LicenseInfo:firstyear=2013&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) 2013, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ +#ifndef LL_LLFLOATERFACEBOOK_H +#define LL_LLFLOATERFACEBOOK_H + +#include "llfloater.h" +#include "lltextbox.h" +#include "llviewertexture.h" + +class LLIconCtrl; +class LLCheckBoxCtrl; +class LLSnapshotLivePreview; + +class LLFacebookStatusPanel : public LLPanel +{ +public: + LLFacebookStatusPanel(); + BOOL postBuild(); + void draw(); + void onSend(); + bool onFacebookConnectStateChange(const LLSD& data); + + void sendStatus(); + void clearAndClose(); + +private: + LLUICtrl* mMessageTextEditor; + LLUICtrl* mPostButton; + LLUICtrl* mCancelButton; +}; + +class LLFacebookPhotoPanel : public LLPanel +{ +public: + LLFacebookPhotoPanel(); + ~LLFacebookPhotoPanel(); + + BOOL postBuild(); + void draw(); + + LLSnapshotLivePreview* getPreviewView(); + void onVisibilityChange(const LLSD& new_visibility); + void onClickNewSnapshot(); + void onSend(); + bool onFacebookConnectStateChange(const LLSD& data); + + void sendPhoto(); + void clearAndClose(); + + void updateControls(); + void updateResolution(BOOL do_update); + void checkAspectRatio(S32 index); + LLUICtrl* getRefreshBtn(); + +private: + LLHandle mPreviewHandle; + + LLUICtrl * mSnapshotPanel; + LLUICtrl * mResolutionComboBox; + LLUICtrl * mRefreshBtn; + LLUICtrl * mWorkingLabel; + LLUICtrl * mThumbnailPlaceholder; + LLUICtrl * mCaptionTextBox; + LLUICtrl * mLocationCheckbox; + LLUICtrl * mPostButton; + LLUICtrl* mCancelButton; +}; + +class LLFacebookCheckinPanel : public LLPanel +{ +public: + LLFacebookCheckinPanel(); + BOOL postBuild(); + void draw(); + void onSend(); + bool onFacebookConnectStateChange(const LLSD& data); + + void sendCheckin(); + void clearAndClose(); + +private: + std::string mMapUrl; + LLPointer mMapTexture; + LLUICtrl* mPostButton; + LLUICtrl* mCancelButton; + LLUICtrl* mMessageTextEditor; + LLUICtrl* mMapLoadingIndicator; + LLIconCtrl* mMapPlaceholder; + LLIconCtrl* mMapDefault; + LLCheckBoxCtrl* mMapCheckBox; + bool mReloadingMapTexture; +}; + +class LLFacebookAccountPanel : public LLPanel +{ +public: + LLFacebookAccountPanel(); + BOOL postBuild(); + void draw(); + +private: + void onVisibilityChange(const LLSD& new_visibility); + bool onFacebookConnectStateChange(const LLSD& data); + bool onFacebookConnectInfoChange(); + void onConnect(); + void onUseAnotherAccount(); + void onDisconnect(); + + void showConnectButton(); + void hideConnectButton(); + void showDisconnectedLayout(); + void showConnectedLayout(); + + LLTextBox * mAccountCaptionLabel; + LLTextBox * mAccountNameLabel; + LLUICtrl * mPanelButtons; + LLUICtrl * mConnectButton; + LLUICtrl * mDisconnectButton; +}; + + +class LLFloaterFacebook : public LLFloater +{ +public: + LLFloaterFacebook(const LLSD& key); + BOOL postBuild(); + void draw(); + void onCancel(); + + void showPhotoPanel(); + + static void preUpdate(); + static void postUpdate(); + +private: + LLFacebookPhotoPanel* mFacebookPhotoPanel; + LLTextBox* mStatusErrorText; + LLTextBox* mStatusLoadingText; + LLUICtrl* mStatusLoadingIndicator; +}; + +#endif // LL_LLFLOATERFACEBOOK_H + diff --git a/indra/newview/llfloaterflickr.cpp b/indra/newview/llfloaterflickr.cpp index 61ebe563a3..0a4c3f091b 100644 --- a/indra/newview/llfloaterflickr.cpp +++ b/indra/newview/llfloaterflickr.cpp @@ -570,7 +570,7 @@ void LLFlickrAccountPanel::onDisconnect() //////////////////////// LLFloaterFlickr::LLFloaterFlickr(const LLSD& key) : LLFloater(key), - mSocialPhotoPanel(NULL), + mFlickrPhotoPanel(NULL), mStatusErrorText(NULL), mStatusLoadingText(NULL), mStatusLoadingIndicator(NULL) @@ -586,7 +586,7 @@ void LLFloaterFlickr::onCancel() BOOL LLFloaterFlickr::postBuild() { // Keep tab of the Photo Panel - mSocialPhotoPanel = static_cast(getChild("panel_flickr_photo")); + mFlickrPhotoPanel = static_cast(getChild("panel_flickr_photo")); // Connection status widgets mStatusErrorText = getChild("connection_error_text"); mStatusLoadingText = getChild("connection_loading_text"); @@ -596,14 +596,14 @@ BOOL LLFloaterFlickr::postBuild() void LLFloaterFlickr::showPhotoPanel() { - LLTabContainer* parent = dynamic_cast(mSocialPhotoPanel->getParent()); + LLTabContainer* parent = dynamic_cast(mFlickrPhotoPanel->getParent()); if (!parent) { llwarns << "Cannot find panel container" << llendl; return; } - parent->selectTabPanel(mSocialPhotoPanel); + parent->selectTabPanel(mFlickrPhotoPanel); } // static @@ -613,7 +613,7 @@ void LLFloaterFlickr::preUpdate() if (instance) { //Will set file size text to 'unknown' - instance->mSocialPhotoPanel->updateControls(); + instance->mFlickrPhotoPanel->updateControls(); } } @@ -624,11 +624,11 @@ void LLFloaterFlickr::postUpdate() if (instance) { //Will set the file size text - instance->mSocialPhotoPanel->updateControls(); + instance->mFlickrPhotoPanel->updateControls(); // The refresh button is initially hidden. We show it after the first update, // i.e. after snapshot is taken - LLUICtrl * refresh_button = instance->mSocialPhotoPanel->getRefreshBtn(); + LLUICtrl * refresh_button = instance->mFlickrPhotoPanel->getRefreshBtn(); if (!refresh_button->getVisible()) { diff --git a/indra/newview/llfloaterflickr.h b/indra/newview/llfloaterflickr.h index e9005444d8..9a329d4451 100644 --- a/indra/newview/llfloaterflickr.h +++ b/indra/newview/llfloaterflickr.h @@ -117,7 +117,7 @@ public: static void postUpdate(); private: - LLFlickrPhotoPanel* mSocialPhotoPanel; + LLFlickrPhotoPanel* mFlickrPhotoPanel; LLTextBox* mStatusErrorText; LLTextBox* mStatusLoadingText; LLUICtrl* mStatusLoadingIndicator; diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 4701e128d3..c3efc26991 100755 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -31,7 +31,7 @@ #include "llagent.h" #include "llfacebookconnect.h" #include "llfloaterreg.h" -#include "llfloatersocial.h" +#include "llfloaterfacebook.h" #include "llfloaterflickr.h" #include "llfloatertwitter.h" #include "llcheckboxctrl.h" @@ -1266,11 +1266,11 @@ S32 LLFloaterSnapshot::notify(const LLSD& info) void LLFloaterSnapshot::update() { LLFloaterSnapshot* inst = LLFloaterReg::findTypedInstance("snapshot"); - LLFloaterSocial* floater_social = LLFloaterReg::findTypedInstance("social"); + LLFloaterFacebook* floater_facebook = LLFloaterReg::findTypedInstance("facebook"); LLFloaterFlickr* floater_flickr = LLFloaterReg::findTypedInstance("flickr"); LLFloaterTwitter* floater_twitter = LLFloaterReg::findTypedInstance("twitter"); - if (!inst && !floater_social && !floater_flickr && !floater_twitter) + if (!inst && !floater_facebook && !floater_flickr && !floater_twitter) return; BOOL changed = FALSE; diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp deleted file mode 100644 index e7be8cc8cc..0000000000 --- a/indra/newview/llfloatersocial.cpp +++ /dev/null @@ -1,939 +0,0 @@ -/** -* @file llfloatersocial.cpp -* @brief Implementation of llfloatersocial -* @author Gilbert@lindenlab.com -* -* $LicenseInfo:firstyear=2013&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2013, Linden Research, Inc. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License only. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -* $/LicenseInfo$ -*/ - -#include "llviewerprecompiledheaders.h" - -#include "llfloatersocial.h" - -#include "llagent.h" -#include "llagentui.h" -#include "llcheckboxctrl.h" -#include "llcombobox.h" -#include "llfacebookconnect.h" -#include "llfloaterreg.h" -#include "lliconctrl.h" -#include "llresmgr.h" // LLLocale -#include "llsdserialize.h" -#include "llloadingindicator.h" -#include "llplugincookiestore.h" -#include "llslurl.h" -#include "lltrans.h" -#include "llsnapshotlivepreview.h" -#include "llviewerregion.h" -#include "llviewercontrol.h" -#include "llviewermedia.h" -#include "lltabcontainer.h" - -static LLRegisterPanelClassWrapper t_panel_status("llsocialstatuspanel"); -static LLRegisterPanelClassWrapper t_panel_photo("llsocialphotopanel"); -static LLRegisterPanelClassWrapper t_panel_checkin("llsocialcheckinpanel"); -static LLRegisterPanelClassWrapper t_panel_account("llsocialaccountpanel"); - -const S32 MAX_POSTCARD_DATASIZE = 1024 * 1024; // one megabyte -const std::string DEFAULT_CHECKIN_LOCATION_URL = "http://maps.secondlife.com/"; -const std::string DEFAULT_CHECKIN_ICON_URL = "http://map.secondlife.com.s3.amazonaws.com/map_placeholder.png"; -const std::string DEFAULT_CHECKIN_QUERY_PARAMETERS = "?sourceid=slshare_checkin&utm_source=facebook&utm_medium=checkin&utm_campaign=slshare"; -const std::string DEFAULT_PHOTO_QUERY_PARAMETERS = "?sourceid=slshare_photo&utm_source=facebook&utm_medium=photo&utm_campaign=slshare"; - -std::string get_map_url() -{ - LLVector3d center_agent; - LLViewerRegion *regionp = gAgent.getRegion(); - if (regionp) - { - center_agent = regionp->getCenterGlobal(); - } - int x_pos = center_agent[0] / 256.0; - int y_pos = center_agent[1] / 256.0; - std::string map_url = gSavedSettings.getString("CurrentMapServerURL") + llformat("map-1-%d-%d-objects.jpg", x_pos, y_pos); - return map_url; -} - -/////////////////////////// -//LLSocialStatusPanel////// -/////////////////////////// - -LLSocialStatusPanel::LLSocialStatusPanel() : - mMessageTextEditor(NULL), - mPostButton(NULL), - mCancelButton(NULL) -{ - mCommitCallbackRegistrar.add("SocialSharing.SendStatus", boost::bind(&LLSocialStatusPanel::onSend, this)); -} - -BOOL LLSocialStatusPanel::postBuild() -{ - mMessageTextEditor = getChild("status_message"); - mPostButton = getChild("post_status_btn"); - mCancelButton = getChild("cancel_status_btn"); - - return LLPanel::postBuild(); -} - -void LLSocialStatusPanel::draw() -{ - if (mMessageTextEditor && mPostButton && mCancelButton) - { - bool no_ongoing_connection = !(LLFacebookConnect::instance().isTransactionOngoing()); - std::string message = mMessageTextEditor->getValue().asString(); - mMessageTextEditor->setEnabled(no_ongoing_connection); - mCancelButton->setEnabled(no_ongoing_connection); - mPostButton->setEnabled(no_ongoing_connection && !message.empty()); - } - - LLPanel::draw(); -} - -void LLSocialStatusPanel::onSend() -{ - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialStatusPanel"); // just in case it is already listening - LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialStatusPanel", boost::bind(&LLSocialStatusPanel::onFacebookConnectStateChange, this, _1)); - - // Connect to Facebook if necessary and then post - if (LLFacebookConnect::instance().isConnected()) - { - sendStatus(); - } - else - { - LLFacebookConnect::instance().checkConnectionToFacebook(true); - } -} - -bool LLSocialStatusPanel::onFacebookConnectStateChange(const LLSD& data) -{ - switch (data.get("enum").asInteger()) - { - case LLFacebookConnect::FB_CONNECTED: - sendStatus(); - break; - - case LLFacebookConnect::FB_POSTED: - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialStatusPanel"); - clearAndClose(); - break; - } - - return false; -} - -void LLSocialStatusPanel::sendStatus() -{ - std::string message = mMessageTextEditor->getValue().asString(); - if (!message.empty()) - { - LLFacebookConnect::instance().updateStatus(message); - } -} - -void LLSocialStatusPanel::clearAndClose() -{ - mMessageTextEditor->setValue(""); - - LLFloater* floater = getParentByType(); - if (floater) - { - floater->closeFloater(); - } -} - -/////////////////////////// -//LLSocialPhotoPanel/////// -/////////////////////////// - -LLSocialPhotoPanel::LLSocialPhotoPanel() : -mSnapshotPanel(NULL), -mResolutionComboBox(NULL), -mRefreshBtn(NULL), -mWorkingLabel(NULL), -mThumbnailPlaceholder(NULL), -mCaptionTextBox(NULL), -mLocationCheckbox(NULL), -mPostButton(NULL) -{ - mCommitCallbackRegistrar.add("SocialSharing.SendPhoto", boost::bind(&LLSocialPhotoPanel::onSend, this)); - mCommitCallbackRegistrar.add("SocialSharing.RefreshPhoto", boost::bind(&LLSocialPhotoPanel::onClickNewSnapshot, this)); -} - -LLSocialPhotoPanel::~LLSocialPhotoPanel() -{ - if(mPreviewHandle.get()) - { - mPreviewHandle.get()->die(); - } -} - -BOOL LLSocialPhotoPanel::postBuild() -{ - setVisibleCallback(boost::bind(&LLSocialPhotoPanel::onVisibilityChange, this, _2)); - - mSnapshotPanel = getChild("snapshot_panel"); - mResolutionComboBox = getChild("resolution_combobox"); - mResolutionComboBox->setCommitCallback(boost::bind(&LLSocialPhotoPanel::updateResolution, this, TRUE)); - mRefreshBtn = getChild("new_snapshot_btn"); - mWorkingLabel = getChild("working_lbl"); - mThumbnailPlaceholder = getChild("thumbnail_placeholder"); - mCaptionTextBox = getChild("photo_caption"); - mLocationCheckbox = getChild("add_location_cb"); - mPostButton = getChild("post_photo_btn"); - mCancelButton = getChild("cancel_photo_btn"); - - return LLPanel::postBuild(); -} - -void LLSocialPhotoPanel::draw() -{ - LLSnapshotLivePreview * previewp = static_cast(mPreviewHandle.get()); - - // Enable interaction only if no transaction with the service is on-going (prevent duplicated posts) - bool no_ongoing_connection = !(LLFacebookConnect::instance().isTransactionOngoing()); - mCancelButton->setEnabled(no_ongoing_connection); - mCaptionTextBox->setEnabled(no_ongoing_connection); - mResolutionComboBox->setEnabled(no_ongoing_connection); - mRefreshBtn->setEnabled(no_ongoing_connection); - mLocationCheckbox->setEnabled(no_ongoing_connection); - - // Display the preview if one is available - if (previewp && previewp->getThumbnailImage()) - { - const LLRect& thumbnail_rect = mThumbnailPlaceholder->getRect(); - const S32 thumbnail_w = previewp->getThumbnailWidth(); - const S32 thumbnail_h = previewp->getThumbnailHeight(); - - // calc preview offset within the preview rect - const S32 local_offset_x = (thumbnail_rect.getWidth() - thumbnail_w) / 2 ; - const S32 local_offset_y = (thumbnail_rect.getHeight() - thumbnail_h) / 2 ; - - // calc preview offset within the floater rect - // Hack : To get the full offset, we need to take into account each and every offset of each widgets up to the floater. - // This is almost as arbitrary as using a fixed offset so that's what we do here for the sake of simplicity. - // *TODO : Get the offset looking through the hierarchy of widgets, should be done in postBuild() so to avoid traversing the hierarchy each time. - S32 offset_x = thumbnail_rect.mLeft + local_offset_x - 1; - S32 offset_y = thumbnail_rect.mBottom + local_offset_y - 39; - - mSnapshotPanel->localPointToOtherView(offset_x, offset_y, &offset_x, &offset_y, getParentByType()); - - gGL.matrixMode(LLRender::MM_MODELVIEW); - // Apply floater transparency to the texture unless the floater is focused. - F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency(); - LLColor4 color = LLColor4::white; - gl_draw_scaled_image(offset_x, offset_y, - thumbnail_w, thumbnail_h, - previewp->getThumbnailImage(), color % alpha); - - previewp->drawPreviewRect(offset_x, offset_y) ; - } - - // Update the visibility of the working (computing preview) label - mWorkingLabel->setVisible(!(previewp && previewp->getSnapshotUpToDate())); - - // Enable Post if we have a preview to send and no on going connection being processed - mPostButton->setEnabled(no_ongoing_connection && (previewp && previewp->getSnapshotUpToDate())); - - // Draw the rest of the panel on top of it - LLPanel::draw(); -} - -LLSnapshotLivePreview* LLSocialPhotoPanel::getPreviewView() -{ - LLSnapshotLivePreview* previewp = (LLSnapshotLivePreview*)mPreviewHandle.get(); - return previewp; -} - -void LLSocialPhotoPanel::onVisibilityChange(const LLSD& new_visibility) -{ - bool visible = new_visibility.asBoolean(); - if (visible) - { - if (mPreviewHandle.get()) - { - LLSnapshotLivePreview* preview = getPreviewView(); - if(preview) - { - lldebugs << "opened, updating snapshot" << llendl; - preview->updateSnapshot(TRUE); - } - } - else - { - LLRect full_screen_rect = getRootView()->getRect(); - LLSnapshotLivePreview::Params p; - p.rect(full_screen_rect); - LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(p); - mPreviewHandle = previewp->getHandle(); - - previewp->setSnapshotType(previewp->SNAPSHOT_WEB); - previewp->setSnapshotFormat(LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG); - //previewp->setSnapshotQuality(98); - previewp->setThumbnailPlaceholderRect(mThumbnailPlaceholder->getRect()); - - updateControls(); - } - } -} - -void LLSocialPhotoPanel::onClickNewSnapshot() -{ - LLSnapshotLivePreview* previewp = getPreviewView(); - if (previewp) - { - //setStatus(Impl::STATUS_READY); - lldebugs << "updating snapshot" << llendl; - previewp->updateSnapshot(TRUE); - } -} - -void LLSocialPhotoPanel::onSend() -{ - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialPhotoPanel"); // just in case it is already listening - LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialPhotoPanel", boost::bind(&LLSocialPhotoPanel::onFacebookConnectStateChange, this, _1)); - - // Connect to Facebook if necessary and then post - if (LLFacebookConnect::instance().isConnected()) - { - sendPhoto(); - } - else - { - LLFacebookConnect::instance().checkConnectionToFacebook(true); - } -} - -bool LLSocialPhotoPanel::onFacebookConnectStateChange(const LLSD& data) -{ - switch (data.get("enum").asInteger()) - { - case LLFacebookConnect::FB_CONNECTED: - sendPhoto(); - break; - - case LLFacebookConnect::FB_POSTED: - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialPhotoPanel"); - clearAndClose(); - break; - } - - return false; -} - -void LLSocialPhotoPanel::sendPhoto() -{ - // Get the caption - std::string caption = mCaptionTextBox->getValue().asString(); - - // Add the location if required - bool add_location = mLocationCheckbox->getValue().asBoolean(); - if (add_location) - { - // Get the SLURL for the location - LLSLURL slurl; - LLAgentUI::buildSLURL(slurl); - std::string slurl_string = slurl.getSLURLString(); - - // Add query parameters so Google Analytics can track incoming clicks! - slurl_string += DEFAULT_PHOTO_QUERY_PARAMETERS; - - // Add it to the caption (pretty crude, but we don't have a better option with photos) - if (caption.empty()) - caption = slurl_string; - else - caption = caption + " " + slurl_string; - } - - // Get the image - LLSnapshotLivePreview* previewp = getPreviewView(); - - // Post to Facebook - LLFacebookConnect::instance().sharePhoto(previewp->getFormattedImage(), caption); - - updateControls(); -} - -void LLSocialPhotoPanel::clearAndClose() -{ - mCaptionTextBox->setValue(""); - - LLFloater* floater = getParentByType(); - if (floater) - { - floater->closeFloater(); - } -} - -void LLSocialPhotoPanel::updateControls() -{ - LLSnapshotLivePreview* previewp = getPreviewView(); - BOOL got_bytes = previewp && previewp->getDataSize() > 0; - BOOL got_snap = previewp && previewp->getSnapshotUpToDate(); - LLSnapshotLivePreview::ESnapshotType shot_type = (previewp ? previewp->getSnapshotType() : LLSnapshotLivePreview::SNAPSHOT_POSTCARD); - - // *TODO: Separate maximum size for Web images from postcards - lldebugs << "Is snapshot up-to-date? " << got_snap << llendl; - - LLLocale locale(LLLocale::USER_LOCALE); - std::string bytes_string; - if (got_snap) - { - LLResMgr::getInstance()->getIntegerString(bytes_string, (previewp->getDataSize()) >> 10 ); - } - - //getChild("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : getString("unknown")); <---uses localized string - getChild("file_size_label")->setTextArg("[SIZE]", got_snap ? bytes_string : "unknown"); - getChild("file_size_label")->setColor( - shot_type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD - && got_bytes - && previewp->getDataSize() > MAX_POSTCARD_DATASIZE ? LLUIColor(LLColor4::red) : LLUIColorTable::instance().getColor( "LabelTextColor" )); - - updateResolution(FALSE); -} - -void LLSocialPhotoPanel::updateResolution(BOOL do_update) -{ - LLComboBox* combobox = static_cast(mResolutionComboBox); - - std::string sdstring = combobox->getSelectedValue(); - LLSD sdres; - std::stringstream sstream(sdstring); - LLSDSerialize::fromNotation(sdres, sstream, sdstring.size()); - - S32 width = sdres[0]; - S32 height = sdres[1]; - - LLSnapshotLivePreview * previewp = static_cast(mPreviewHandle.get()); - if (previewp && combobox->getCurrentIndex() >= 0) - { - S32 original_width = 0 , original_height = 0 ; - previewp->getSize(original_width, original_height) ; - - if (width == 0 || height == 0) - { - // take resolution from current window size - lldebugs << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << llendl; - previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw()); - } - else - { - // use the resolution from the selected pre-canned drop-down choice - lldebugs << "Setting preview res selected from combo: " << width << "x" << height << llendl; - previewp->setSize(width, height); - } - - checkAspectRatio(width); - - previewp->getSize(width, height); - - if(original_width != width || original_height != height) - { - previewp->setSize(width, height); - - // hide old preview as the aspect ratio could be wrong - lldebugs << "updating thumbnail" << llendl; - - previewp->updateSnapshot(FALSE, TRUE); - if(do_update) - { - lldebugs << "Will update controls" << llendl; - updateControls(); - LLSocialPhotoPanel::onClickNewSnapshot(); - } - } - - } -} - -void LLSocialPhotoPanel::checkAspectRatio(S32 index) -{ - LLSnapshotLivePreview *previewp = getPreviewView() ; - - BOOL keep_aspect = FALSE; - - if (0 == index) // current window size - { - keep_aspect = TRUE; - } - else // predefined resolution - { - keep_aspect = FALSE; - } - - if (previewp) - { - previewp->mKeepAspectRatio = keep_aspect; - } -} - -LLUICtrl* LLSocialPhotoPanel::getRefreshBtn() -{ - return mRefreshBtn; -} - -//////////////////////// -//LLSocialCheckinPanel// -//////////////////////// - -LLSocialCheckinPanel::LLSocialCheckinPanel() : - mMapUrl(""), - mReloadingMapTexture(false) -{ - mCommitCallbackRegistrar.add("SocialSharing.SendCheckin", boost::bind(&LLSocialCheckinPanel::onSend, this)); -} - -BOOL LLSocialCheckinPanel::postBuild() -{ - // Keep pointers to widgets so we don't traverse the UI hierarchy too often - mPostButton = getChild("post_place_btn"); - mCancelButton = getChild("cancel_place_btn"); - mMessageTextEditor = getChild("place_caption"); - mMapLoadingIndicator = getChild("map_loading_indicator"); - mMapPlaceholder = getChild("map_placeholder"); - mMapDefault = getChild("map_default"); - mMapCheckBox = getChild("add_place_view_cb"); - - return LLPanel::postBuild(); -} - -void LLSocialCheckinPanel::draw() -{ - bool no_ongoing_connection = !(LLFacebookConnect::instance().isTransactionOngoing()); - mPostButton->setEnabled(no_ongoing_connection); - mCancelButton->setEnabled(no_ongoing_connection); - mMessageTextEditor->setEnabled(no_ongoing_connection); - mMapCheckBox->setEnabled(no_ongoing_connection); - - std::string map_url = get_map_url(); - // Did we change location? - if (map_url != mMapUrl) - { - mMapUrl = map_url; - // Load the map tile - mMapTexture = LLViewerTextureManager::getFetchedTextureFromUrl(mMapUrl, FTT_MAP_TILE, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); - mMapTexture->setBoostLevel(LLGLTexture::BOOST_MAP); - mReloadingMapTexture = true; - // In the meantime, put the "loading" indicator on, hide the tile map and disable the checkbox - mMapLoadingIndicator->setVisible(true); - mMapPlaceholder->setVisible(false); - } - // Are we done loading the map tile? - if (mReloadingMapTexture && mMapTexture->isFullyLoaded()) - { - // Don't do it again next time around - mReloadingMapTexture = false; - // Convert the map texture to the appropriate image object - LLPointer ui_image = new LLUIImage(mMapUrl, mMapTexture); - // Load the map widget with the correct map tile image - mMapPlaceholder->setImage(ui_image); - // Now hide the loading indicator, bring the tile in view and reenable the checkbox with its previous value - mMapLoadingIndicator->setVisible(false); - mMapPlaceholder->setVisible(true); - } - // Show the default icon if that's the checkbox value (the real one...) - // This will hide/show the loading indicator and/or tile underneath - mMapDefault->setVisible(!(mMapCheckBox->get())); - - LLPanel::draw(); -} - -void LLSocialCheckinPanel::onSend() -{ - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialCheckinPanel"); // just in case it is already listening - LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialCheckinPanel", boost::bind(&LLSocialCheckinPanel::onFacebookConnectStateChange, this, _1)); - - // Connect to Facebook if necessary and then post - if (LLFacebookConnect::instance().isConnected()) - { - sendCheckin(); - } - else - { - LLFacebookConnect::instance().checkConnectionToFacebook(true); - } -} - -bool LLSocialCheckinPanel::onFacebookConnectStateChange(const LLSD& data) -{ - switch (data.get("enum").asInteger()) - { - case LLFacebookConnect::FB_CONNECTED: - sendCheckin(); - break; - - case LLFacebookConnect::FB_POSTED: - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialCheckinPanel"); - clearAndClose(); - break; - } - - return false; -} - -void LLSocialCheckinPanel::sendCheckin() -{ - // Get the location SLURL - LLSLURL slurl; - LLAgentUI::buildSLURL(slurl); - std::string slurl_string = slurl.getSLURLString(); - - // Use a valid http:// URL if the scheme is secondlife:// - LLURI slurl_uri(slurl_string); - if (slurl_uri.scheme() == LLSLURL::SLURL_SECONDLIFE_SCHEME) - { - slurl_string = DEFAULT_CHECKIN_LOCATION_URL; - } - - // Add query parameters so Google Analytics can track incoming clicks! - slurl_string += DEFAULT_CHECKIN_QUERY_PARAMETERS; - - // Get the region name - std::string region_name(""); - LLViewerRegion *regionp = gAgent.getRegion(); - if (regionp) - { - region_name = regionp->getName(); - } - - // Get the region description - std::string description; - LLAgentUI::buildLocationString(description, LLAgentUI::LOCATION_FORMAT_NORMAL_COORDS, gAgent.getPositionAgent()); - - // Optionally add the region map view - bool add_map_view = mMapCheckBox->getValue().asBoolean(); - std::string map_url = (add_map_view ? get_map_url() : DEFAULT_CHECKIN_ICON_URL); - - // Get the caption - std::string caption = mMessageTextEditor->getValue().asString(); - - // Post to Facebook - LLFacebookConnect::instance().postCheckin(slurl_string, region_name, description, map_url, caption); -} - -void LLSocialCheckinPanel::clearAndClose() -{ - mMessageTextEditor->setValue(""); - - LLFloater* floater = getParentByType(); - if (floater) - { - floater->closeFloater(); - } -} - -/////////////////////////// -//LLSocialAccountPanel////// -/////////////////////////// - -LLSocialAccountPanel::LLSocialAccountPanel() : -mAccountCaptionLabel(NULL), -mAccountNameLabel(NULL), -mPanelButtons(NULL), -mConnectButton(NULL), -mDisconnectButton(NULL) -{ - mCommitCallbackRegistrar.add("SocialSharing.Connect", boost::bind(&LLSocialAccountPanel::onConnect, this)); - mCommitCallbackRegistrar.add("SocialSharing.Disconnect", boost::bind(&LLSocialAccountPanel::onDisconnect, this)); - - setVisibleCallback(boost::bind(&LLSocialAccountPanel::onVisibilityChange, this, _2)); -} - -BOOL LLSocialAccountPanel::postBuild() -{ - mAccountCaptionLabel = getChild("account_caption_label"); - mAccountNameLabel = getChild("account_name_label"); - mPanelButtons = getChild("panel_buttons"); - mConnectButton = getChild("connect_btn"); - mDisconnectButton = getChild("disconnect_btn"); - - return LLPanel::postBuild(); -} - -void LLSocialAccountPanel::draw() -{ - LLFacebookConnect::EConnectionState connection_state = LLFacebookConnect::instance().getConnectionState(); - - //Disable the 'disconnect' button and the 'use another account' button when disconnecting in progress - bool disconnecting = connection_state == LLFacebookConnect::FB_DISCONNECTING; - mDisconnectButton->setEnabled(!disconnecting); - - //Disable the 'connect' button when a connection is in progress - bool connecting = connection_state == LLFacebookConnect::FB_CONNECTION_IN_PROGRESS; - mConnectButton->setEnabled(!connecting); - - LLPanel::draw(); -} - -void LLSocialAccountPanel::onVisibilityChange(const LLSD& new_visibility) -{ - bool visible = new_visibility.asBoolean(); - - if(visible) - { - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialAccountPanel"); - LLEventPumps::instance().obtain("FacebookConnectState").listen("LLSocialAccountPanel", boost::bind(&LLSocialAccountPanel::onFacebookConnectStateChange, this, _1)); - - LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLSocialAccountPanel"); - LLEventPumps::instance().obtain("FacebookConnectInfo").listen("LLSocialAccountPanel", boost::bind(&LLSocialAccountPanel::onFacebookConnectInfoChange, this)); - - //Connected - if(LLFacebookConnect::instance().isConnected()) - { - showConnectedLayout(); - } - //Check if connected (show disconnected layout in meantime) - else - { - showDisconnectedLayout(); - } - if ((LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_NOT_CONNECTED) || - (LLFacebookConnect::instance().getConnectionState() == LLFacebookConnect::FB_CONNECTION_FAILED)) - { - LLFacebookConnect::instance().checkConnectionToFacebook(); - } - } - else - { - LLEventPumps::instance().obtain("FacebookConnectState").stopListening("LLSocialAccountPanel"); - LLEventPumps::instance().obtain("FacebookConnectInfo").stopListening("LLSocialAccountPanel"); - } -} - -bool LLSocialAccountPanel::onFacebookConnectStateChange(const LLSD& data) -{ - if(LLFacebookConnect::instance().isConnected()) - { - //In process of disconnecting so leave the layout as is - if(data.get("enum").asInteger() != LLFacebookConnect::FB_DISCONNECTING) - { - showConnectedLayout(); - } - } - else - { - showDisconnectedLayout(); - } - - return false; -} - -bool LLSocialAccountPanel::onFacebookConnectInfoChange() -{ - LLSD info = LLFacebookConnect::instance().getInfo(); - std::string clickable_name; - - //Strings of format [http://www.somewebsite.com Click Me] become clickable text - if(info.has("link") && info.has("name")) - { - clickable_name = "[" + info["link"].asString() + " " + info["name"].asString() + "]"; - } - - mAccountNameLabel->setText(clickable_name); - - return false; -} - -void LLSocialAccountPanel::showConnectButton() -{ - if(!mConnectButton->getVisible()) - { - mConnectButton->setVisible(TRUE); - mDisconnectButton->setVisible(FALSE); - } -} - -void LLSocialAccountPanel::hideConnectButton() -{ - if(mConnectButton->getVisible()) - { - mConnectButton->setVisible(FALSE); - mDisconnectButton->setVisible(TRUE); - } -} - -void LLSocialAccountPanel::showDisconnectedLayout() -{ - mAccountCaptionLabel->setText(getString("facebook_disconnected")); - mAccountNameLabel->setText(std::string("")); - showConnectButton(); -} - -void LLSocialAccountPanel::showConnectedLayout() -{ - LLFacebookConnect::instance().loadFacebookInfo(); - - mAccountCaptionLabel->setText(getString("facebook_connected")); - hideConnectButton(); -} - -void LLSocialAccountPanel::onConnect() -{ - LLFacebookConnect::instance().checkConnectionToFacebook(true); - - //Clear only the facebook browser cookies so that the facebook login screen appears - LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com"); -} - -void LLSocialAccountPanel::onDisconnect() -{ - LLFacebookConnect::instance().disconnectFromFacebook(); - - LLViewerMedia::getCookieStore()->removeCookiesByDomain(".facebook.com"); -} - -//////////////////////// -//LLFloaterSocial/////// -//////////////////////// - -LLFloaterSocial::LLFloaterSocial(const LLSD& key) : LLFloater(key), - mSocialPhotoPanel(NULL), - mStatusErrorText(NULL), - mStatusLoadingText(NULL), - mStatusLoadingIndicator(NULL) -{ - mCommitCallbackRegistrar.add("SocialSharing.Cancel", boost::bind(&LLFloaterSocial::onCancel, this)); -} - -void LLFloaterSocial::onCancel() -{ - closeFloater(); -} - -BOOL LLFloaterSocial::postBuild() -{ - // Keep tab of the Photo Panel - mSocialPhotoPanel = static_cast(getChild("panel_social_photo")); - // Connection status widgets - mStatusErrorText = getChild("connection_error_text"); - mStatusLoadingText = getChild("connection_loading_text"); - mStatusLoadingIndicator = getChild("connection_loading_indicator"); - return LLFloater::postBuild(); -} - -void LLFloaterSocial::showPhotoPanel() -{ - LLTabContainer* parent = dynamic_cast(mSocialPhotoPanel->getParent()); - if (!parent) - { - llwarns << "Cannot find panel container" << llendl; - return; - } - - parent->selectTabPanel(mSocialPhotoPanel); -} - -// static -void LLFloaterSocial::preUpdate() -{ - LLFloaterSocial* instance = LLFloaterReg::findTypedInstance("social"); - if (instance) - { - //Will set file size text to 'unknown' - instance->mSocialPhotoPanel->updateControls(); - } -} - -// static -void LLFloaterSocial::postUpdate() -{ - LLFloaterSocial* instance = LLFloaterReg::findTypedInstance("social"); - if (instance) - { - //Will set the file size text - instance->mSocialPhotoPanel->updateControls(); - - // The refresh button is initially hidden. We show it after the first update, - // i.e. after snapshot is taken - LLUICtrl * refresh_button = instance->mSocialPhotoPanel->getRefreshBtn(); - - if (!refresh_button->getVisible()) - { - refresh_button->setVisible(true); - } - - } -} - -void LLFloaterSocial::draw() -{ - if (mStatusErrorText && mStatusLoadingText && mStatusLoadingIndicator) - { - mStatusErrorText->setVisible(false); - mStatusLoadingText->setVisible(false); - mStatusLoadingIndicator->setVisible(false); - LLFacebookConnect::EConnectionState connection_state = LLFacebookConnect::instance().getConnectionState(); - std::string status_text; - - switch (connection_state) - { - case LLFacebookConnect::FB_NOT_CONNECTED: - // No status displayed when first opening the panel and no connection done - case LLFacebookConnect::FB_CONNECTED: - // When successfully connected, no message is displayed - case LLFacebookConnect::FB_POSTED: - // No success message to show since we actually close the floater after successful posting completion - break; - case LLFacebookConnect::FB_CONNECTION_IN_PROGRESS: - // Connection loading indicator - mStatusLoadingText->setVisible(true); - status_text = LLTrans::getString("SocialFacebookConnecting"); - mStatusLoadingText->setValue(status_text); - mStatusLoadingIndicator->setVisible(true); - break; - case LLFacebookConnect::FB_POSTING: - // Posting indicator - mStatusLoadingText->setVisible(true); - status_text = LLTrans::getString("SocialFacebookPosting"); - mStatusLoadingText->setValue(status_text); - mStatusLoadingIndicator->setVisible(true); - break; - case LLFacebookConnect::FB_CONNECTION_FAILED: - // Error connecting to the service - mStatusErrorText->setVisible(true); - status_text = LLTrans::getString("SocialFacebookErrorConnecting"); - mStatusErrorText->setValue(status_text); - break; - case LLFacebookConnect::FB_POST_FAILED: - // Error posting to the service - mStatusErrorText->setVisible(true); - status_text = LLTrans::getString("SocialFacebookErrorPosting"); - mStatusErrorText->setValue(status_text); - break; - case LLFacebookConnect::FB_DISCONNECTING: - // Disconnecting loading indicator - mStatusLoadingText->setVisible(true); - status_text = LLTrans::getString("SocialFacebookDisconnecting"); - mStatusLoadingText->setValue(status_text); - mStatusLoadingIndicator->setVisible(true); - break; - case LLFacebookConnect::FB_DISCONNECT_FAILED: - // Error disconnecting from the service - mStatusErrorText->setVisible(true); - status_text = LLTrans::getString("SocialFacebookErrorDisconnecting"); - mStatusErrorText->setValue(status_text); - break; - } - } - LLFloater::draw(); -} - diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h deleted file mode 100644 index 041ae8a268..0000000000 --- a/indra/newview/llfloatersocial.h +++ /dev/null @@ -1,167 +0,0 @@ -/** -* @file llfloatersocial.h -* @brief Header file for llfloatersocial -* @author Gilbert@lindenlab.com -* -* $LicenseInfo:firstyear=2013&license=viewerlgpl$ -* Second Life Viewer Source Code -* Copyright (C) 2013, Linden Research, Inc. -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; -* version 2.1 of the License only. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, write to the Free Software -* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -* -* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA -* $/LicenseInfo$ -*/ -#ifndef LL_LLFLOATERSOCIAL_H -#define LL_LLFLOATERSOCIAL_H - -#include "llfloater.h" -#include "lltextbox.h" -#include "llviewertexture.h" - -class LLIconCtrl; -class LLCheckBoxCtrl; -class LLSnapshotLivePreview; - -class LLSocialStatusPanel : public LLPanel -{ -public: - LLSocialStatusPanel(); - BOOL postBuild(); - void draw(); - void onSend(); - bool onFacebookConnectStateChange(const LLSD& data); - - void sendStatus(); - void clearAndClose(); - -private: - LLUICtrl* mMessageTextEditor; - LLUICtrl* mPostButton; - LLUICtrl* mCancelButton; -}; - -class LLSocialPhotoPanel : public LLPanel -{ -public: - LLSocialPhotoPanel(); - ~LLSocialPhotoPanel(); - - BOOL postBuild(); - void draw(); - - LLSnapshotLivePreview* getPreviewView(); - void onVisibilityChange(const LLSD& new_visibility); - void onClickNewSnapshot(); - void onSend(); - bool onFacebookConnectStateChange(const LLSD& data); - - void sendPhoto(); - void clearAndClose(); - - void updateControls(); - void updateResolution(BOOL do_update); - void checkAspectRatio(S32 index); - LLUICtrl* getRefreshBtn(); - -private: - LLHandle mPreviewHandle; - - LLUICtrl * mSnapshotPanel; - LLUICtrl * mResolutionComboBox; - LLUICtrl * mRefreshBtn; - LLUICtrl * mWorkingLabel; - LLUICtrl * mThumbnailPlaceholder; - LLUICtrl * mCaptionTextBox; - LLUICtrl * mLocationCheckbox; - LLUICtrl * mPostButton; - LLUICtrl* mCancelButton; -}; - -class LLSocialCheckinPanel : public LLPanel -{ -public: - LLSocialCheckinPanel(); - BOOL postBuild(); - void draw(); - void onSend(); - bool onFacebookConnectStateChange(const LLSD& data); - - void sendCheckin(); - void clearAndClose(); - -private: - std::string mMapUrl; - LLPointer mMapTexture; - LLUICtrl* mPostButton; - LLUICtrl* mCancelButton; - LLUICtrl* mMessageTextEditor; - LLUICtrl* mMapLoadingIndicator; - LLIconCtrl* mMapPlaceholder; - LLIconCtrl* mMapDefault; - LLCheckBoxCtrl* mMapCheckBox; - bool mReloadingMapTexture; -}; - -class LLSocialAccountPanel : public LLPanel -{ -public: - LLSocialAccountPanel(); - BOOL postBuild(); - void draw(); - -private: - void onVisibilityChange(const LLSD& new_visibility); - bool onFacebookConnectStateChange(const LLSD& data); - bool onFacebookConnectInfoChange(); - void onConnect(); - void onUseAnotherAccount(); - void onDisconnect(); - - void showConnectButton(); - void hideConnectButton(); - void showDisconnectedLayout(); - void showConnectedLayout(); - - LLTextBox * mAccountCaptionLabel; - LLTextBox * mAccountNameLabel; - LLUICtrl * mPanelButtons; - LLUICtrl * mConnectButton; - LLUICtrl * mDisconnectButton; -}; - - -class LLFloaterSocial : public LLFloater -{ -public: - LLFloaterSocial(const LLSD& key); - BOOL postBuild(); - void draw(); - void onCancel(); - - void showPhotoPanel(); - - static void preUpdate(); - static void postUpdate(); - -private: - LLSocialPhotoPanel* mSocialPhotoPanel; - LLTextBox* mStatusErrorText; - LLTextBox* mStatusLoadingText; - LLUICtrl* mStatusLoadingIndicator; -}; - -#endif // LL_LLFLOATERSOCIAL_H - diff --git a/indra/newview/llfloatertwitter.cpp b/indra/newview/llfloatertwitter.cpp index 82ed066b1a..18a1fcbba9 100644 --- a/indra/newview/llfloatertwitter.cpp +++ b/indra/newview/llfloatertwitter.cpp @@ -622,7 +622,7 @@ void LLTwitterAccountPanel::onDisconnect() //////////////////////// LLFloaterTwitter::LLFloaterTwitter(const LLSD& key) : LLFloater(key), - mSocialPhotoPanel(NULL), + mTwitterPhotoPanel(NULL), mStatusErrorText(NULL), mStatusLoadingText(NULL), mStatusLoadingIndicator(NULL) @@ -638,7 +638,7 @@ void LLFloaterTwitter::onCancel() BOOL LLFloaterTwitter::postBuild() { // Keep tab of the Photo Panel - mSocialPhotoPanel = static_cast(getChild("panel_twitter_photo")); + mTwitterPhotoPanel = static_cast(getChild("panel_twitter_photo")); // Connection status widgets mStatusErrorText = getChild("connection_error_text"); mStatusLoadingText = getChild("connection_loading_text"); @@ -648,14 +648,14 @@ BOOL LLFloaterTwitter::postBuild() void LLFloaterTwitter::showPhotoPanel() { - LLTabContainer* parent = dynamic_cast(mSocialPhotoPanel->getParent()); + LLTabContainer* parent = dynamic_cast(mTwitterPhotoPanel->getParent()); if (!parent) { llwarns << "Cannot find panel container" << llendl; return; } - parent->selectTabPanel(mSocialPhotoPanel); + parent->selectTabPanel(mTwitterPhotoPanel); } // static @@ -665,7 +665,7 @@ void LLFloaterTwitter::preUpdate() if (instance) { //Will set file size text to 'unknown' - instance->mSocialPhotoPanel->updateControls(); + instance->mTwitterPhotoPanel->updateControls(); } } @@ -676,11 +676,11 @@ void LLFloaterTwitter::postUpdate() if (instance) { //Will set the file size text - instance->mSocialPhotoPanel->updateControls(); + instance->mTwitterPhotoPanel->updateControls(); // The refresh button is initially hidden. We show it after the first update, // i.e. after snapshot is taken - LLUICtrl * refresh_button = instance->mSocialPhotoPanel->getRefreshBtn(); + LLUICtrl * refresh_button = instance->mTwitterPhotoPanel->getRefreshBtn(); if (!refresh_button->getVisible()) { diff --git a/indra/newview/llfloatertwitter.h b/indra/newview/llfloatertwitter.h index 5305143552..f267f76694 100644 --- a/indra/newview/llfloatertwitter.h +++ b/indra/newview/llfloatertwitter.h @@ -121,7 +121,7 @@ public: static void postUpdate(); private: - LLTwitterPhotoPanel* mSocialPhotoPanel; + LLTwitterPhotoPanel* mTwitterPhotoPanel; LLTextBox* mStatusErrorText; LLTextBox* mStatusLoadingText; LLUICtrl* mStatusLoadingIndicator; diff --git a/indra/newview/llpanelsnapshotoptions.cpp b/indra/newview/llpanelsnapshotoptions.cpp index 4cadd837d1..a7b9b6d22e 100755 --- a/indra/newview/llpanelsnapshotoptions.cpp +++ b/indra/newview/llpanelsnapshotoptions.cpp @@ -32,7 +32,7 @@ #include "llfloatersnapshot.h" // FIXME: create a snapshot model #include "llfloaterreg.h" -#include "llfloatersocial.h" +#include "llfloaterfacebook.h" #include "llfloaterflickr.h" #include "llfloatertwitter.h" @@ -144,12 +144,12 @@ void LLPanelSnapshotOptions::onSendToFacebook() { LLFloaterReg::hideInstance("snapshot"); - LLFloaterSocial* social_floater = dynamic_cast(LLFloaterReg::getInstance("social")); - if (social_floater) + LLFloaterFacebook* facebook_floater = dynamic_cast(LLFloaterReg::getInstance("facebook")); + if (facebook_floater) { - social_floater->showPhotoPanel(); + facebook_floater->showPhotoPanel(); } - LLFloaterReg::showInstance("social"); + LLFloaterReg::showInstance("facebook"); } void LLPanelSnapshotOptions::onSendToTwitter() diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp index 67952f83c7..9feeea1644 100644 --- a/indra/newview/llsnapshotlivepreview.cpp +++ b/indra/newview/llsnapshotlivepreview.cpp @@ -34,7 +34,7 @@ #include "lleconomy.h" #include "llfloaterperms.h" #include "llfloaterreg.h" -#include "llfloatersocial.h" +#include "llfloaterfacebook.h" #include "llfloaterflickr.h" #include "llfloatertwitter.h" #include "llimagebmp.h" @@ -210,7 +210,7 @@ void LLSnapshotLivePreview::updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail mSnapshotDelayTimer.start(); mSnapshotDelayTimer.setTimerExpirySec(delay); LLFloaterSnapshot::preUpdate(); - LLFloaterSocial::preUpdate(); + LLFloaterFacebook::preUpdate(); LLFloaterFlickr::preUpdate(); LLFloaterTwitter::preUpdate(); } @@ -769,7 +769,7 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) } lldebugs << "done creating snapshot" << llendl; LLFloaterSnapshot::postUpdate(); - LLFloaterSocial::postUpdate(); + LLFloaterFacebook::postUpdate(); LLFloaterFlickr::postUpdate(); LLFloaterTwitter::postUpdate(); diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 1e07aaf5ec..e38ffbbc63 100755 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -60,6 +60,7 @@ #include "llfloatereditwater.h" #include "llfloaterenvironmentsettings.h" #include "llfloaterevent.h" +#include "llfloaterfacebook.h" #include "llfloaterflickr.h" #include "llfloaterfonttest.h" #include "llfloatergesture.h" @@ -104,7 +105,6 @@ #include "llfloatersettingsdebug.h" #include "llfloatersidepanelcontainer.h" #include "llfloatersnapshot.h" -#include "llfloatersocial.h" #include "llfloatersounddevices.h" #include "llfloaterspellchecksettings.h" #include "llfloatertelehub.h" @@ -306,9 +306,6 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("sell_land", "floater_sell_land.xml", &LLFloaterSellLand::buildFloater); LLFloaterReg::add("settings_debug", "floater_settings_debug.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("sound_devices", "floater_sound_devices.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); - LLFloaterReg::add("social", "floater_social.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); - LLFloaterReg::add("flickr", "floater_flickr.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); - LLFloaterReg::add("twitter", "floater_twitter.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("stats", "floater_stats.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("start_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("stop_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); @@ -317,10 +314,15 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("my_profile", "floater_my_web_profile.xml", (LLFloaterBuildFunc)&LLFloaterWebProfile::create); LLFloaterReg::add("profile", "floater_web_profile.xml", (LLFloaterBuildFunc)&LLFloaterWebProfile::create); LLFloaterReg::add("how_to", "floater_how_to.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create); + LLFloaterReg::add("fbc_web", "floater_fbc_web.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create); LLFloaterReg::add("flickr_web", "floater_fbc_web.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create); LLFloaterReg::add("twitter_web", "floater_fbc_web.xml", (LLFloaterBuildFunc)&LLFloaterWebContent::create); + LLFloaterReg::add("facebook", "floater_facebook.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterReg::add("flickr", "floater_flickr.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterReg::add("twitter", "floater_twitter.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterUIPreviewUtil::registerFloater(); LLFloaterReg::add("upload_anim_bvh", "floater_animation_bvh_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build, "upload"); LLFloaterReg::add("upload_anim_anim", "floater_animation_anim_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build, "upload"); diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index e42743824e..751558fc93 100755 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -133,6 +133,8 @@ with the same filename but different name + + @@ -148,11 +150,9 @@ with the same filename but different name - - - + diff --git a/indra/newview/skins/default/xui/en/floater_facebook.xml b/indra/newview/skins/default/xui/en/floater_facebook.xml new file mode 100644 index 0000000000..820e105e53 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_facebook.xml @@ -0,0 +1,101 @@ + + + + + + + + + + + + Error + + + + Loading... + + + + diff --git a/indra/newview/skins/default/xui/en/floater_social.xml b/indra/newview/skins/default/xui/en/floater_social.xml deleted file mode 100644 index b7ff374d5f..0000000000 --- a/indra/newview/skins/default/xui/en/floater_social.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - Error - - - - Loading... - - - - diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 79adb4e8bb..905988e09d 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -285,7 +285,7 @@ name="Facebook"> + parameter="facebook"/> + + + + Not connected to Facebook. + + + + + + + + [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share/ta-p/2149711 Learn about posting to Facebook] + + + diff --git a/indra/newview/skins/default/xui/en/panel_facebook_photo.xml b/indra/newview/skins/default/xui/en/panel_facebook_photo.xml new file mode 100644 index 0000000000..19f9f2fb74 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_facebook_photo.xml @@ -0,0 +1,152 @@ + + + + + + + + + + + [SIZE] KB + + + + + + Refreshing... + + + Comment (optional): + + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/en/panel_facebook_place.xml b/indra/newview/skins/default/xui/en/panel_facebook_place.xml new file mode 100644 index 0000000000..1eea8f317b --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_facebook_place.xml @@ -0,0 +1,132 @@ + + + + + Say something about where you are: + + + + + + + + + + + + + + + Include overhead view of location + + + + + + + + diff --git a/indra/newview/skins/default/xui/en/panel_facebook_status.xml b/indra/newview/skins/default/xui/en/panel_facebook_status.xml new file mode 100644 index 0000000000..50e15c2e80 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_facebook_status.xml @@ -0,0 +1,67 @@ + + + + + What's on your mind? + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/en/panel_social_account.xml b/indra/newview/skins/default/xui/en/panel_social_account.xml deleted file mode 100644 index d7235396fe..0000000000 --- a/indra/newview/skins/default/xui/en/panel_social_account.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - Not connected to Facebook. - - - - - - - - [http://community.secondlife.com/t5/English-Knowledge-Base/Second-Life-Share/ta-p/2149711 Learn about posting to Facebook] - - - diff --git a/indra/newview/skins/default/xui/en/panel_social_photo.xml b/indra/newview/skins/default/xui/en/panel_social_photo.xml deleted file mode 100644 index a55613b52a..0000000000 --- a/indra/newview/skins/default/xui/en/panel_social_photo.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - - - - - [SIZE] KB - - - - - - Refreshing... - - - Comment (optional): - - - - - - - - - - - diff --git a/indra/newview/skins/default/xui/en/panel_social_place.xml b/indra/newview/skins/default/xui/en/panel_social_place.xml deleted file mode 100644 index 13e94f6998..0000000000 --- a/indra/newview/skins/default/xui/en/panel_social_place.xml +++ /dev/null @@ -1,132 +0,0 @@ - - - - - Say something about where you are: - - - - - - - - - - - - - - - Include overhead view of location - - - - - - - - diff --git a/indra/newview/skins/default/xui/en/panel_social_status.xml b/indra/newview/skins/default/xui/en/panel_social_status.xml deleted file mode 100644 index 54cfa3f524..0000000000 --- a/indra/newview/skins/default/xui/en/panel_social_status.xml +++ /dev/null @@ -1,67 +0,0 @@ - - - - - What's on your mind? - - - - - - - - - - diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index b24cca588e..3806e1287c 100755 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3877,6 +3877,8 @@ Try enclosing path to the editor with double quotes. Conversations Compass Destinations + Facebook + Flickr Gestures How to Inventory @@ -3892,10 +3894,8 @@ Try enclosing path to the editor with double quotes. Profile Search Snapshot - Facebook - Flickr - Twitter Speak + Twitter Camera controls Voice settings @@ -3907,6 +3907,8 @@ Try enclosing path to the editor with double quotes. Converse with everyone Compass Destinations of interest + Post to Facebook + Upload to Flickr Gestures for your avatar How to do common tasks View and use your belongings @@ -3922,10 +3924,8 @@ Try enclosing path to the editor with double quotes. Edit or view your profile Find places, events, people Take a picture - Post to Facebook - Upload to Flickr - Twitter Speak with people nearby using your microphone + Twitter Changing camera angle Volume controls for calls and people near you in world -- cgit v1.2.3