From 5c88b679bd2f66fd6fa358ca93047c0aba781e22 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sun, 7 Jul 2013 22:59:51 -0700 Subject: ACME-626 : More snapshot code cleanup, suppress failure/success indicators since we have a bottom message for that, show/hide the progress indicator --- indra/newview/llfloatersocial.cpp | 27 +++++++++-- indra/newview/llfloatersocial.h | 5 ++- .../skins/default/xui/en/panel_social_photo.xml | 52 ---------------------- 3 files changed, 26 insertions(+), 58 deletions(-) diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp index 58a9edc524..6d4262a599 100644 --- a/indra/newview/llfloatersocial.cpp +++ b/indra/newview/llfloatersocial.cpp @@ -156,8 +156,8 @@ mSnapshotPanel(NULL), mResolutionComboBox(NULL), mRefreshBtn(NULL), mRefreshLabel(NULL), -mSucceessLblPanel(NULL), -mFailureLblPanel(NULL), +mWorkingIndicator(NULL), +mWorkingLabel(NULL), mThumbnailPlaceholder(NULL), mCaptionTextBox(NULL), mLocationCheckbox(NULL), @@ -184,8 +184,8 @@ BOOL LLSocialPhotoPanel::postBuild() mRefreshBtn = getChild("new_snapshot_btn"); childSetAction("new_snapshot_btn", boost::bind(&LLSocialPhotoPanel::onClickNewSnapshot, this)); mRefreshLabel = getChild("refresh_lbl"); - mSucceessLblPanel = getChild("succeeded_panel"); - mFailureLblPanel = getChild("failed_panel"); + mWorkingIndicator = getChild("working_indicator"); + mWorkingLabel = getChild("working_lbl"); mThumbnailPlaceholder = getChild("thumbnail_placeholder"); mCaptionTextBox = getChild("caption"); mLocationCheckbox = getChild("add_location_cb"); @@ -198,6 +198,7 @@ void LLSocialPhotoPanel::draw() { LLSnapshotLivePreview * previewp = static_cast(mPreviewHandle.get()); + // Display the preview if one is available if (previewp && previewp->getThumbnailImage()) { const LLRect& thumbnail_rect = mThumbnailPlaceholder->getRect(); @@ -224,6 +225,24 @@ void LLSocialPhotoPanel::draw() previewp->drawPreviewRect(offset_x, offset_y) ; } + + // Update the visibility of the working (computing preview) indicators + if (previewp && previewp->getSnapshotUpToDate()) + { + if (mWorkingIndicator->getVisible()) + { + mWorkingIndicator->setVisible(false); + mWorkingIndicator->stop(); + mWorkingLabel->setVisible(false); + } + } + else if (!mWorkingIndicator->getVisible()) + { + mWorkingIndicator->setVisible(true); + mWorkingIndicator->start(); + mWorkingLabel->setVisible(true); + } + LLPanel::draw(); } diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h index 5e1ee6be0e..a39210108a 100644 --- a/indra/newview/llfloatersocial.h +++ b/indra/newview/llfloatersocial.h @@ -28,6 +28,7 @@ #define LL_LLFLOATERSOCIAL_H #include "llfloater.h" +#include "llloadingindicator.h" #include "lltextbox.h" #include "llviewertexture.h" @@ -83,8 +84,8 @@ private: LLUICtrl * mResolutionComboBox; LLUICtrl * mRefreshBtn; LLUICtrl * mRefreshLabel; - LLUICtrl * mSucceessLblPanel; - LLUICtrl * mFailureLblPanel; + LLLoadingIndicator * mWorkingIndicator; + LLUICtrl * mWorkingLabel; LLUICtrl * mThumbnailPlaceholder; LLUICtrl * mCaptionTextBox; LLUICtrl * mLocationCheckbox; diff --git a/indra/newview/skins/default/xui/en/panel_social_photo.xml b/indra/newview/skins/default/xui/en/panel_social_photo.xml index 72e5286fe6..d14e9ec82f 100644 --- a/indra/newview/skins/default/xui/en/panel_social_photo.xml +++ b/indra/newview/skins/default/xui/en/panel_social_photo.xml @@ -70,58 +70,6 @@ top="33" follows="left|top" left="9"> - - - Succeeded - - - - - Failed - -