summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterflickr.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2014-01-30 18:53:05 -0800
committerMerov Linden <merov@lindenlab.com>2014-01-30 18:53:05 -0800
commite970fa7f1ce9190b8a26e72bebbcceed04fb7494 (patch)
treee59c616660b9ce7e0c9fad5384d37422438fbf61 /indra/newview/llfloaterflickr.cpp
parentc7c755b82e736050a514792a4c4bbdee9bf981d3 (diff)
ACME-1293 : Use notification to signal from the snapshot panel to its container rather than grabbing global instances, use unique control_name for widgets, fix Post button visibility on Twitter
Diffstat (limited to 'indra/newview/llfloaterflickr.cpp')
-rw-r--r--indra/newview/llfloaterflickr.cpp61
1 files changed, 29 insertions, 32 deletions
diff --git a/indra/newview/llfloaterflickr.cpp b/indra/newview/llfloaterflickr.cpp
index 244a34c782..2c8ec56941 100644
--- a/indra/newview/llfloaterflickr.cpp
+++ b/indra/newview/llfloaterflickr.cpp
@@ -118,6 +118,34 @@ BOOL LLFlickrPhotoPanel::postBuild()
return LLPanel::postBuild();
}
+// virtual
+S32 LLFlickrPhotoPanel::notify(const LLSD& info)
+{
+ if (info.has("snapshot-updating"))
+ {
+ // Disable the Post button and whatever else while the snapshot is not updated
+ // updateControls();
+ return 1;
+ }
+
+ if (info.has("snapshot-updated"))
+ {
+ // Enable the send/post/save buttons.
+ updateControls();
+
+ // The refresh button is initially hidden. We show it after the first update,
+ // i.e. after snapshot is taken
+ LLUICtrl * refresh_button = getRefreshBtn();
+ if (!refresh_button->getVisible())
+ {
+ refresh_button->setVisible(true);
+ }
+ return 1;
+ }
+
+ return 0;
+}
+
void LLFlickrPhotoPanel::draw()
{
LLSnapshotLivePreview * previewp = static_cast<LLSnapshotLivePreview *>(mPreviewHandle.get());
@@ -201,6 +229,7 @@ void LLFlickrPhotoPanel::onVisibilityChange(const LLSD& new_visibility)
LLSnapshotLivePreview* previewp = new LLSnapshotLivePreview(p);
mPreviewHandle = previewp->getHandle();
+ previewp->setContainer(this);
previewp->setSnapshotType(previewp->SNAPSHOT_WEB);
previewp->setSnapshotFormat(LLFloaterSnapshot::SNAPSHOT_FORMAT_JPEG);
previewp->setThumbnailSubsampled(TRUE); // We want the preview to reflect the *saved* image
@@ -605,38 +634,6 @@ void LLFloaterFlickr::showPhotoPanel()
parent->selectTabPanel(mFlickrPhotoPanel);
}
-// static
-void LLFloaterFlickr::preUpdate()
-{
- LLFloaterFlickr* instance = LLFloaterReg::findTypedInstance<LLFloaterFlickr>("flickr");
- if (instance)
- {
- //Will set file size text to 'unknown'
- instance->mFlickrPhotoPanel->updateControls();
- }
-}
-
-// static
-void LLFloaterFlickr::postUpdate()
-{
- LLFloaterFlickr* instance = LLFloaterReg::findTypedInstance<LLFloaterFlickr>("flickr");
- if (instance)
- {
- //Will set the file size text
- instance->mFlickrPhotoPanel->updateControls();
-
- // The refresh button is initially hidden. We show it after the first update,
- // i.e. after snapshot is taken
- LLUICtrl * refresh_button = instance->mFlickrPhotoPanel->getRefreshBtn();
-
- if (!refresh_button->getVisible())
- {
- refresh_button->setVisible(true);
- }
-
- }
-}
-
void LLFloaterFlickr::draw()
{
if (mStatusErrorText && mStatusLoadingText && mStatusLoadingIndicator)