added SLShare links to snapshot floater for ACME-1167
parent
389ddfd5ad
commit
15434d53ea
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
@ -73,6 +78,19 @@ LLPanelSnapshotOptions::~LLPanelSnapshotOptions()
|
|||
LLGlobalEconomy::Singleton::getInstance()->removeObserver(this);
|
||||
}
|
||||
|
||||
// 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)
|
||||
{
|
||||
|
|
@ -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");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
help_topic="snapshot"
|
||||
save_rect="true"
|
||||
save_visibility="false"
|
||||
title="SNAPSHOT PREVIEW"
|
||||
title="SNAPSHOT"
|
||||
width="470">
|
||||
<floater.string
|
||||
name="unknown">
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue