diff options
author | Cho <cho@lindenlab.com> | 2013-11-07 19:06:39 +0000 |
---|---|---|
committer | Cho <cho@lindenlab.com> | 2013-11-07 19:06:39 +0000 |
commit | 389ddfd5add78998aaadb171593b5b036d2dbee0 (patch) | |
tree | 20827050183e768b7b61cba7db5c1d62284cfc65 /indra | |
parent | be23aaefe53cd245752d3973bf930c87f67c6253 (diff) |
updated panel_twitter_photo.xml to match design spec for ACME-1153
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llfloatertwitter.cpp | 61 | ||||
-rw-r--r-- | indra/newview/llfloatertwitter.h | 4 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_twitter_photo.xml | 70 |
3 files changed, 65 insertions, 70 deletions
diff --git a/indra/newview/llfloatertwitter.cpp b/indra/newview/llfloatertwitter.cpp index b45cf32945..5a2402cdd6 100644 --- a/indra/newview/llfloatertwitter.cpp +++ b/indra/newview/llfloatertwitter.cpp @@ -63,8 +63,8 @@ mResolutionComboBox(NULL), mRefreshBtn(NULL), mWorkingLabel(NULL), mThumbnailPlaceholder(NULL), -mCaptionTextBox(NULL), -mLocationCheckbox(NULL), +mStatusTextBox(NULL), +mPhotoCheckbox(NULL), mPostButton(NULL) { mCommitCallbackRegistrar.add("SocialSharing.SendPhoto", boost::bind(&LLTwitterPhotoPanel::onSend, this)); @@ -89,8 +89,8 @@ BOOL LLTwitterPhotoPanel::postBuild() mRefreshBtn = getChild<LLUICtrl>("new_snapshot_btn"); mWorkingLabel = getChild<LLUICtrl>("working_lbl"); mThumbnailPlaceholder = getChild<LLUICtrl>("thumbnail_placeholder"); - mCaptionTextBox = getChild<LLUICtrl>("photo_caption"); - mLocationCheckbox = getChild<LLUICtrl>("add_location_cb"); + mStatusTextBox = getChild<LLUICtrl>("photo_status"); + mPhotoCheckbox = getChild<LLUICtrl>("add_photo_cb"); mPostButton = getChild<LLUICtrl>("post_photo_btn"); mCancelButton = getChild<LLUICtrl>("cancel_photo_btn"); @@ -104,11 +104,11 @@ void LLTwitterPhotoPanel::draw() // Enable interaction only if no transaction with the service is on-going (prevent duplicated posts) bool no_ongoing_connection = !(LLTwitterConnect::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); - + mStatusTextBox->setEnabled(no_ongoing_connection); + mResolutionComboBox->setEnabled(no_ongoing_connection && mPhotoCheckbox->getValue().asBoolean()); + mRefreshBtn->setEnabled(no_ongoing_connection && mPhotoCheckbox->getValue().asBoolean()); + mPhotoCheckbox->setEnabled(no_ongoing_connection); + // Display the preview if one is available if (previewp && previewp->getThumbnailImage()) { @@ -131,7 +131,7 @@ void LLTwitterPhotoPanel::draw() gGL.matrixMode(LLRender::MM_MODELVIEW); // Apply floater transparency to the texture unless the floater is focused. - F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency(); + F32 alpha = (mPhotoCheckbox->getValue().asBoolean() ? (getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency()) : 0.5f); LLColor4 color = LLColor4::white; gl_draw_scaled_image(offset_x, offset_y, thumbnail_w, thumbnail_h, @@ -234,40 +234,31 @@ bool LLTwitterPhotoPanel::onTwitterConnectStateChange(const LLSD& data) void LLTwitterPhotoPanel::sendPhoto() { - // Get the caption - std::string caption = mCaptionTextBox->getValue().asString(); + // Get the status text + std::string status = mStatusTextBox->getValue().asString(); - // Add the location if required - bool add_location = mLocationCheckbox->getValue().asBoolean(); - if (add_location) + // Add the photo if required + bool add_photo = mPhotoCheckbox->getValue().asBoolean(); + if (add_photo) { - // 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(); + // Get the image + LLSnapshotLivePreview* previewp = getPreviewView(); - // Post to Twitter - LLTwitterConnect::instance().uploadPhoto(previewp->getFormattedImage(), caption); + // Post to Twitter + LLTwitterConnect::instance().uploadPhoto(previewp->getFormattedImage(), status); + } + else + { + // Just post the status to Twitter + LLTwitterConnect::instance().updateStatus(status); + } updateControls(); } void LLTwitterPhotoPanel::clearAndClose() { - mCaptionTextBox->setValue(""); + mStatusTextBox->setValue(""); LLFloater* floater = getParentByType<LLFloater>(); if (floater) diff --git a/indra/newview/llfloatertwitter.h b/indra/newview/llfloatertwitter.h index d0c7b57eef..090e01872a 100644 --- a/indra/newview/llfloatertwitter.h +++ b/indra/newview/llfloatertwitter.h @@ -66,8 +66,8 @@ private: LLUICtrl * mRefreshBtn; LLUICtrl * mWorkingLabel; LLUICtrl * mThumbnailPlaceholder; - LLUICtrl * mCaptionTextBox; - LLUICtrl * mLocationCheckbox; + LLUICtrl * mStatusTextBox; + LLUICtrl * mPhotoCheckbox; LLUICtrl * mPostButton; LLUICtrl* mCancelButton; }; diff --git a/indra/newview/skins/default/xui/en/panel_twitter_photo.xml b/indra/newview/skins/default/xui/en/panel_twitter_photo.xml index 540bc0f807..84206c608b 100644 --- a/indra/newview/skins/default/xui/en/panel_twitter_photo.xml +++ b/indra/newview/skins/default/xui/en/panel_twitter_photo.xml @@ -11,9 +11,43 @@ orientation="vertical" name="stack_photo" top="8"> - <layout_panel - name="snapshot_panel" - height="367"> + <layout_panel + name="text_panel" + height="140"> + <text + length="1" + follows="top|left|right" + font="SansSerif" + height="16" + left="9" + name="status_label" + top="3" + type="string"> + What's happening? + </text> + <text_editor + follows="left|top" + height="87" + width="250" + left="9" + length="1" + max_length="700" + name="photo_status" + type="string" + word_wrap="true"> + </text_editor> + <check_box + follows="left|top" + initial_value="true" + label="Include a photo" + name="add_photo_cb" + left="9" + height="16" + top_pad="10"/> + </layout_panel> + <layout_panel + name="snapshot_panel" + height="227"> <combo_box control_name="SocialPhotoResolution" follows="left|top" @@ -91,36 +125,6 @@ width="150"> Refreshing... </text> - <text - length="1" - follows="top|left|right" - font="SansSerif" - height="16" - left="9" - name="caption_label" - top_pad="20" - type="string"> - Comment (optional): - </text> - <text_editor - follows="left|top" - height="87" - width="250" - left="9" - length="1" - max_length="700" - name="photo_caption" - type="string" - word_wrap="true"> - </text_editor> - <check_box - follows="left|top" - initial_value="true" - label="Include location in posting" - name="add_location_cb" - left="9" - height="16" - top_pad="8"/> </layout_panel> <layout_panel name="photo_button_panel" |