summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGilbert Gonzales <gilbert@lindenlab.com>2013-06-27 16:47:16 -0700
committerGilbert Gonzales <gilbert@lindenlab.com>2013-06-27 16:47:16 -0700
commitcf80403ffc0aa23ea5a467b87d0d28a808e9c16d (patch)
treecdaa4101a5d6c3171c906ff4ddab83823ef114b3
parent0b34d1c34cccd1ed95f17293ef941289b40e39f9 (diff)
parent1d54e25990b5e28a6fd7f352bfa26473aec53d6d (diff)
merge
-rw-r--r--indra/newview/llfloatersocial.cpp33
-rw-r--r--indra/newview/llfloatersocial.h1
2 files changed, 23 insertions, 11 deletions
diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 594773c556..8d026471dc 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -128,6 +128,8 @@ LLSocialPhotoPanel::~LLSocialPhotoPanel()
BOOL LLSocialPhotoPanel::postBuild()
{
+ setVisibleCallback(boost::bind(&LLSocialPhotoPanel::onVisibilityChange, this, _2));
+
mPostButton = getChild<LLUICtrl>("post_btn");
mResolutionComboBox = getChild<LLUICtrl>("resolution_combobox");
mResolutionComboBox->setCommitCallback(boost::bind(&LLSocialPhotoPanel::onResolutionComboCommit, this));
@@ -138,17 +140,6 @@ BOOL LLSocialPhotoPanel::postBuild()
mFailureLblPanel = getChild<LLUICtrl>("failed_panel");
mThumbnailPlaceholder = getChild<LLUICtrl>("thumbnail_placeholder");
- 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(getThumbnailPlaceholderRect());
-
return LLPanel::postBuild();
}
@@ -293,6 +284,26 @@ void LLSocialPhotoPanel::updateControls()
updateResolution(combo, instance, FALSE);
}
+void LLSocialPhotoPanel::onVisibilityChange(const LLSD& new_visibility)
+{
+ bool visible = new_visibility.asBoolean();
+ if (visible && !mPreviewHandle.get())
+ {
+ 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(getThumbnailPlaceholderRect());
+
+ updateControls();
+ }
+}
+
void LLSocialPhotoPanel::draw()
{
LLSnapshotLivePreview * previewp = static_cast<LLSnapshotLivePreview *>(mPreviewHandle.get());
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index 6411843b9c..6675a990f4 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -70,6 +70,7 @@ class LLSocialPhotoPanel : public LLPanel
LLSnapshotLivePreview* getPreviewView();
void updateControls();
+ void onVisibilityChange(const LLSD& new_visibility);
LLUICtrl * mResolutionComboBox;
LLUICtrl *mRefreshBtn, *mRefreshLabel;