summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCho <cho@lindenlab.com>2013-11-08 00:33:14 +0000
committerCho <cho@lindenlab.com>2013-11-08 00:33:14 +0000
commit15434d53ea1f1bca37b7b9d6d569b3cb61d09bbe (patch)
treef271bcde249573bb5711a0e23655f3fff63fe898
parent389ddfd5add78998aaadb171593b5b036d2dbee0 (diff)
added SLShare links to snapshot floater for ACME-1167
-rw-r--r--indra/newview/llfloatertwitter.cpp6
-rwxr-xr-xindra/newview/llpanelsnapshotoptions.cpp36
-rwxr-xr-xindra/newview/skins/default/xui/en/floater_snapshot.xml2
-rwxr-xr-xindra/newview/skins/default/xui/en/panel_snapshot_options.xml36
4 files changed, 77 insertions, 3 deletions
diff --git a/indra/newview/llfloatertwitter.cpp b/indra/newview/llfloatertwitter.cpp
index 5a2402cdd6..1324bd5fd8 100644
--- a/indra/newview/llfloatertwitter.cpp
+++ b/indra/newview/llfloatertwitter.cpp
@@ -109,6 +109,8 @@ void LLTwitterPhotoPanel::draw()
mRefreshBtn->setEnabled(no_ongoing_connection && mPhotoCheckbox->getValue().asBoolean());
mPhotoCheckbox->setEnabled(no_ongoing_connection);
+ bool add_photo = mPhotoCheckbox->getValue().asBoolean();
+
// Display the preview if one is available
if (previewp && previewp->getThumbnailImage())
{
@@ -131,7 +133,7 @@ void LLTwitterPhotoPanel::draw()
gGL.matrixMode(LLRender::MM_MODELVIEW);
// Apply floater transparency to the texture unless the floater is focused.
- F32 alpha = (mPhotoCheckbox->getValue().asBoolean() ? (getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency()) : 0.5f);
+ F32 alpha = (add_photo ? (getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency()) : 0.5f);
LLColor4 color = LLColor4::white;
gl_draw_scaled_image(offset_x, offset_y,
thumbnail_w, thumbnail_h,
@@ -144,7 +146,7 @@ void LLTwitterPhotoPanel::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 && ((add_photo && previewp && previewp->getSnapshotUpToDate()) || !mStatusTextBox->getValue().asString().empty()));
// Draw the rest of the panel on top of it
LLPanel::draw();
diff --git a/indra/newview/llpanelsnapshotoptions.cpp b/indra/newview/llpanelsnapshotoptions.cpp
index 554fabe5b3..1967c50a29 100755
--- a/indra/newview/llpanelsnapshotoptions.cpp
+++ b/indra/newview/llpanelsnapshotoptions.cpp
@@ -31,6 +31,7 @@
#include "llsidetraypanelcontainer.h"
#include "llfloatersnapshot.h" // FIXME: create a snapshot model
+#include "llfloaterreg.h"
/**
* Provides several ways to save a snapshot.
@@ -44,6 +45,7 @@ class LLPanelSnapshotOptions
public:
LLPanelSnapshotOptions();
~LLPanelSnapshotOptions();
+ /*virtual*/ BOOL postBuild();
/*virtual*/ void onOpen(const LLSD& key);
/*virtual*/ void onEconomyDataChange() { updateUploadCost(); }
@@ -54,6 +56,9 @@ private:
void onSaveToEmail();
void onSaveToInventory();
void onSaveToComputer();
+ void onSendToFacebook();
+ void onSendToTwitter();
+ void onSendToFlickr();
};
static LLRegisterPanelClassWrapper<LLPanelSnapshotOptions> panel_class("llpanelsnapshotoptions");
@@ -74,6 +79,19 @@ LLPanelSnapshotOptions::~LLPanelSnapshotOptions()
}
// virtual
+BOOL LLPanelSnapshotOptions::postBuild()
+{
+ LLTextBox* sendToFacebookTextBox = getChild<LLTextBox>("send_to_facebook_textbox");
+ sendToFacebookTextBox->setURLClickedCallback(boost::bind(&LLPanelSnapshotOptions::onSendToFacebook, this));
+ LLTextBox* sendToTwitterTextBox = getChild<LLTextBox>("send_to_twitter_textbox");
+ sendToTwitterTextBox->setURLClickedCallback(boost::bind(&LLPanelSnapshotOptions::onSendToTwitter, this));
+ LLTextBox* sendToFlickrTextBox = getChild<LLTextBox>("send_to_flickr_textbox");
+ sendToFlickrTextBox->setURLClickedCallback(boost::bind(&LLPanelSnapshotOptions::onSendToFlickr, this));
+
+ return LLPanel::postBuild();
+}
+
+// virtual
void LLPanelSnapshotOptions::onOpen(const LLSD& key)
{
updateUploadCost();
@@ -118,3 +136,21 @@ void LLPanelSnapshotOptions::onSaveToComputer()
{
openPanel("panel_snapshot_local");
}
+
+void LLPanelSnapshotOptions::onSendToFacebook()
+{
+ LLFloaterReg::hideInstance("snapshot");
+ LLFloaterReg::showInstance("social");
+}
+
+void LLPanelSnapshotOptions::onSendToTwitter()
+{
+ LLFloaterReg::hideInstance("snapshot");
+ LLFloaterReg::showInstance("twitter");
+}
+
+void LLPanelSnapshotOptions::onSendToFlickr()
+{
+ LLFloaterReg::hideInstance("snapshot");
+ LLFloaterReg::showInstance("flickr");
+}
diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml
index 853c209bca..019ddad33c 100755
--- a/indra/newview/skins/default/xui/en/floater_snapshot.xml
+++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml
@@ -10,7 +10,7 @@
help_topic="snapshot"
save_rect="true"
save_visibility="false"
- title="SNAPSHOT PREVIEW"
+ title="SNAPSHOT"
width="470">
<floater.string
name="unknown">
diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml
index 61c8c971c2..eff60f8228 100755
--- a/indra/newview/skins/default/xui/en/panel_snapshot_options.xml
+++ b/indra/newview/skins/default/xui/en/panel_snapshot_options.xml
@@ -81,4 +81,40 @@
<button.commit_callback
function="Snapshot.SaveToComputer" />
</button>
+ <text
+ font="SansSerif"
+ layout="topleft"
+ length="1"
+ follows="top|left"
+ height="16"
+ left="10"
+ name="send_to_facebook_textbox"
+ top_pad="10"
+ type="string">
+ Send to: [secondlife:/// Facebook]
+ </text>
+ <text
+ font="SansSerif"
+ layout="topleft"
+ length="1"
+ follows="top|left"
+ height="16"
+ left="140"
+ name="send_to_twitter_textbox"
+ top_pad="-16"
+ type="string">
+ [secondlife:/// Twitter]
+ </text>
+ <text
+ font="SansSerif"
+ layout="topleft"
+ length="1"
+ follows="top|left"
+ height="16"
+ left="190"
+ name="send_to_flickr_textbox"
+ top_pad="-16"
+ type="string">
+ [secondlife:/// Flickr]
+ </text>
</panel>