ACME-626 : More snapshot code cleanup, suppress failure/success indicators since we have a bottom message for that, show/hide the progress indicator

meow-7.2.2
Merov Linden 2013-07-07 22:59:51 -07:00
parent 8494e04a75
commit 5c88b679bd
3 changed files with 26 additions and 58 deletions

View File

@ -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<LLUICtrl>("new_snapshot_btn");
childSetAction("new_snapshot_btn", boost::bind(&LLSocialPhotoPanel::onClickNewSnapshot, this));
mRefreshLabel = getChild<LLUICtrl>("refresh_lbl");
mSucceessLblPanel = getChild<LLUICtrl>("succeeded_panel");
mFailureLblPanel = getChild<LLUICtrl>("failed_panel");
mWorkingIndicator = getChild<LLLoadingIndicator>("working_indicator");
mWorkingLabel = getChild<LLUICtrl>("working_lbl");
mThumbnailPlaceholder = getChild<LLUICtrl>("thumbnail_placeholder");
mCaptionTextBox = getChild<LLUICtrl>("caption");
mLocationCheckbox = getChild<LLUICtrl>("add_location_cb");
@ -198,6 +198,7 @@ void LLSocialPhotoPanel::draw()
{
LLSnapshotLivePreview * previewp = static_cast<LLSnapshotLivePreview *>(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();
}

View File

@ -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;

View File

@ -70,58 +70,6 @@
top="33"
follows="left|top"
left="9">
<panel
background_visible="true"
bg_alpha_color="0.9 1 0.9 1"
follows="left|top"
height="20"
width="250"
top="0"
left="0"
name="succeeded_panel"
visible="false">
<text
follows="all"
font="SansSerif"
halign="center"
height="18"
left="1"
length="1"
name="succeeded_lbl"
right="-1"
text_color="0.2 0.5 0.2 1"
top="4"
translate="false"
type="string">
Succeeded
</text>
</panel>
<panel
background_visible="true"
bg_alpha_color="1 0.9 0.9 1"
follows="left|top"
height="20"
width="250"
top="0"
left="0"
name="failed_panel"
visible="false">
<text
follows="all"
font="SansSerif"
halign="center"
height="18"
left="1"
length="1"
name="failed_lbl"
right="-1"
text_color="0.5 0.2 0.2 1"
top="4"
translate="false"
type="string">
Failed
</text>
</panel>
<loading_indicator
follows="left|top"
height="24"