summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeslie Linden <none@none>2011-06-01 12:28:49 -0700
committerLeslie Linden <none@none>2011-06-01 12:28:49 -0700
commitcbf38d7c95e5968f47850d082eee223e1cef1aff (patch)
treef7ddbc48a0bb84042d29fb03d6db2f8fd9135614
parente5ca2b4b82704d11172e0c32761138ec0f58fbe3 (diff)
EXP-841 FIX -- Create outbox sync button with basic enable/disable logic and animation
Functions are stubbed out. Time delay happens through basic coroutine to allow animation viewing. Reviewed by Leyla
-rw-r--r--indra/newview/llpanelmarketplaceoutbox.cpp93
-rw-r--r--indra/newview/llpanelmarketplaceoutbox.h19
-rw-r--r--indra/newview/skins/default/colors.xml5
-rw-r--r--indra/newview/skins/default/textures/icons/Inv_Gift.pngbin0 -> 1335 bytes
-rw-r--r--indra/newview/skins/default/textures/icons/Sync_Disabled.pngbin0 -> 1187 bytes
-rw-r--r--indra/newview/skins/default/textures/icons/Sync_Enabled.pngbin0 -> 1168 bytes
-rw-r--r--indra/newview/skins/default/textures/icons/Sync_Progress_1.pngbin0 -> 1149 bytes
-rw-r--r--indra/newview/skins/default/textures/icons/Sync_Progress_2.pngbin0 -> 1147 bytes
-rw-r--r--indra/newview/skins/default/textures/icons/Sync_Progress_3.pngbin0 -> 1211 bytes
-rw-r--r--indra/newview/skins/default/textures/icons/Sync_Progress_4.pngbin0 -> 1205 bytes
-rw-r--r--indra/newview/skins/default/textures/icons/Sync_Progress_5.pngbin0 -> 1137 bytes
-rw-r--r--indra/newview/skins/default/textures/icons/Sync_Progress_6.pngbin0 -> 1164 bytes
-rw-r--r--indra/newview/skins/default/textures/textures.xml15
-rw-r--r--indra/newview/skins/default/textures/widgets/Badge.pngbin958 -> 0 bytes
-rw-r--r--indra/newview/skins/default/textures/widgets/Badge_Background.pngbin0 -> 1352 bytes
-rw-r--r--indra/newview/skins/default/textures/widgets/Badge_Border.pngbin0 -> 1565 bytes
-rw-r--r--indra/newview/skins/default/xui/en/sidepanel_inventory.xml69
-rw-r--r--indra/newview/skins/default/xui/en/widgets/badge.xml2
18 files changed, 173 insertions, 30 deletions
diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp
index 1f58fb33a4..0151276f99 100644
--- a/indra/newview/llpanelmarketplaceoutbox.cpp
+++ b/indra/newview/llpanelmarketplaceoutbox.cpp
@@ -24,15 +24,26 @@
* $/LicenseInfo$
*/
-#include "llviewerprecompiledheaders.h"
+#include <boost/coroutine/coroutine.hpp>
+#include <boost/coroutine/future.hpp>
#include "llpanelmarketplaceoutbox.h"
+#include "llbutton.h"
+#include "llcoros.h"
+#include "lleventcoro.h"
+#include "llloadingindicator.h"
+#include "lltimer.h"
+
+
static LLRegisterPanelClassWrapper<LLPanelMarketplaceOutbox> t_panel_marketplace_outbox("panel_marketplace_outbox");
// protected
LLPanelMarketplaceOutbox::LLPanelMarketplaceOutbox()
-: LLPanel()
+ : LLPanel()
+ , mSyncButton(NULL)
+ , mSyncIndicator(NULL)
+ , mSyncInProgress(false)
{
}
@@ -43,5 +54,83 @@ LLPanelMarketplaceOutbox::~LLPanelMarketplaceOutbox()
// virtual
BOOL LLPanelMarketplaceOutbox::postBuild()
{
+ mSyncButton = getChild<LLButton>("outbox_sync_btn");
+ mSyncButton->setCommitCallback(boost::bind(&LLPanelMarketplaceOutbox::onSyncButtonClicked, this));
+
+ mSyncIndicator = getChild<LLLoadingIndicator>("outbox_sync_indicator");
+
+ mSyncButton->setEnabled(!isOutboxEmpty());
+
return TRUE;
}
+
+bool LLPanelMarketplaceOutbox::isOutboxEmpty() const
+{
+ // TODO: Check for contents of outbox
+
+ return false;
+}
+
+bool LLPanelMarketplaceOutbox::isSyncInProgress() const
+{
+ return mSyncInProgress;
+}
+
+
+std::string gTimeDelayDebugFunc = "";
+
+void timeDelay(LLCoros::self& self, LLPanelMarketplaceOutbox* outboxPanel)
+{
+ waitForEventOn(self, "mainloop");
+
+ LLTimer delayTimer;
+ delayTimer.reset();
+ delayTimer.setTimerExpirySec(5.0f);
+
+ while (!delayTimer.hasExpired())
+ {
+ waitForEventOn(self, "mainloop");
+ }
+
+ outboxPanel->onSyncComplete();
+
+ gTimeDelayDebugFunc = "";
+}
+
+void LLPanelMarketplaceOutbox::onSyncButtonClicked()
+{
+ // TODO: Actually trigger sync to marketplace
+
+ mSyncInProgress = true;
+ updateSyncButtonStatus();
+
+ // Set a timer (for testing only)
+
+ gTimeDelayDebugFunc = LLCoros::instance().launch("LLPanelMarketplaceOutbox timeDelay", boost::bind(&timeDelay, _1, this));
+}
+
+void LLPanelMarketplaceOutbox::onSyncComplete()
+{
+ mSyncInProgress = false;
+
+ updateSyncButtonStatus();
+}
+
+void LLPanelMarketplaceOutbox::updateSyncButtonStatus()
+{
+ if (isSyncInProgress())
+ {
+ mSyncButton->setVisible(false);
+
+ mSyncIndicator->setVisible(true);
+ mSyncIndicator->start();
+ }
+ else
+ {
+ mSyncIndicator->stop();
+ mSyncIndicator->setVisible(false);
+
+ mSyncButton->setVisible(true);
+ mSyncButton->setEnabled(!isOutboxEmpty());
+ }
+}
diff --git a/indra/newview/llpanelmarketplaceoutbox.h b/indra/newview/llpanelmarketplaceoutbox.h
index a6a28e0a83..2fbe819762 100644
--- a/indra/newview/llpanelmarketplaceoutbox.h
+++ b/indra/newview/llpanelmarketplaceoutbox.h
@@ -29,6 +29,11 @@
#include "llpanel.h"
+
+class LLButton;
+class LLLoadingIndicator;
+
+
class LLPanelMarketplaceOutbox : public LLPanel
{
public:
@@ -39,6 +44,20 @@ public:
~LLPanelMarketplaceOutbox();
/*virtual*/ BOOL postBuild();
+
+ bool isOutboxEmpty() const;
+ bool isSyncInProgress() const;
+
+ void onSyncComplete();
+
+protected:
+ void onSyncButtonClicked();
+ void updateSyncButtonStatus();
+
+private:
+ LLButton * mSyncButton;
+ LLLoadingIndicator * mSyncIndicator;
+ bool mSyncInProgress;
};
diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml
index 0795e38366..a548849d60 100644
--- a/indra/newview/skins/default/colors.xml
+++ b/indra/newview/skins/default/colors.xml
@@ -134,7 +134,10 @@
reference="AvatarListItemIconOfflineColor" />
<color
name="BadgeImageColor"
- value="0.25 0.85 0.25 1.0" />
+ value="0.44 0.69 0.56 1.0" />
+ <color
+ name="BadgeImageBorderColor"
+ value="0.9 0.9 0.9 1.0" />
<color
name="BadgeLabelColor"
reference="White" />
diff --git a/indra/newview/skins/default/textures/icons/Inv_Gift.png b/indra/newview/skins/default/textures/icons/Inv_Gift.png
new file mode 100644
index 0000000000..5afe85d72d
--- /dev/null
+++ b/indra/newview/skins/default/textures/icons/Inv_Gift.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Sync_Disabled.png b/indra/newview/skins/default/textures/icons/Sync_Disabled.png
new file mode 100644
index 0000000000..ca2e8def97
--- /dev/null
+++ b/indra/newview/skins/default/textures/icons/Sync_Disabled.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Sync_Enabled.png b/indra/newview/skins/default/textures/icons/Sync_Enabled.png
new file mode 100644
index 0000000000..bc236c8b98
--- /dev/null
+++ b/indra/newview/skins/default/textures/icons/Sync_Enabled.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Sync_Progress_1.png b/indra/newview/skins/default/textures/icons/Sync_Progress_1.png
new file mode 100644
index 0000000000..624e556376
--- /dev/null
+++ b/indra/newview/skins/default/textures/icons/Sync_Progress_1.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Sync_Progress_2.png b/indra/newview/skins/default/textures/icons/Sync_Progress_2.png
new file mode 100644
index 0000000000..5769803b3f
--- /dev/null
+++ b/indra/newview/skins/default/textures/icons/Sync_Progress_2.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Sync_Progress_3.png b/indra/newview/skins/default/textures/icons/Sync_Progress_3.png
new file mode 100644
index 0000000000..92d4bfb020
--- /dev/null
+++ b/indra/newview/skins/default/textures/icons/Sync_Progress_3.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Sync_Progress_4.png b/indra/newview/skins/default/textures/icons/Sync_Progress_4.png
new file mode 100644
index 0000000000..6d43eb3a9f
--- /dev/null
+++ b/indra/newview/skins/default/textures/icons/Sync_Progress_4.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Sync_Progress_5.png b/indra/newview/skins/default/textures/icons/Sync_Progress_5.png
new file mode 100644
index 0000000000..766d063c99
--- /dev/null
+++ b/indra/newview/skins/default/textures/icons/Sync_Progress_5.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/icons/Sync_Progress_6.png b/indra/newview/skins/default/textures/icons/Sync_Progress_6.png
new file mode 100644
index 0000000000..dfe7f68b72
--- /dev/null
+++ b/indra/newview/skins/default/textures/icons/Sync_Progress_6.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml
index f0a1893502..a6e71cc38e 100644
--- a/indra/newview/skins/default/textures/textures.xml
+++ b/indra/newview/skins/default/textures/textures.xml
@@ -72,11 +72,11 @@ with the same filename but different name
<texture name="BackButton_Over" file_name="icons/back_arrow_over.png" preload="false" scale.left="22" scale.top="12" scale.right="25" scale.bottom="12" />
<texture name="BackButton_Press" file_name="icons/back_arrow_press.png" preload="false" scale.left="22" scale.top="12" scale.right="25" scale.bottom="12" />
- <texture name="Badge" file_name="widgets/Badge.png" preload="true" scale.left="9" scale.top="12" scale.right="248" scale.bottom="12" />
+ <texture name="Badge_Background" file_name="widgets/Badge_Background.png" preload="true" scale.left="9" scale.top="12" scale.right="248" scale.bottom="12" />
+ <texture name="Badge_Border" file_name="widgets/Badge_Border.png" preload="true" scale.left="9" scale.top="12" scale.right="248" scale.bottom="12" />
<texture name="Blank" file_name="Blank.png" preload="false" />
-
<texture name="BuyArrow_Over" file_name="navbar/BuyArrow_Over.png" preload="true" scale.left="0" scale.top="1" scale.right="0" scale.bottom="0" />
<texture name="BuyArrow_Press" file_name="navbar/BuyArrow_Press.png" preload="true" scale.left="1" scale.top="1" scale.right="0" scale.bottom="0" />
@@ -479,7 +479,16 @@ with the same filename but different name
<texture name="StopReload_Off" file_name="icons/StopReload_Off.png" preload="false" />
<texture name="StopReload_Over" file_name="icons/StopReload_Over.png" preload="false" />
- <texture name="TabIcon_Appearance_Off" file_name="taskpanel/TabIcon_Appearance_Off.png" preload="false" />
+ <texture name="Sync_Disabled" file_name="icons/Sync_Disabled.png" preload="true" />
+ <texture name="Sync_Enabled" file_name="icons/Sync_Enabled.png" preload="true" />
+ <texture name="Sync_Progress_1" file_name="icons/Sync_Progress_1.png" preload="true" />
+ <texture name="Sync_Progress_2" file_name="icons/Sync_Progress_2.png" preload="true" />
+ <texture name="Sync_Progress_3" file_name="icons/Sync_Progress_3.png" preload="true" />
+ <texture name="Sync_Progress_4" file_name="icons/Sync_Progress_4.png" preload="true" />
+ <texture name="Sync_Progress_5" file_name="icons/Sync_Progress_5.png" preload="true" />
+ <texture name="Sync_Progress_6" file_name="icons/Sync_Progress_6.png" preload="true" />
+
+ <texture name="TabIcon_Appearance_Off" file_name="taskpanel/TabIcon_Appearance_Off.png" preload="false" />
<texture name="TabIcon_Appearance_Selected" file_name="taskpanel/TabIcon_Appearance_Selected.png" preload="false" />
<texture name="TabIcon_Close_Off" file_name="taskpanel/TabIcon_Close_Off.png" preload="false" />
<texture name="TabIcon_Home_Off" file_name="taskpanel/TabIcon_Home_Off.png" preload="false" />
diff --git a/indra/newview/skins/default/textures/widgets/Badge.png b/indra/newview/skins/default/textures/widgets/Badge.png
deleted file mode 100644
index 862b13d219..0000000000
--- a/indra/newview/skins/default/textures/widgets/Badge.png
+++ /dev/null
Binary files differ
diff --git a/indra/newview/skins/default/textures/widgets/Badge_Background.png b/indra/newview/skins/default/textures/widgets/Badge_Background.png
new file mode 100644
index 0000000000..5089c30312
--- /dev/null
+++ b/indra/newview/skins/default/textures/widgets/Badge_Background.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/widgets/Badge_Border.png b/indra/newview/skins/default/textures/widgets/Badge_Border.png
new file mode 100644
index 0000000000..4b086a63fb
--- /dev/null
+++ b/indra/newview/skins/default/textures/widgets/Badge_Border.png
Binary files differ
diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
index fa79975669..ffc018b856 100644
--- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
+++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml
@@ -124,37 +124,60 @@
height="125"
width="310">
<button
- label="MARKETPLACE OUTBOX"
- is_toggle="true"
- name="outbox_btn"
- follows="top|left|right"
- image_unselected="MarketplaceBtn_Off"
- image_selected="MarketplaceBtn_Selected"
- height="35"
- tab_stop="false"
- width="308"
- halign="left"
- pad_left="35"
- top="0"
+ label="MARKETPLACE OUTBOX"
+ is_toggle="true"
+ name="outbox_btn"
+ follows="top|left|right"
+ image_unselected="MarketplaceBtn_Off"
+ image_selected="MarketplaceBtn_Selected"
+ height="35"
+ tab_stop="false"
+ width="308"
+ halign="left"
+ pad_left="35"
+ top="0"
left="0" />
- <button
- label="SYNC"
+ <button
+ image_disabled="Sync_Disabled"
+ image_disabled_selected="Sync_Disabled"
+ image_unselected="Sync_Enabled"
+ image_selected="Sync_Enabled"
+ label=""
is_toggle="false"
name="outbox_sync_btn"
follows="top|right"
- height="25"
+ height="16"
tab_stop="false"
- width="45"
+ width="16"
halign="center"
- top="5"
- left="-50"
+ top="10"
+ left="-40"
enabled="false" />
+ <loading_indicator
+ follows="top|right"
+ name="outbox_sync_indicator"
+ top="10"
+ left="-40"
+ height="16"
+ width="16"
+ images_per_sec="1.0"
+ tab_stop="false"
+ visible="false">
+ <images>
+ <image name="Sync_Progress_1"/>
+ <image name="Sync_Progress_2"/>
+ <image name="Sync_Progress_3"/>
+ <image name="Sync_Progress_4"/>
+ <image name="Sync_Progress_5"/>
+ <image name="Sync_Progress_6"/>
+ </images>
+ </loading_indicator>
<panel
- follows="all"
- left="0"
- height="90"
- width="250"
- top="30"
+ follows="all"
+ left="0"
+ height="90"
+ width="250"
+ top="30"
>
<text
left ="40"
diff --git a/indra/newview/skins/default/xui/en/widgets/badge.xml b/indra/newview/skins/default/xui/en/widgets/badge.xml
index 4eb633ac0c..ceec09d1e4 100644
--- a/indra/newview/skins/default/xui/en/widgets/badge.xml
+++ b/indra/newview/skins/default/xui/en/widgets/badge.xml
@@ -2,7 +2,7 @@
<!-- Additional attributes:
-->
<badge font="SansSerifSmall"
- image="Badge"
+ image="Badge_Background"
image_color="BadgeImageColor"
label_color="BadgeLabelColor"
location="top_left"