diff options
author | Merov Linden <merov@lindenlab.com> | 2014-02-25 21:54:09 -0800 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2014-02-25 21:54:09 -0800 |
commit | d220657d8525ccfa246e0f49904e18cc36458b28 (patch) | |
tree | 2405915c3d04247d3a66f52d071d43684ad9d7e9 /indra/newview/llfloaterflickr.cpp | |
parent | 3fbaff17bf65a826dd8b9bd50dc460aacaa3cb00 (diff) |
ACME-1327 : WIP : Added big preview to the Flickr photo panel, uses the thumbnail for the moment
Diffstat (limited to 'indra/newview/llfloaterflickr.cpp')
-rw-r--r-- | indra/newview/llfloaterflickr.cpp | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/indra/newview/llfloaterflickr.cpp b/indra/newview/llfloaterflickr.cpp index 61f1487d4b..21c619730c 100644 --- a/indra/newview/llfloaterflickr.cpp +++ b/indra/newview/llfloaterflickr.cpp @@ -44,6 +44,7 @@ #include "llslurl.h" #include "lltrans.h" #include "llsnapshotlivepreview.h" +#include "llfloaterbigpreview.h" #include "llviewerregion.h" #include "llviewercontrol.h" #include "llviewermedia.h" @@ -76,6 +77,7 @@ mPostButton(NULL) { mCommitCallbackRegistrar.add("SocialSharing.SendPhoto", boost::bind(&LLFlickrPhotoPanel::onSend, this)); mCommitCallbackRegistrar.add("SocialSharing.RefreshPhoto", boost::bind(&LLFlickrPhotoPanel::onClickNewSnapshot, this)); + mCommitCallbackRegistrar.add("SocialSharing.BigPreview", boost::bind(&LLFlickrPhotoPanel::onClickBigPreview, this)); } LLFlickrPhotoPanel::~LLFlickrPhotoPanel() @@ -227,7 +229,7 @@ void LLFlickrPhotoPanel::onVisibilityChange(const LLSD& new_visibility) LLSnapshotLivePreview::Params p; p.rect(full_screen_rect); LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(p); - mPreviewHandle = previewp->getHandle(); + mPreviewHandle = previewp->getHandle(); previewp->setContainer(this); previewp->setSnapshotType(previewp->SNAPSHOT_WEB); @@ -251,6 +253,18 @@ void LLFlickrPhotoPanel::onClickNewSnapshot() } } +void LLFlickrPhotoPanel::onClickBigPreview() +{ + LLFloaterBigPreview* big_preview_floater = dynamic_cast<LLFloaterBigPreview*>(LLFloaterReg::getInstance("big_preview")); + if (big_preview_floater) + { + LLSnapshotLivePreview* previewp = getPreviewView(); + big_preview_floater->setPreview(previewp); + big_preview_floater->setFloaterOwner(getParentByType<LLFloater>()); + } + LLFloaterReg::showInstance("big_preview"); +} + void LLFlickrPhotoPanel::onSend() { LLEventPumps::instance().obtain("FlickrConnectState").stopListening("LLFlickrPhotoPanel"); // just in case it is already listening @@ -340,6 +354,11 @@ void LLFlickrPhotoPanel::clearAndClose() LLFloater* floater = getParentByType<LLFloater>(); if (floater) { + LLFloaterBigPreview* big_preview_floater = dynamic_cast<LLFloaterBigPreview*>(LLFloaterReg::getInstance("big_preview")); + if (big_preview_floater) + { + big_preview_floater->closeOnFloaterOwnerClosing(floater); + } floater->closeFloater(); } } @@ -615,8 +634,23 @@ LLFloaterFlickr::LLFloaterFlickr(const LLSD& key) : LLFloater(key), mCommitCallbackRegistrar.add("SocialSharing.Cancel", boost::bind(&LLFloaterFlickr::onCancel, this)); } +void LLFloaterFlickr::onClose(bool app_quitting) +{ + LLFloaterBigPreview* big_preview_floater = dynamic_cast<LLFloaterBigPreview*>(LLFloaterReg::getInstance("big_preview")); + if (big_preview_floater) + { + big_preview_floater->closeOnFloaterOwnerClosing(this); + } + LLFloater::onClose(app_quitting); +} + void LLFloaterFlickr::onCancel() { + LLFloaterBigPreview* big_preview_floater = dynamic_cast<LLFloaterBigPreview*>(LLFloaterReg::getInstance("big_preview")); + if (big_preview_floater) + { + big_preview_floater->closeOnFloaterOwnerClosing(this); + } closeFloater(); } |