From a1cc147829be2c341721ea75f713ac66279ad40c Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Mon, 8 Jul 2013 13:41:59 -0700
Subject: ACME-626 : More snapshot panel cleanup, autorefresh when changing
 resolution, simplify working messaging, add tooltip to the refresh button

---
 indra/newview/llfloatersocial.cpp                  | 37 +++-------------------
 indra/newview/llfloatersocial.h                    |  6 ----
 .../skins/default/xui/en/panel_social_photo.xml    | 29 ++---------------
 3 files changed, 7 insertions(+), 65 deletions(-)

(limited to 'indra')

diff --git a/indra/newview/llfloatersocial.cpp b/indra/newview/llfloatersocial.cpp
index 6d4262a599..9986a9c230 100644
--- a/indra/newview/llfloatersocial.cpp
+++ b/indra/newview/llfloatersocial.cpp
@@ -155,8 +155,6 @@ LLSocialPhotoPanel::LLSocialPhotoPanel() :
 mSnapshotPanel(NULL),
 mResolutionComboBox(NULL),
 mRefreshBtn(NULL),
-mRefreshLabel(NULL),
-mWorkingIndicator(NULL),
 mWorkingLabel(NULL),
 mThumbnailPlaceholder(NULL),
 mCaptionTextBox(NULL),
@@ -183,8 +181,6 @@ BOOL LLSocialPhotoPanel::postBuild()
 	mResolutionComboBox->setCommitCallback(boost::bind(&LLSocialPhotoPanel::updateResolution, this, TRUE));
 	mRefreshBtn = getChild<LLUICtrl>("new_snapshot_btn");
 	childSetAction("new_snapshot_btn", boost::bind(&LLSocialPhotoPanel::onClickNewSnapshot, this));
-	mRefreshLabel = getChild<LLUICtrl>("refresh_lbl");
-    mWorkingIndicator = getChild<LLLoadingIndicator>("working_indicator");
     mWorkingLabel = getChild<LLUICtrl>("working_lbl");
 	mThumbnailPlaceholder = getChild<LLUICtrl>("thumbnail_placeholder");
 	mCaptionTextBox = getChild<LLUICtrl>("caption");
@@ -226,23 +222,10 @@ 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);
-    }
+    // Update the visibility of the working (computing preview) label
+    mWorkingLabel->setVisible(!(previewp && previewp->getSnapshotUpToDate()));
     
+    // Draw the rest of the panel on top of it
 	LLPanel::draw();
 }
 
@@ -439,7 +422,7 @@ void LLSocialPhotoPanel::updateResolution(BOOL do_update)
 			{
 				lldebugs << "Will update controls" << llendl;
 				updateControls();
-				setNeedRefresh(true);
+                LLSocialPhotoPanel::onClickNewSnapshot();
 			}
 		}
 		
@@ -467,12 +450,6 @@ void LLSocialPhotoPanel::checkAspectRatio(S32 index)
 	}
 }
 
-void LLSocialPhotoPanel::setNeedRefresh(bool need)
-{
-	mRefreshLabel->setVisible(need);
-	mNeedRefresh = need;
-}
-
 LLUICtrl* LLSocialPhotoPanel::getRefreshBtn()
 {
 	return mRefreshBtn;
@@ -644,9 +621,6 @@ void LLFloaterSocial::preUpdate()
 	{
 		//Will set file size text to 'unknown'
 		instance->mSocialPhotoPanel->updateControls();
-
-		//Hides the refresh text
-		instance->mSocialPhotoPanel->setNeedRefresh(false);
 	}
 }
 
@@ -659,9 +633,6 @@ void LLFloaterSocial::postUpdate()
 		//Will set the file size text
 		instance->mSocialPhotoPanel->updateControls();
 
-		//Hides the refresh text
-		instance->mSocialPhotoPanel->setNeedRefresh(false);
-
 		// The refresh button is initially hidden. We show it after the first update,
 		// i.e. after snapshot is taken
 		LLUICtrl * refresh_button = instance->mSocialPhotoPanel->getRefreshBtn();
diff --git a/indra/newview/llfloatersocial.h b/indra/newview/llfloatersocial.h
index a39210108a..cc47fb61e1 100644
--- a/indra/newview/llfloatersocial.h
+++ b/indra/newview/llfloatersocial.h
@@ -28,7 +28,6 @@
 #define LL_LLFLOATERSOCIAL_H
 
 #include "llfloater.h"
-#include "llloadingindicator.h"
 #include "lltextbox.h"
 #include "llviewertexture.h"
 
@@ -74,7 +73,6 @@ public:
 	void updateControls();
 	void updateResolution(BOOL do_update);
 	void checkAspectRatio(S32 index);
-	void setNeedRefresh(bool need);
 	LLUICtrl* getRefreshBtn();
 
 private:
@@ -83,15 +81,11 @@ private:
 	LLUICtrl * mSnapshotPanel;
 	LLUICtrl * mResolutionComboBox;
 	LLUICtrl * mRefreshBtn;
-	LLUICtrl * mRefreshLabel;
-	LLLoadingIndicator * mWorkingIndicator;
 	LLUICtrl * mWorkingLabel;
 	LLUICtrl * mThumbnailPlaceholder;
 	LLUICtrl * mCaptionTextBox;
 	LLUICtrl * mLocationCheckbox;
 	LLUICtrl * mPostButton;
-
-	bool mNeedRefresh;
 };
 
 class LLSocialCheckinPanel : public LLPanel
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 d14e9ec82f..162884f01d 100644
--- a/indra/newview/skins/default/xui/en/panel_social_photo.xml
+++ b/indra/newview/skins/default/xui/en/panel_social_photo.xml
@@ -70,14 +70,6 @@
                 top="33"
                 follows="left|top"
                 left="9">
-              <loading_indicator
-               follows="left|top"
-               height="24"
-               name="working_indicator"
-               left="113"
-               top="59"
-               visible="false"
-               width="24" />
               <text
                follows="left|top|right"
                font="SansSerifBold"
@@ -91,33 +83,18 @@
                translate="false"
                type="string"
                visible="false">
-                Working
+                Refreshing...
               </text>
               <button
                follows="left|top"
                height="22"
                image_overlay="Refresh_Off"
-               left="10"
+               left="20"
                name="new_snapshot_btn"
+               tool_tip="Click to refresh"
                bottom="-10"
                visible="false"
                width="22" />
-              <text
-               follows="left|top"
-               font="SansSerifBold"
-               halign="left"
-               height="18"
-               left_pad="10"
-               length="1"
-               name="refresh_lbl"
-               text_color="red"
-               top_delta="4"
-               translate="false"
-               type="string"
-               visible="false"
-               width="130">
-                Refresh to save
-              </text>
             </panel>
             <text
              length="1"
-- 
cgit v1.2.3