From be23aaefe53cd245752d3973bf930c87f67c6253 Mon Sep 17 00:00:00 2001 From: Cho Date: Thu, 7 Nov 2013 01:30:36 +0000 Subject: added title, descriptions, tags, and safety level to panel_flickr_photo.xml for ACME-1142 --- indra/newview/llfloaterflickr.cpp | 40 ++++++--- indra/newview/llfloaterflickr.h | 5 +- .../skins/default/xui/en/floater_flickr.xml | 6 +- .../skins/default/xui/en/panel_flickr_account.xml | 2 +- .../skins/default/xui/en/panel_flickr_photo.xml | 98 ++++++++++++++++++++-- .../skins/default/xui/en/panel_twitter_photo.xml | 2 +- 6 files changed, 126 insertions(+), 27 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterflickr.cpp b/indra/newview/llfloaterflickr.cpp index 290d174619..1edc61fcf6 100644 --- a/indra/newview/llfloaterflickr.cpp +++ b/indra/newview/llfloaterflickr.cpp @@ -63,8 +63,11 @@ mResolutionComboBox(NULL), mRefreshBtn(NULL), mWorkingLabel(NULL), mThumbnailPlaceholder(NULL), -mCaptionTextBox(NULL), +mTitleTextBox(NULL), +mDescriptionTextBox(NULL), mLocationCheckbox(NULL), +mTagsTextBox(NULL), +mRatingComboBox(NULL), mPostButton(NULL) { mCommitCallbackRegistrar.add("SocialSharing.SendPhoto", boost::bind(&LLFlickrPhotoPanel::onSend, this)); @@ -89,8 +92,11 @@ BOOL LLFlickrPhotoPanel::postBuild() mRefreshBtn = getChild("new_snapshot_btn"); mWorkingLabel = getChild("working_lbl"); mThumbnailPlaceholder = getChild("thumbnail_placeholder"); - mCaptionTextBox = getChild("photo_caption"); + mTitleTextBox = getChild("photo_title"); + mDescriptionTextBox = getChild("photo_description"); mLocationCheckbox = getChild("add_location_cb"); + mTagsTextBox = getChild("photo_tags"); + mRatingComboBox = getChild("rating_combobox"); mPostButton = getChild("post_photo_btn"); mCancelButton = getChild("cancel_photo_btn"); @@ -104,7 +110,10 @@ void LLFlickrPhotoPanel::draw() // Enable interaction only if no transaction with the service is on-going (prevent duplicated posts) bool no_ongoing_connection = !(LLFlickrConnect::instance().isTransactionOngoing()); mCancelButton->setEnabled(no_ongoing_connection); - mCaptionTextBox->setEnabled(no_ongoing_connection); + mTitleTextBox->setEnabled(no_ongoing_connection); + mDescriptionTextBox->setEnabled(no_ongoing_connection); + mTagsTextBox->setEnabled(no_ongoing_connection); + mRatingComboBox->setEnabled(no_ongoing_connection); mResolutionComboBox->setEnabled(no_ongoing_connection); mRefreshBtn->setEnabled(no_ongoing_connection); mLocationCheckbox->setEnabled(no_ongoing_connection); @@ -144,7 +153,7 @@ void LLFlickrPhotoPanel::draw() 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())); + mPostButton->setEnabled(no_ongoing_connection && (previewp && previewp->getSnapshotUpToDate()) && (mRatingComboBox && mRatingComboBox->getValue().isDefined())); // Draw the rest of the panel on top of it LLPanel::draw(); @@ -234,8 +243,10 @@ bool LLFlickrPhotoPanel::onFlickrConnectStateChange(const LLSD& data) void LLFlickrPhotoPanel::sendPhoto() { - // Get the caption - std::string caption = mCaptionTextBox->getValue().asString(); + // Get the title, description, and tags + std::string title = mTitleTextBox->getValue().asString(); + std::string description = mDescriptionTextBox->getValue().asString(); + std::string tags = mTagsTextBox->getValue().asString(); // Add the location if required bool add_location = mLocationCheckbox->getValue().asBoolean(); @@ -249,25 +260,30 @@ void LLFlickrPhotoPanel::sendPhoto() // 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; + // Add it to the description (pretty crude, but we don't have a better option with photos) + if (description.empty()) + description = slurl_string; else - caption = caption + " " + slurl_string; + description = description + " " + slurl_string; } + // Get the content rating + int content_rating = mRatingComboBox->getValue().asInteger(); + // Get the image LLSnapshotLivePreview* previewp = getPreviewView(); // Post to Flickr - LLFlickrConnect::instance().uploadPhoto(previewp->getFormattedImage(), "", caption, "", 1); + LLFlickrConnect::instance().uploadPhoto(previewp->getFormattedImage(), title, description, tags, content_rating); updateControls(); } void LLFlickrPhotoPanel::clearAndClose() { - mCaptionTextBox->setValue(""); + mTitleTextBox->setValue(""); + mDescriptionTextBox->setValue(""); + mTagsTextBox->setValue(""); LLFloater* floater = getParentByType(); if (floater) diff --git a/indra/newview/llfloaterflickr.h b/indra/newview/llfloaterflickr.h index d98a470d5c..8cf2cd2dd6 100644 --- a/indra/newview/llfloaterflickr.h +++ b/indra/newview/llfloaterflickr.h @@ -66,8 +66,11 @@ private: LLUICtrl * mRefreshBtn; LLUICtrl * mWorkingLabel; LLUICtrl * mThumbnailPlaceholder; - LLUICtrl * mCaptionTextBox; + LLUICtrl * mTitleTextBox; + LLUICtrl * mDescriptionTextBox; LLUICtrl * mLocationCheckbox; + LLUICtrl * mTagsTextBox; + LLUICtrl * mRatingComboBox; LLUICtrl * mPostButton; LLUICtrl* mCancelButton; }; diff --git a/indra/newview/skins/default/xui/en/floater_flickr.xml b/indra/newview/skins/default/xui/en/floater_flickr.xml index 441e3ee73d..57014f8427 100644 --- a/indra/newview/skins/default/xui/en/floater_flickr.xml +++ b/indra/newview/skins/default/xui/en/floater_flickr.xml @@ -10,10 +10,10 @@ single_instance="true" reuse_instance="true" title="UPLOAD TO FLICKR" - height="482" + height="622" width="304"> diff --git a/indra/newview/skins/default/xui/en/panel_flickr_photo.xml b/indra/newview/skins/default/xui/en/panel_flickr_photo.xml index 1fc4927ac2..d7d3fb6c1b 100644 --- a/indra/newview/skins/default/xui/en/panel_flickr_photo.xml +++ b/indra/newview/skins/default/xui/en/panel_flickr_photo.xml @@ -1,19 +1,19 @@ + height="507"> - Comment (optional): + Title: + + + Description: + + + + Tags: + + +Separate tags with spaces +Use "" for multi-word tags + + + + + + + +