summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorCho <cho@lindenlab.com>2013-06-28 22:31:18 +0100
committerCho <cho@lindenlab.com>2013-06-28 22:31:18 +0100
commitdb8422f7841ab875c9dc636e10ae5993216d4a5b (patch)
tree9d58d02927a0a018b3b02d512d4f31b01a8f335d /indra/newview
parent8c36966a07a599269c3a0fa2fca2f8ba1844e06f (diff)
made sure photo preview is only generated when photo tab is visible for ACME-649
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfloatersocial.cpp48
-rw-r--r--indra/newview/llfloatersocial.h1
2 files changed, 25 insertions, 24 deletions
diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index d6c00b7c86..4660644969 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -246,20 +246,32 @@ LLSnapshotLivePreview* LLSocialPhotoPanel::getPreviewView()
void LLSocialPhotoPanel::onVisibilityChange(const LLSD& new_visibility)
{
bool visible = new_visibility.asBoolean();
- if (visible && !mPreviewHandle.get())
+ if (visible)
{
- 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(mThumbnailPlaceholder->getRect());
-
- updateControls();
+ if (mPreviewHandle.get())
+ {
+ LLSnapshotLivePreview* preview = getPreviewView();
+ if(preview)
+ {
+ lldebugs << "opened, updating snapshot" << llendl;
+ preview->updateSnapshot(TRUE);
+ }
+ }
+ else
+ {
+ 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(mThumbnailPlaceholder->getRect());
+
+ updateControls();
+ }
}
}
@@ -531,16 +543,6 @@ BOOL LLFloaterSocial::postBuild()
return LLFloater::postBuild();
}
-void LLFloaterSocial::onOpen(const LLSD& key)
-{
- LLSnapshotLivePreview* preview = mSocialPhotoPanel->getPreviewView();
- if(preview)
- {
- lldebugs << "opened, updating snapshot" << llendl;
- preview->updateSnapshot(TRUE);
- }
-}
-
// static
void LLFloaterSocial::preUpdate()
{
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index 95ba688430..89b9e2016a 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -110,7 +110,6 @@ public:
LLFloaterSocial(const LLSD& key);
BOOL postBuild();
void onCancel();
- void onOpen(const LLSD& key);
static void preUpdate();
static void postUpdate();